:root {
  --bg:#f2f1ed;--surface:#fff;--surface2:#f7f6f3;--border:#e2e0d8;
  --primary:#1a6b5a;--primary-l:#eaf4f1;--primary-d:#12503f;
  --accent:#d03d2a;--text:#1a1917;--muted:#78766e;
  --radius:16px;--shadow:0 4px 20px rgba(0,0,0,.09),0 1px 3px rgba(0,0,0,.04);
  --shadow-sm:0 2px 8px rgba(0,0,0,.06);
  --tr:.2s cubic-bezier(.4,0,.2,1);
}
/* INCOLLA QUI TUTTO IL RESTO DEL TUO CSS ORIGINALE (da *,*::before fino in fondo) */
:root{
  --bg:#f2f1ed;--surface:#fff;--surface2:#f7f6f3;--border:#e2e0d8;
  --primary:#1a6b5a;--primary-l:#eaf4f1;--primary-d:#12503f;
  --accent:#d03d2a;--text:#1a1917;--muted:#78766e;
  --radius:16px;--shadow:0 4px 20px rgba(0,0,0,.09),0 1px 3px rgba(0,0,0,.04);
  --shadow-sm:0 2px 8px rgba(0,0,0,.06);
  --tr:.2s cubic-bezier(.4,0,.2,1);
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;overflow-x:hidden}
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;display:flex;flex-direction:column;align-items:center;padding-top:52px;overflow-x:hidden;max-width:100vw}

/* top band */
.top-band{width:100%;height:4px;background:linear-gradient(90deg,#009246,#fff 50%,#ce2b37);flex-shrink:0}
.page{width:100%;max-width:700px;padding:0 1.25rem 5rem}

/* header */
.header{padding:2.75rem 0 2.25rem;animation:fadeDown .5s ease both}
.header h1{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:clamp(1.9rem,6.5vw,3rem);font-weight:700;line-height:1.15;letter-spacing:-.025em}
.header h1 em{font-style:italic;color:var(--primary)}
.header .subtitle{margin-top:.7rem;color:var(--muted);font-size:.95rem;line-height:1.65;max-width:460px;font-weight:400}
.header-rule{width:40px;height:3px;background:var(--primary);border-radius:99px;margin:1.1rem 0}

/* progress */
.progress-area{margin-bottom:1.1rem;animation:fadeDown .5s .06s ease both}
.progress-top{display:flex;align-items:center;gap:.75rem;margin-bottom:.55rem}
.back-btn{display:flex;align-items:center;gap:.3rem;background:var(--surface);border:1.5px solid var(--border);border-radius:99px;color:var(--muted);cursor:pointer;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:.75rem;font-weight:700;padding:.3rem .75rem;transition:border-color var(--tr),color var(--tr);white-space:nowrap;flex-shrink:0}
.back-btn:hover{border-color:var(--primary);color:var(--primary)}
.back-btn.hidden{visibility:hidden;pointer-events:none}
.progress-label{font-size:.82rem;font-weight:700;color:var(--text);flex:1}
.progress-pct{font-size:.78rem;color:var(--muted);flex-shrink:0}
.progress-track{height:5px;background:var(--surface);border-radius:99px;overflow:hidden;border:1px solid var(--border)}
.progress-fill{width:0;height:100%;background:linear-gradient(90deg,var(--primary-d),var(--primary),#4eb59e);border-radius:99px;transition:width .45s cubic-bezier(.4,0,.2,1)}

/* quiz card */
.quiz-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:2rem 1.75rem 1.75rem;will-change:transform,opacity}
.axis-badge{display:inline-flex;align-items:center;gap:.3rem;font-size:.65rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;padding:.22rem .7rem;border-radius:99px;margin-bottom:.9rem; border:none; color:#fff;}
#question-text{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:clamp(1rem,3.5vw,1.18rem);line-height:1.65;color:var(--text);margin-bottom:1.75rem;min-height:3.5rem}
.answers{display:flex;flex-direction:column;gap:.48rem}
.answer-btn{background:var(--surface2);border:1.5px solid var(--border);border-radius:11px;color:var(--text);cursor:pointer;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;font-weight:500;padding:.85rem 1.1rem;text-align:left;width:100%;display:flex;align-items:center;gap:.85rem;transition:border-color var(--tr),background var(--tr),transform var(--tr)}
/* Effetto movimento per tutti i bottoni */
.answer-btn:hover:not(:disabled){transform:translateX(4px)}
.answer-btn:active:not(:disabled){transform:scale(.99) translateX(2px)}
.answer-btn:disabled{opacity:.5;cursor:not-allowed}
.btn-icon{width:28px;height:28px;border-radius:7px;display:flex;align-items:center;justify-content:center;font-size:.72rem;font-weight:800;flex-shrink:0}

/* COLORI DELLE ICONE A RIPOSO */
/* COLORI DELLE ICONE A RIPOSO */
.answer-btn[data-m="1"] .btn-icon { background:#dcfce7; color:#15803d; }
.answer-btn[data-m="0.5"] .btn-icon { background:#d1fae5; color:#047857; }
.answer-btn[data-m="0"] .btn-icon { background:#f1f5f9; color:#64748b; } 
.answer-btn[data-m="-0.5"] .btn-icon { background:#fee2e2; color:#dc2626; } /* Spazio aggiunto qui! */
.answer-btn[data-m="-1"] .btn-icon { background:#fca5a5; color:#991b1b; } 

/* EFFETTI HOVER SPECIFICI */

/* 1. D'accordo (Verde) */
.answer-btn[data-m="1"]:hover:not(:disabled), 
.answer-btn[data-m="0.5"]:hover:not(:disabled) {
  border-color: var(--primary); 
  background: var(--primary-l);
}

/* 2. Neutrale (Grigio) */
.answer-btn[data-m="0"]:hover:not(:disabled) {
  border-color: #94a3b8; 
  background: #f8fafc;
}

/* 3. In Disaccordo (Rosso) */
.answer-btn[data-m="-0.5"]:hover:not(:disabled),
.answer-btn[data-m="-1"]:hover:not(:disabled) {
  border-color: #ef4444; 
  background: #fef2f2;
}

.quiz-card.leave{animation:slideOut .2s ease forwards}
.quiz-card.enter{animation:slideIn .27s ease both}

/* priority */
#priority-section{display:none;animation:fadeUp .45s ease both}
.priority-header{padding:2rem 0 1.5rem}
.priority-header h2{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:clamp(1.5rem,5vw,2rem);font-weight:700;letter-spacing:-.02em;line-height:1.2}
.priority-header h2 em{font-style:italic;color:var(--primary)}
.priority-header p{color:var(--muted);font-size:.9rem;margin-top:.5rem;line-height:1.6}
.priority-list{display:flex;flex-direction:column;gap:.45rem;margin-bottom:1.5rem}
.priority-item{background:var(--surface);border:1.5px solid var(--border);border-radius:11px;cursor:pointer;display:flex;align-items:center;gap:.85rem;padding:.75rem 1rem;text-align:left;width:100%;transition:border-color var(--tr),background var(--tr);font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
.priority-item:hover{border-color:var(--primary);background:var(--primary-l)}
.priority-item.selected{border-color:var(--primary);background:var(--primary-l)}
.priority-item.selected .p-check{background:var(--primary);border-color:var(--primary);color:#fff}
.p-badge{font-size:.6rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;padding:.18rem .5rem;border-radius:99px;flex-shrink:0;color:#fff;border:none}
.p-text{flex:1;font-size:.84rem;font-weight:500;color:var(--text);line-height:1.45}
.p-check{width:22px;height:22px;border-radius:50%;border:2px solid var(--border);background:var(--surface2);flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:800;color:transparent;transition:all var(--tr)}
.priority-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem;position:sticky;bottom:0;background:linear-gradient(to top,var(--bg) 80%,transparent);padding:1rem 0 1.25rem}
.priority-count{font-size:.82rem;font-weight:600;color:var(--muted)}
.priority-count strong{color:var(--primary)}
.btn-confirm{background:var(--primary);border:none;border-radius:99px;color:#fff;cursor:pointer;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:.88rem;font-weight:700;padding:.7rem 1.75rem;transition:background var(--tr),transform var(--tr)}
.btn-confirm:hover{background:var(--primary-d);transform:translateY(-1px)}

/* ─── RESULTS ─────────────────────────────── */
#results-section{display:none;animation:fadeUp .5s ease both}
.results-header{padding:2rem 0 .5rem}
.results-header h2{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:clamp(1.5rem,5vw,2.1rem);font-weight:700;letter-spacing:-.02em}
.results-header h2 em{font-style:italic;color:var(--primary)}
.results-header p{color:var(--muted);font-size:.88rem;margin-top:.4rem}

/* coord pills */
.coord-row{display:flex;gap:.75rem;flex-wrap:wrap;margin-bottom:1.5rem; display:none;} /* Nascosto se non serve */

/* section blocks */
.section-block{margin-bottom:2rem}
.section-title{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:1.25rem;font-weight:700;letter-spacing:-.015em;margin-bottom:.25rem;display:flex;align-items:center;gap:.5rem}
.section-subtitle{font-size:.8rem;color:var(--muted);margin-bottom:1rem}

/* filter row */
.filter-row{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-bottom:1rem}
.filter-label{font-size:.7rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);white-space:nowrap}
.filter-btns{display:flex;gap:.35rem}
.filter-btn{background:var(--surface2);border:1.5px solid var(--border);border-radius:99px;color:var(--muted);cursor:pointer;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:.75rem;font-weight:700;padding:.28rem .85rem;transition:all var(--tr);white-space:nowrap}
.filter-btn:hover{border-color:var(--primary);color:var(--primary)}
.filter-btn.active{background:var(--primary);border-color:var(--primary);color:#fff}

/* ── SECTION A: Party Cards ── */
#party-cards-grid{display:flex;flex-direction:column;gap:.6rem}
.party-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden;transition:box-shadow var(--tr)}
.party-card:hover{box-shadow:var(--shadow)}
.party-card-header{display:flex;align-items:center;gap:.9rem;padding:1rem 1.25rem;cursor:pointer;user-select:none}
.party-logo-wrap{width:44px;height:44px;border-radius:50%;border:2px solid var(--border);overflow:hidden;flex-shrink:0;background:var(--surface2);display:flex;align-items:center;justify-content:center}
.party-logo-wrap img{width:100%;height:100%;object-fit:cover}
.party-logo-fallback{font-size:.65rem;font-weight:800;color:var(--muted);text-align:center;line-height:1.2;padding:2px}
.party-main{flex:1;min-width:0}
.party-name-label{font-size:.88rem;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.party-match-bar-wrap{height:5px;background:var(--surface2);border-radius:99px;margin-top:.4rem;overflow:hidden;border:1px solid var(--border)}
.party-match-bar-fill{height:100%;border-radius:99px;transition:width .6s ease}
.party-pct{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:1.5rem;font-weight:700;flex-shrink:0;min-width:52px;text-align:right;line-height:1}
.card-chevron{font-size:1rem;color:var(--muted);transition:transform .25s ease;flex-shrink:0;margin-left:.25rem;font-weight:700}
.party-card.open .card-chevron{transform:rotate(90deg)}

/* accordion detail */
.party-detail{display:none;border-top:1px solid var(--border);padding:.75rem 1.25rem 1rem}
.party-card.open .party-detail{display:block}
.q-row{display:grid;grid-template-columns:1fr auto auto auto;gap:.5rem;align-items:center;padding:.45rem 0;border-bottom:1px solid var(--surface2);font-size:.78rem}
.q-row:last-child{border-bottom:none}
.q-label{color:var(--text);font-weight:600;line-height:1.3}
.q-answers{display:flex;gap:.35rem;align-items:center}
.q-ans{display:inline-flex;align-items:center;gap:.2rem;padding:.18rem .5rem;border-radius:6px;font-size:.72rem;font-weight:700;white-space:nowrap}
.q-ans.user{background:var(--primary-l);color:var(--primary-d);border:1px solid #c2e2da}
.q-ans.party{background:var(--surface2);color:var(--muted);border:1px solid var(--border)}
.q-match-icon{font-size:.9rem;flex-shrink:0}
.q-match-full .q-match-icon::after{content:"✓";color:#16a34a}
.q-match-half .q-match-icon::after{content:"~";color:#d97706}
.q-match-none .q-match-icon::after{content:"✗";color:#dc2626}
.q-ans-label{font-size:.7rem}

/* ── SECTION B: Theme Affinity ── */
.theme-bars{display:flex;flex-direction:column;gap:.7rem}
.theme-row{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:.85rem 1.1rem;box-shadow:var(--shadow-sm); cursor:pointer; user-select:none;}
.theme-row.open .party-detail { display: block; }
.theme-top{display:flex;align-items:baseline;justify-content:space-between;margin:0}
.theme-name{font-size:.82rem;font-weight:700;color:var(--text)}
.theme-best{font-size:.8rem;color:var(--text);text-align:right;max-width:55%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.theme-track{height:8px;margin-top:8px;background:var(--surface2);border-radius:99px;overflow:hidden;border:1px solid var(--border)}
.theme-fill{height:100%;border-radius:99px;transition:width .8s ease}
.theme-party-select {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  background-color: var(--surface);
  margin-left: 5px;
  outline: none;
  cursor: pointer;
}
.theme-party-select:hover { border-color: var(--primary); }

/* ── SECTION C: Map ── */
.chart-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:1.25rem 1rem 1rem;margin-bottom:1.25rem}
.chart-x-labels{display:flex;justify-content:space-between;font-size:.62rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:0 .15rem;margin-bottom:.4rem}
.chart-body{display:flex;gap:.5rem;align-items:center}
.chart-y-label{writing-mode:vertical-rl;transform:rotate(180deg);font-size:.58rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);white-space:nowrap}
.chart-wrap{flex:1;position:relative;min-height:420px}
#chart-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:420px;gap:1rem;color:var(--muted)}
.spinner{width:32px;height:32px;border:3px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .7s linear infinite}

/* restart */
.btn-restart{display:block;margin:.5rem auto 0;width:fit-content;background:var(--surface);border:1.5px solid var(--border);border-radius:99px;color:var(--muted);cursor:pointer;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:.84rem;font-weight:700;padding:.65rem 1.75rem;transition:all var(--tr)}
.btn-restart:hover{border-color:var(--primary);color:var(--primary);background:var(--primary-l)}

/* footer */
.site-footer{width:100%;border-top:1px solid var(--border);background:var(--surface2);padding:1.25rem 1.5rem;margin-top:3rem}
.footer-inner{max-width:700px;margin:0 auto;display:flex;flex-direction:column;gap:.55rem}
.footer-block{font-size:.68rem;line-height:1.6;color:var(--muted);opacity:.82}
.footer-block strong{font-weight:700}

/* animations */
@keyframes fadeDown{from{opacity:0;transform:translateY(-14px)}to{opacity:1;transform:none}}
@keyframes fadeUp{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@keyframes slideOut{to{opacity:0;transform:translateX(-18px)}}
@keyframes slideIn{from{opacity:0;transform:translateX(18px)}}
@keyframes spin{to{transform:rotate(360deg)}}

@media(max-width:420px){
  .quiz-card{padding:1.4rem 1.1rem 1.2rem}
  .chart-y-label{display:none}
  .party-pct{font-size:1.2rem}
  .q-row{grid-template-columns:1fr auto}
  .q-answers{flex-direction:column;gap:.2rem;align-items:flex-end}
}
/* ════════════════════════════════════════════
   APPENDERE IN FONDO A style.css
   ════════════════════════════════════════════ */

/* ── BANNER EX-AEQUO ── */
.exaequo-banner {
  background: linear-gradient(135deg, #fef9ec, #fef3c7);
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: .65rem 1rem;
  font-size: .82rem;
  color: #92400e;
  margin-bottom: .75rem;
}
.exaequo-banner strong { font-weight: 800; }

/* ── PODIO ANIMATO ─────────────────────────── */


.podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: .6rem;
  padding: 1.25rem 0 0;
  margin-bottom: 1.5rem;
}

/* Ogni slot: logo + nome + % + barra */
.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 175px;
  /* ANIMAZIONE: parte trasparente e spostata in basso */
  opacity: 0;
  transform: translateY(36px);
  animation: podiumRise .55s cubic-bezier(.22,.68,0,1.2) forwards;
}
@keyframes podiumRise {
  to { opacity: 1; transform: translateY(0); }
}

/* Logo circolare */
.podium-logo-wrap {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  overflow: hidden;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .45rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.pos-1 .podium-logo-wrap { width: 68px; height: 68px; border-width: 3px; }
.podium-logo-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* Nome partito (max 2 righe) */
.podium-name {
  font-size: .72rem; font-weight: 700;
  color: var(--text); text-align: center;
  margin-bottom: .2rem; line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;           /* ← aggiunta questa */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pos-1 .podium-name { font-size: .78rem; }

/* Percentuale */
.podium-pct {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: .5rem;
}
.pos-1 .podium-pct { font-size: 1.35rem; }

/* Barre colorate: altezze diverse per 1°/2°/3° */
.podium-bar {
  width: 100%;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: .55rem;
}
.podium-rank {
  font-size: .82rem; font-weight: 800;
  color: rgba(255,255,255,.9);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* Oro / Argento / Bronzo */
.bar-1 { height: 88px; background: linear-gradient(175deg,#c8951a,#e8b84b); }
.bar-2 { height: 60px; background: linear-gradient(175deg,#7a8fa0,#a8bece); }
.bar-3 { height: 44px; background: linear-gradient(175deg,#9a6640,#c08858); }

/* Responsive */
@media (max-width:420px) {
  .podium-logo-wrap { width: 44px; height: 44px; }
  .pos-1 .podium-logo-wrap { width: 56px; height: 56px; }
  .podium-pct { font-size: .95rem; }
  .pos-1 .podium-pct { font-size: 1.1rem; }
  .bar-1 { height: 70px; }
  .bar-2 { height: 50px; }
  .bar-3 { height: 36px; }
}

/* ─── SITE NAV (fixed, global) ─────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.nav-inner {
  max-width: 700px; margin: 0 auto; height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem; gap: .5rem;
  box-sizing: border-box; width: 100%;
}
.nav-brand {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 1.05rem; font-weight: 900;
  color: var(--primary); background: none; border: none; cursor: pointer;
  padding: 0; letter-spacing: -.01em; flex-shrink: 0;
  transition: color var(--tr);
}
.nav-brand:hover { color: var(--primary-d); }
.nav-end { display: flex; align-items: center; gap: .4rem; }
.nav-auth-guest, .nav-auth-user { display: flex; align-items: center; gap: .35rem; }
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); object-fit: cover; flex-shrink: 0;
}
.nav-user-name {
  font-size: .75rem; font-weight: 700; color: var(--text);
  max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-btn {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 99px; color: var(--muted); cursor: pointer;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .72rem; font-weight: 700;
  padding: .26rem .72rem; transition: all var(--tr);
  white-space: nowrap; line-height: 1.4;
}
.nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-btn-accent { background: var(--primary); border-color: var(--primary); color: #fff; }
.nav-btn-accent:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.nav-dark-btn {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 99px; cursor: pointer; font-size: .72rem; font-weight: 700;
  padding: .26rem .72rem; color: var(--muted); transition: all var(--tr);
  white-space: nowrap; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.4;
}
.nav-dark-btn:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 480px) {
  .nav-inner { padding: 0 .85rem; gap: .35rem; }
  .nav-end { gap: .3rem; }
  .nav-auth-guest, .nav-auth-user { gap: .25rem; }
  .nav-user-name { display: none; }
  .nav-btn, .nav-dark-btn { font-size: .68rem; padding: .22rem .52rem; }
}
@media (max-width: 400px) {
  .nav-inner { padding: 0 .65rem; gap: .25rem; }
  .nav-end { gap: .22rem; }
  .nav-auth-user { gap: .18rem; }
  .nav-avatar { width: 24px; height: 24px; }
  .nav-btn, .nav-dark-btn { font-size: .63rem; padding: .2rem .42rem; }
  .nav-dark-btn { font-size: .6rem; padding: .2rem .38rem; }
}
@media (max-width: 340px) {
  .nav-btn-logout-nav { display: none; }
}

/* ─── DARK THEME VARIABLES ─────────────────── */
body.dark-theme {
  --bg: #111110; --surface: #1c1c1b; --surface2: #252523;
  --border: #38372f; --text: #e8e6e0; --muted: #8a8880;
  --primary: #4eb59e;
  --primary-l: #0d2420;
  --primary-d: #5ecbaf;
  --shadow: 0 4px 20px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.4);
}
body.dark-theme .top-band {
  background: linear-gradient(90deg,#007a38,#444 50%,#a02030);
}
body.dark-theme .site-nav {
  box-shadow: 0 1px 8px rgba(0,0,0,.4);
}
body.dark-theme .exaequo-banner {
  background: #2a2000; border-color: #6b5000; color: #f0c060;
}
body.dark-theme .footer-block { opacity: .75; }
body.dark-theme .answer-btn[data-m="0"]:hover:not(:disabled) {
  border-color: #64748b;
  background: #1c2535;
}
body.dark-theme .answer-btn[data-m="-0.5"]:hover:not(:disabled),
body.dark-theme .answer-btn[data-m="-1"]:hover:not(:disabled) {
  border-color: #ef4444;
  background: #2d1515;
}
/* Dark mode: answer button icon badges */
body.dark-theme .answer-btn[data-m="1"]    .btn-icon { background: #052e16; color: #4ade80; }
body.dark-theme .answer-btn[data-m="0.5"]  .btn-icon { background: #052e16; color: #34d399; }
body.dark-theme .answer-btn[data-m="0"]    .btn-icon { background: #1e293b; color: #94a3b8; }
body.dark-theme .answer-btn[data-m="-0.5"] .btn-icon { background: #3d0a0a; color: #f87171; }
body.dark-theme .answer-btn[data-m="-1"]   .btn-icon { background: #3d0a0a; color: #fca5a5; }
/* Dark mode: user answer pill border */
body.dark-theme .q-ans.user { border-color: #1a4a3a; }
/* Dark mode: pro/con column boxes and heads */
body.dark-theme .procon-col-pro { background: #042417; border-color: #064e3b; border-left-color: #10b981; }
body.dark-theme .procon-col-con { background: #200808; border-color: #7f1d1d; border-left-color: #ef4444; }
body.dark-theme .procon-col-pro .procon-col-head { color: #34d399; }
body.dark-theme .procon-col-con .procon-col-head { color: #f87171; }
body.dark-theme .procon-col-text { color: var(--muted); }

/* ─── SKIP BUTTON ──────────────────────────── */
.skip-btn {
  background: transparent; border: 1.5px dashed var(--border);
  border-radius: 11px; color: var(--muted); cursor: pointer;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .8rem; font-weight: 600;
  padding: .6rem 1.1rem; text-align: center; width: 100%;
  margin-top: .35rem; transition: border-color var(--tr), color var(--tr);
}
.skip-btn:hover:not(:disabled) { border-color: var(--muted); color: var(--text); }
.skip-btn:disabled { opacity: .4; cursor: not-allowed; }

/* q-row per domanda saltata */
.q-match-skip .q-match-icon::after { content: "–"; color: #94a3b8; }
.q-match-skip .q-ans.user { background: var(--surface2); color: var(--muted); border-color: var(--border); }

/* ─── ARCHETYPE BANNER ─────────────────────── */
#archetype-banner {
  background: linear-gradient(135deg, var(--primary-l), var(--surface));
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.35rem 1.6rem;
  margin-bottom: 2rem;
  animation: fadeUp .5s ease both;
}
.archetype-label {
  font-size: .68rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--primary); margin-bottom: .45rem;
}
.archetype-title {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(1.55rem, 5vw, 2.1rem);
  font-weight: 700; font-style: italic;
  color: var(--text); line-height: 1.2; margin-bottom: .5rem;
}
.archetype-desc {
  font-size: .875rem; color: var(--muted); line-height: 1.65;
}

/* ─── RADAR CHART ──────────────────────────── */
.radar-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .1rem .8rem;
}
.radar-nav-btn {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.radar-nav-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: scale(1.08);
}
.radar-nav-btn:disabled { opacity: .28; cursor: default; }
.radar-nav-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.radar-nav-party {
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s;
}
.radar-nav-meta {
  font-size: .75rem;
  color: var(--muted);
  margin-top: .15rem;
}

.radar-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: .5rem 0 .75rem;
}


/* ── SHARE SECTION ─────────────────────────── */
.share-section {
  display: flex; flex-direction: column; align-items: center;
  gap: .85rem; margin-bottom: 1.75rem;
}
.share-row-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.share-icons-row { display: flex; gap: 1.1rem; align-items: center; }
.sib {
  width: 52px; height: 52px; border-radius: 50%;
  border: none; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s;
  flex-shrink: 0;
}
.sib svg { width: 22px; height: 22px; display: block; }
.sib:hover  { transform: translateY(-3px); }
.sib:active { transform: scale(.9); }
.sib:disabled { opacity: .42; cursor: not-allowed; transform: none !important; filter: none !important; }
.sib-wa { background: #25D366; box-shadow: 0 2px 14px rgba(37,211,102,.38); }
.sib-wa:hover  { box-shadow: 0 6px 24px rgba(37,211,102,.55); }
.sib-fb { background: #1877F2; box-shadow: 0 2px 14px rgba(24,119,242,.38); }
.sib-fb:hover  { box-shadow: 0 6px 24px rgba(24,119,242,.55); }
.sib-x  { background: #0f0f0f; box-shadow: 0 2px 14px rgba(0,0,0,.28); }
.sib-x:hover   { box-shadow: 0 6px 24px rgba(0,0,0,.45); background: #000; }
.sib-ig {
  background: linear-gradient(135deg,#f09433 0%,#e6683c 20%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
  box-shadow: 0 2px 14px rgba(220,39,67,.38);
}
.sib-ig:hover  { box-shadow: 0 6px 24px rgba(220,39,67,.55); filter: brightness(1.09); }

/* ── FRIEND AFFINITY CARD ───────────────────── */
#friend-card {
  background: linear-gradient(135deg, #eff6ff, var(--surface));
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  animation: fadeUp .5s ease both;
}
body.dark-theme #friend-card {
  background: linear-gradient(135deg, #0a1628, var(--surface));
  border-color: #1e3a5f;
  border-left-color: #3b82f6;
}
.friend-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #3b82f6;
  margin-bottom: .5rem;
}
.friend-pct {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: .35rem;
}
.friend-sub {
  font-size: .82rem;
  color: var(--muted);
}

/* ── SOCIAL SHARE CAPTURE (off-screen) ──────── */
#share-capture {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 500px;
  padding: 1.5rem;
  background: #f2f1ed;
  pointer-events: none;
}
body.dark-theme #share-capture { background: #1c1c1b; }
.sc-brand {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .9rem;
  font-weight: 700;
  color: var(--primary);
  padding-bottom: .85rem;
  margin-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}
/* cloned archetype banner inside capture */
.sc-arc-clone {
  background: linear-gradient(135deg, var(--primary-l), var(--surface));
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.35rem 1.6rem;
}

/* ── TOAST ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1917;
  color: #e5e7eb;
  padding: .65rem 1.4rem;
  border-radius: 99px;
  font-size: .84rem;
  font-weight: 600;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 1000;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── AUTH BAR ────────────────────────────────────── */
.auth-bar {
  margin-bottom: 1.25rem;
  animation: fadeDown .4s ease both;
}
.auth-privacy-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem .9rem;
  margin-bottom: .6rem;
}
.privacy-check {
  width: 15px; height: 15px;
  flex-shrink: 0; margin-top: 2px;
  accent-color: var(--primary); cursor: pointer;
}
.privacy-label {
  font-size: .78rem; color: var(--muted); line-height: 1.5; cursor: pointer;
}
.link-btn {
  background: none; border: none;
  color: var(--primary); cursor: pointer;
  font-size: inherit; font-family: inherit;
  padding: 0; text-decoration: underline;
}
.btn-login {
  display: flex; align-items: center; justify-content: center;
  gap: .6rem; width: 100%;
  background: #fff; border: 1.5px solid #dadce0;
  border-radius: 99px; color: #3c4043;
  cursor: pointer; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .84rem; font-weight: 700;
  padding: .7rem 1.4rem; transition: all var(--tr);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.btn-login:hover:not(:disabled) { background: #f8f9fa; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.btn-login:disabled { opacity: .45; cursor: not-allowed; }
.auth-user {
  align-items: center; gap: .7rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: .65rem 1rem; flex-wrap: wrap;
}
.auth-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0; object-fit: cover;
}
.auth-name {
  font-size: .84rem; font-weight: 700; color: var(--text);
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.btn-auth-secondary {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 99px; color: var(--muted); cursor: pointer;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .72rem; font-weight: 700;
  padding: .28rem .8rem; transition: all var(--tr); white-space: nowrap;
}
.btn-auth-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ── CARD SHARE ROW ──────────────────────────── */
.share-card-row { display: flex; gap: .6rem; width: 100%; max-width: 340px; }
.btn-download-card,
.btn-share-card {
  flex: 1; border-radius: 99px; cursor: pointer;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .8rem; font-weight: 700;
  padding: .6rem 1rem; transition: all var(--tr);
  white-space: nowrap; text-align: center;
}
.btn-download-card {
  background: var(--surface); border: 1.5px solid var(--border); color: var(--muted);
}
.btn-download-card:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-share-card {
  background: var(--primary); border: 1.5px solid var(--primary); color: #fff;
}
.btn-share-card:hover:not(:disabled) { background: var(--primary-d); border-color: var(--primary-d); transform: translateY(-1px); }
.btn-download-card:disabled,
.btn-share-card:disabled { opacity: .65; cursor: not-allowed; }

/* ── PROFILE MODAL ──────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 500; display: flex; align-items: center;
  justify-content: center; padding: 1rem; animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal-box {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  width: 100%; max-width: 500px; max-height: 82vh;
  display: flex; flex-direction: column; animation: fadeUp .22s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.4rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 1.1rem; color: var(--muted);
  cursor: pointer; padding: .25rem .45rem; border-radius: 6px;
  transition: color var(--tr), background var(--tr); line-height: 1;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-body { overflow-y: auto; padding: 1rem 1.4rem 1.5rem; flex: 1; }
.modal-loading { display: flex; justify-content: center; padding: 2.5rem; }
.modal-empty {
  text-align: center; color: var(--muted);
  font-size: .88rem; padding: 2rem 0; line-height: 1.6;
}
.history-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: .85rem 1rem; margin-bottom: .6rem;
}
.history-date { font-size: .7rem; color: var(--muted); margin-bottom: .3rem; }
.history-archetype {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .92rem;
  font-weight: 700; font-style: italic; color: var(--text); margin-bottom: .45rem;
}
.history-parties { display: flex; gap: .45rem; flex-wrap: wrap; }
.history-parties span {
  font-size: .7rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 99px;
  padding: .15rem .6rem; color: var(--muted);
}
.history-parties strong { color: var(--primary-d); font-weight: 800; }
.btn-replay-history {
  display: block; width: 100%; margin-top: .55rem;
  background: var(--primary-l); border: 1px solid var(--primary);
  border-radius: 8px; color: var(--primary-d);
  cursor: pointer; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .75rem; font-weight: 700; padding: .38rem .75rem;
  text-align: left; transition: all var(--tr);
}
.btn-replay-history:hover { background: var(--primary); color: #fff; }

/* ── INSTAGRAM STORY CARD (off-screen, 360×640 → 3× = 1080×1920) ── */
#social-card-export {
  position: fixed; left: -9999px; top: 0;
  width: 360px; height: 640px; overflow: hidden;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, #0e2218 0%, #081512 55%, #05100c 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; pointer-events: none;
  color: #e0ddd7;
  --surface: #0f2018; --surface2: #142a1f; --border: rgba(78,181,158,.18);
  --text: #e0ddd7; --muted: rgba(255,255,255,.5);
  --primary: #4eb59e; --primary-l: #0d2420; --primary-d: #5ecbaf;
  --sce-accent: #4eb59e;
  --sce-accent-dark: #2d8a7a;
  --sce-accent-70: rgba(78,181,158,.70);
  --sce-accent-38: rgba(78,181,158,.38);
  --sce-accent-25: rgba(78,181,158,.25);
  --sce-accent-22: rgba(78,181,158,.22);
}

/* ─ Header ─ */
.sce-header {
  display: flex; align-items: center; gap: .55rem;
  padding: .9rem 1.3rem .8rem;
  border-bottom: 1px solid rgba(255,255,255,.18);
  flex-shrink: 0;
}
.sce-brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--sce-accent) 0%, var(--sce-accent-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: .58rem; font-weight: 900; color: #fff;
  letter-spacing: -.01em; flex-shrink: 0;
}
.sce-brand {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 1rem;
  font-weight: 900; letter-spacing: .01em; color: #fff;
}

/* ─ Body ─ */
.sce-body {
  flex: 1; padding: .75rem 1.3rem .3rem;
  display: flex; flex-direction: column;
  overflow: hidden; gap: 0; min-height: 0;
}

/* ─ Archetype ─ */
.sce-profile-label {
  font-size: .42rem; font-weight: 800; letter-spacing: .28em;
  color: rgba(255,255,255,.78); margin-bottom: .28rem; flex-shrink: 0;
}
.sce-archetype {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 1.22rem;
  font-weight: 700; font-style: italic; color: #fff;
  line-height: 1.15; margin-bottom: .12rem; flex-shrink: 0;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ─ Divider ─ */
.sce-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.10), transparent);
  margin: .42rem 0; flex-shrink: 0;
}
/* First divider sits inside the hero band — keep it light */
#sce-archetype + .sce-divider {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
}

/* ─ Section label ─ */
.sce-section-label {
  font-size: .42rem; font-weight: 900; letter-spacing: .22em;
  color: var(--sce-accent); margin-bottom: .25rem; flex-shrink: 0;
}

/* ─ Two-column podiums ─ */
.sce-podiums-row { display: flex; align-items: flex-start; flex-shrink: 0; }
.sce-podium-col { flex: 1; min-width: 0; }
.sce-podium-sep {
  width: 1px; background: rgba(0,0,0,.09);
  align-self: stretch; margin: 0 .55rem; flex-shrink: 0;
}

/* ─ Party rows ─ */
.sce-parties { display: flex; flex-direction: column; gap: .05rem; }
.sce-party-row { display: flex; align-items: center; gap: .3rem; padding: .14rem 0; }
.sce-medal { font-size: .7rem; width: 13px; flex-shrink: 0; line-height: 1; }
.sce-logo {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.10); object-fit: cover; flex-shrink: 0;
}
.sce-logo-initial {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .38rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.sce-party-name {
  flex: 1; font-size: .52rem; font-weight: 700; color: #2c2a27;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sce-party-pct {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .68rem;
  font-weight: 700; flex-shrink: 0;
}

/* ─ Area leaders (2-col grid) ─ */
.sce-area-leaders {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .04rem .28rem; flex-shrink: 0;
}
.sce-area-leader-row { display: flex; align-items: center; gap: .24rem; padding: .08rem 0; }
.sce-al-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.sce-al-area {
  font-size: .41rem; font-weight: 600; color: rgba(0,0,0,.42);
  flex-shrink: 0; white-space: nowrap; width: 40px;
  overflow: hidden; text-overflow: ellipsis;
}
.sce-al-party {
  flex: 1; font-size: .48rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sce-al-pct {
  font-size: .4rem; font-weight: 800;
  color: rgba(0,0,0,.38); flex-shrink: 0;
}

/* ─ Radar (fills remaining space) ─ */
.sce-radar-wrap { flex: 1; min-height: 0; position: relative; width: 100%; }

/* ── FRIEND COMPARISON RADAR ─────────────────── */
.friend-radar-wrap {
  position: relative;
  margin-top: 1.1rem;
  max-width: 400px;
  margin-left: auto; margin-right: auto;
}

/* ══════════════════════════════════════════════
   DASHBOARD (Profilo Modal)
   ══════════════════════════════════════════════ */

/* Wider modal box for dashboard */
#profile-modal .modal-box {
  max-width: 640px;
  max-height: 90vh;
}

/* ── Tabs ── */
.dash-tabs {
  display: flex;
  gap: .3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .65rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}
.dash-tab {
  background: none; border: none; cursor: pointer;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .8rem; font-weight: 700;
  padding: .35rem .9rem; border-radius: 99px;
  color: var(--muted); transition: all var(--tr);
}
.dash-tab:hover { background: var(--surface2); color: var(--text); }
.dash-tab.active { background: var(--primary); color: #fff; }

/* ── Panel ── */
.dash-panel { animation: fadeUp .25s ease both; }

/* ── Section headings inside dashboard ── */
.dash-section-title {
  font-size: .68rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  margin: 1rem 0 .5rem;
}

/* ── Archetype banner in dashboard ── */
.dash-archetype-banner {
  background: linear-gradient(135deg, var(--primary-l), var(--surface));
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: .5rem;
}

/* ── Top Parties list ── */
.dash-parties-list { display: flex; flex-direction: column; gap: .3rem; }
.dash-party-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .65rem;
  background: var(--surface2);
  border-radius: 8px;
}
.dash-medal { font-size: .85rem; width: 20px; flex-shrink: 0; }
.dash-party-name { flex: 1; font-size: .82rem; font-weight: 600; color: var(--text); }
.dash-party-pct {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .92rem; font-weight: 700;
}

/* ── Priority list ── */
.dash-priority-list { display: flex; flex-direction: column; gap: .3rem; }
.dash-priority-item {
  display: flex; align-items: flex-start; gap: .5rem; padding: .25rem 0;
}
.dash-priority-badge {
  font-size: .54rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; padding: .15rem .5rem;
  border-radius: 99px; flex-shrink: 0; margin-top: 2px; color: #fff;
}
.dash-priority-text {
  font-size: .78rem; color: var(--text); line-height: 1.4;
}

/* ── Radar in dashboard ── */
.dash-radar-wrap {
  position: relative;
  max-width: 360px;
  margin: .25rem auto 0;
}

/* ── Network tab ── */
.dash-network-empty {
  text-align: center; padding: 2.25rem 1rem; color: var(--muted);
}
.dash-network-icon { font-size: 2.4rem; margin-bottom: .6rem; }
.dash-network-count {
  font-size: .82rem; font-weight: 700; color: var(--primary);
  padding: .4rem 0 .8rem;
}

/* ── RADAR AXIS ? ICON OVERLAYS ───────────────── */

/* Wrapper: absolutely placed over the canvas, centered on its own point.
   Does NOT use .rl-tipwrap to avoid the position:relative override. */
.rx-icon-wrap {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 10;
}
/* Show tooltip on hover or when toggled open */
.rx-icon-wrap:hover .rl-tip,
.rx-icon-wrap.open  .rl-tip {
  opacity: 1;
  pointer-events: auto;
}

/* ? button (also used by .rl-tipwrap inline legend) */
.rl-tipwrap { position: relative; }
.rl-qbtn {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: transparent;
  color: var(--muted);
  font-size: .68rem; font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s, color .15s, background .15s;
}
.rl-qbtn:hover, .rl-tipwrap.open .rl-qbtn {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb, 37,99,235),.08);
}

/* Tooltip popup */
.rl-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: .7rem .85rem .65rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.13);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s;
  z-index: 100;
  text-align: left;
}
.rl-tipwrap:hover .rl-tip,
.rl-tipwrap.open   .rl-tip {
  opacity: 1;
  pointer-events: auto;
}
.rl-tip-area {
  font-size: .78rem; font-weight: 700;
  color: var(--primary, #2563eb);
  margin-bottom: .35rem;
}
.rl-tip-body {
  font-size: .72rem; color: var(--muted);
  margin-bottom: .5rem;
  line-height: 1.45;
}
.rl-tip-row {
  display: flex; gap: .5rem; align-items: baseline;
  font-size: .7rem; color: var(--text);
  line-height: 1.4;
  margin-top: .25rem;
}
.rl-tip-lo {
  font-size: .62rem; font-weight: 700;
  background: #fee2e2; color: #dc2626;
  border-radius: 4px; padding: 1px 5px;
  flex-shrink: 0;
}
.rl-tip-hi {
  font-size: .62rem; font-weight: 700;
  background: #dcfce7; color: #16a34a;
  border-radius: 4px; padding: 1px 5px;
  flex-shrink: 0;
}
/* Dark theme overrides */
.dark-theme .rl-tip {
  background: #23211e;
  border-color: #3a3830;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.dark-theme .rl-tip-lo { background: #4a1c1c; color: #fca5a5; }
.dark-theme .rl-tip-hi { background: #14391f; color: #86efac; }

/* ── PRO / CON EDUCATIONAL SECTION ─────────────── */
#procon-section { margin-bottom: 1.25rem; }

.procon-wrap { border: none; }

/* Summary toggle — always hidden, content always visible */
.procon-toggle {
  display: flex; align-items: center; gap: .45rem; cursor: pointer;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .78rem; font-weight: 700;
  color: var(--muted); background: var(--surface2);
  border: 1.5px solid var(--border); border-radius: 9px;
  padding: .45rem .75rem; margin-bottom: .55rem;
  list-style: none; transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.procon-toggle::-webkit-details-marker { display: none; }
.procon-toggle::marker { display: none; }
.procon-toggle:hover { color: var(--text); border-color: var(--primary); }
.procon-arrow {
  margin-left: auto; font-size: .9rem; font-weight: 700;
  color: var(--muted); transition: transform .2s ease;
}
.procon-wrap[open] .procon-arrow { transform: rotate(90deg); }

/* Two-column grid */
.procon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}

/* Each box */
.procon-box {
  border-radius: 10px; padding: .65rem .8rem;
}
.procon-pro {
  background: #f0fdf8; border: 1px solid #a7f3d0;
  border-left: 3px solid #10b981;
}
.procon-con {
  background: #fff5f5; border: 1px solid #fecaca;
  border-left: 3px solid #ef4444;
}
.procon-head {
  font-size: .66rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: .35rem;
}
.procon-pro .procon-head { color: #065f46; }
.procon-con .procon-head { color: #991b1b; }
.procon-text { font-size: .78rem; color: var(--muted); line-height: 1.55; margin: 0; }

/* Dark mode */
body.dark-theme .procon-pro {
  background: #042417; border-color: #064e3b; border-left-color: #10b981;
}
body.dark-theme .procon-con {
  background: #200808; border-color: #7f1d1d; border-left-color: #ef4444;
}
body.dark-theme .procon-pro .procon-head { color: #34d399; }
body.dark-theme .procon-con .procon-head { color: #f87171; }

.procon-toggle { display: none; }

/* Mobile (< 580px): single column stacked */
@media (max-width: 579px) {
  .procon-grid { grid-template-columns: 1fr; gap: .4rem; }
}

/* ── UTILITY ────────────────────────────────────── */
.d-none { display: none; }
.chart-loading-text { font-size: .85rem; }
.theme-compare-label { font-size: .75rem; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; }
.dash-empty-muted { font-size: .78rem; color: var(--muted); padding: .15rem 0; }
.dash-empty-sm { font-size: .8rem; color: var(--muted); padding: .25rem 0; }
.dash-radar-placeholder { padding: .5rem 0; }
.dash-network-sub { font-size: .75rem; margin-top: .4rem; color: var(--muted); }
.history-registered { font-size: .68rem; color: var(--primary); margin-top: .2rem; }
.archetype-desc-sm { font-size: .8rem; margin-top: .35rem; }
