/* ═══════════════════════════════
   GuadagniBTP — style.css v7
   Dark + Light theme, mobile-first
═══════════════════════════════ */

/* DARK THEME (default) */
:root,
[data-theme="dark"] {
  --bg:       #07090f;
  --bg2:      #0d1117;
  --card:     #111827;
  --card2:    #161f2e;
  --border:   #1e2d3d;
  --border2:  #263347;
  --text:     #f0f6fc;
  --muted:    #6b7f94;
  --dim:      #3a4f63;
  --green:    #22d364;
  --red:      #ff4c6a;
  --blue:     #3b9eff;
  --gold:     #f5a623;
  --gold2:    #ffd166;
  --accent:   #2563eb;
  --accent2:  #3b82f6;
  --teal:     #06b6d4;
  --r:        12px;
  --rs:       8px;
  --shadow:   0 4px 24px rgba(0,0,0,.4);
}

/* LIGHT THEME */
[data-theme="light"] {
  --bg:       #f5f7fa;
  --bg2:      #ffffff;
  --card:     #ffffff;
  --card2:    #f0f4f8;
  --border:   #d1dbe8;
  --border2:  #b8c8d8;
  --text:     #1a2332;
  --muted:    #5a6e82;
  --dim:      #9aa8b8;
  --green:    #16a34a;
  --red:      #dc2626;
  --blue:     #2563eb;
  --gold:     #d97706;
  --gold2:    #b45309;
  --accent:   #2563eb;
  --accent2:  #1d4ed8;
  --teal:     #0891b2;
  --shadow:   0 4px 24px rgba(0,0,0,.08);
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Sora', sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.6;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: 'Sora', sans-serif; }

/* ── ADBLOCK OVERLAY ── */
#ab-probe { position: absolute; top: -9999px; left: -9999px; height: 1px; width: 1px; pointer-events: none; }
#ab-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(7,9,15,.97); backdrop-filter: blur(10px);
  align-items: center; justify-content: center; padding: 16px;
}
#ab-overlay.show { display: flex; }
.ab-box {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 20px; padding: 32px 24px;
  width: 100%; max-width: 440px; text-align: center;
}
.ab-icon { font-size: 48px; margin-bottom: 14px; }
.ab-box h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.ab-box p { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 18px; }
.ab-steps { text-align: left; background: var(--bg2); border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; }
.ab-steps li { font-size: 12px; color: var(--muted); margin-bottom: 7px; list-style: none; padding-left: 22px; position: relative; }
.ab-steps li::before { content: attr(data-n); position: absolute; left: 0; color: var(--gold); font-weight: 700; }
.ab-steps li:last-child { margin-bottom: 0; }
.ab-steps li strong { color: var(--text); }
.ab-row { display: flex; gap: 8px; margin-bottom: 12px; }
.ab-row input { flex: 1; padding: 10px 12px; background: var(--bg2); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 13px; outline: none; }
.ab-row input:focus { border-color: var(--accent2); }
.ab-row button { padding: 10px 14px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ab-err { font-size: 12px; color: var(--red); margin: -8px 0 10px; display: none; }
.ab-main-btn { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--accent), var(--teal)); color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; margin-bottom: 10px; }
.ab-note { font-size: 11px; color: var(--dim); }

/* ── COOKIE BANNER ── */
#ck-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 8000; background: var(--card2); border-top: 1px solid var(--border); padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); box-shadow: 0 -2px 12px rgba(0,0,0,.15); }
#ck-bar.gone { display: none; }
#ck-bar p { flex: 1; line-height: 1.5; }
.ck-btn { padding: 9px 18px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0; white-space: nowrap; }
@media(max-width:500px) { #ck-bar { flex-direction: column; text-align: center; } .ck-btn { width: 100%; } }

/* ── HEADER ── */
header { background: var(--card); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 500; box-shadow: var(--shadow); transition: background .2s; }
.hdr { max-width: 1440px; margin: 0 auto; padding: 0 16px; height: 52px; display: flex; align-items: center; gap: 10px; }
.logo { font-size: 18px; font-weight: 800; letter-spacing: -.5px; flex-shrink: 0; background: linear-gradient(135deg, #f5a623, #ffd166); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo span { -webkit-text-fill-color: var(--text); font-weight: 300; }
.nav-d { display: flex; gap: 2px; flex: 1; }
.nav-d a { padding: 5px 11px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--muted); transition: all .2s; }
.nav-d a:hover, .nav-d a.on { color: var(--text); background: var(--card2); text-decoration: none; }
.nav-m { display: none; }
.hdr-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.spread-pill { background: var(--card2); border: 1px solid var(--border2); padding: 4px 10px; border-radius: 16px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); white-space: nowrap; }
.spread-pill b { color: var(--gold); }
.theme-btn { background: var(--card2); border: 1px solid var(--border2); padding: 5px 9px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background .2s; flex-shrink: 0; }
.theme-btn:hover { background: var(--border2); }
@media(max-width: 768px) {
  .nav-d { display: none; }
  .nav-m { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-m::-webkit-scrollbar { display: none; }
  .nav-m a { padding: 4px 10px; border-radius: 16px; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; border: 1px solid var(--border); transition: all .2s; }
  .nav-m a:hover, .nav-m a.on { color: var(--accent2); border-color: var(--accent2); background: rgba(59,130,246,.1); text-decoration: none; }
  .spread-pill { display: none; }
  .logo { font-size: 15px; }
}

/* ── TICKER ── */
.ticker-wrap { background: linear-gradient(90deg,rgba(37,99,235,.08),rgba(6,182,212,.04),rgba(37,99,235,.08)); border-bottom: 1px solid var(--border); padding: 7px 0; overflow: hidden; white-space: nowrap; height: 34px; display: flex; align-items: center; }
.ticker-inner { display: inline-flex; gap: 36px; animation: ticker 60s linear infinite; }
.ticker-inner:hover { animation-play-state: paused; }
.t-item { display: inline-flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: 11px; cursor: pointer; }
.t-label { color: var(--muted); }
.t-val { color: var(--text); font-weight: 600; }
.t-up { color: var(--green); }
.t-dn { color: var(--red); }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ── AD SLOTS ── */
.ad-slot {
  width: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px dashed var(--border2);
  border-radius: var(--r); color: var(--dim);
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  letter-spacing: .5px; position: relative; overflow: hidden;
}
.ad-slot::before { content: 'PUBBLICITÀ'; position: absolute; top: 4px; left: 8px; font-size: 9px; opacity: .3; letter-spacing: 1px; }
.ad-top { height: 90px; margin: 12px 0 0; }
.ad-mid { height: 60px; margin: 20px 0; }
.ad-bot { height: 90px; margin: 16px 0 8px; }
.ad-side { height: 250px; width: 100%; }
.ad-side2 { height: 250px; width: 100%; margin-top: 16px; }
@media(max-width: 768px) { .ad-top { height: 60px; } .ad-mid { height: 50px; } }

/* ── LAYOUT ── */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 16px; }
.main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; padding: 20px 0 40px; }
@media(max-width: 1100px) { .main-grid { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* ── STATS ROW ── */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 20px; }
@media(max-width: 700px) { .stats { grid-template-columns: repeat(2,1fr); } }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; transition: border-color .2s; }
.stat:hover { border-color: var(--border2); }
.stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.stat-num { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 600; }
.stat-sub { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-green { color: var(--green); }
.c-gold { color: var(--gold); }
@media(max-width: 400px) { .stat-num { font-size: 15px; } }

/* ── SECTION HEADER ── */
.sec-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-hd h1 { font-size: 18px; font-weight: 700; }
.sec-hd h1 em { font-style: normal; color: var(--gold); font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 500; }
.sec-hd small { font-size: 11px; color: var(--muted); margin-left: auto; font-family: 'JetBrains Mono', monospace; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--green); box-shadow: 0 0 7px var(--green); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.5; transform:scale(1.4); } }

/* ── LOADING ── */
.load-bar { height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 10px; }
.load-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 2px; width: 0; }
.load-fill.ani { animation: la 1.8s ease-in-out infinite; }
@keyframes la { 0% { width:0; margin-left:0; } 60% { width:65%; } 100% { width:0; margin-left:100%; } }
.status-bar { font-size: 11px; font-family: 'JetBrains Mono', monospace; color: var(--muted); margin-bottom: 10px; }
.status-bar.ok { color: var(--green); }
.status-bar.err { color: var(--red); }

/* ── FILTERS ── */
.filters { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.fbtn { padding: 6px 13px; border: 1px solid var(--border2); background: var(--card); color: var(--muted); border-radius: 20px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all .2s; white-space: nowrap; flex-shrink: 0; }
.fbtn.on, .fbtn:hover { border-color: var(--accent2); color: var(--accent2); background: rgba(59,130,246,.1); }
.search-wrap { margin-bottom: 12px; }
.search-input { width: 100%; padding: 10px 14px; background: var(--card); border: 1px solid var(--border2); border-radius: var(--r); color: var(--text); font-size: 13px; outline: none; transition: border-color .2s; }
.search-input:focus { border-color: var(--accent2); }
.search-input::placeholder { color: var(--muted); }
@media(max-width:500px) { .search-input { font-size: 16px; } }

/* ── TABLE ── */
.tbl-outer { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.btp-tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
.btp-tbl thead th { background: var(--card2); padding: 10px 11px; text-align: left; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none; transition: color .15s; }
.btp-tbl thead th:hover { color: var(--text); }
.btp-tbl thead th.sorted { color: var(--accent2); }
.s-ico { margin-left: 3px; opacity: .4; font-size: 9px; }
.sorted .s-ico { opacity: 1; }
.btp-tbl tbody tr { border-bottom: 1px solid rgba(30,45,61,.4); transition: background .12s; cursor: pointer; }
.btp-tbl tbody tr:hover { background: rgba(59,130,246,.05); }
.btp-tbl tbody tr:last-child { border-bottom: none; }
.btp-tbl td { padding: 9px 11px; font-family: 'JetBrains Mono', monospace; font-size: 12px; white-space: nowrap; }
.td-name { font-family: 'Sora', sans-serif !important; font-size: 12px; font-weight: 500; color: var(--text); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.td-isin { font-size: 10px; color: var(--blue); }
.td-m { color: var(--muted); font-size: 11px; }
.td-rend { font-weight: 700; font-size: 13px; }
.rend-a { color: var(--green); }
.rend-b { color: var(--gold); }
.rend-c { color: var(--muted); }
.chg-up { color: var(--green); font-size: 11px; }
.chg-dn { color: var(--red); font-size: 11px; }
.chg-n { color: var(--muted); font-size: 11px; }
.cred-c { color: var(--gold2); font-size: 11px; }
.dur-c { color: var(--teal); font-size: 11px; }
.live-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 4px var(--green); margin-right: 4px; vertical-align: middle; }
.fav-btn { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--dim); transition: all .2s; padding: 2px 4px; line-height: 1; }
.fav-btn:hover { transform: scale(1.2); }
.fav-btn.on { color: var(--gold); }
.port-add-btn { background: rgba(37,99,235,.14); border: none; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--accent); padding: 2px 7px; line-height: 1.4; transition: all .2s; font-weight: 700; }
.port-add-btn:hover { background: var(--accent); color: #fff; transform: scale(1.08); }
.tbl-foot { padding: 8px 14px; background: var(--card2); border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; flex-wrap: wrap; gap: 4px; }

/* Skeleton */
.skel { display: inline-block; height: 12px; border-radius: 3px; background: linear-gradient(90deg, var(--card2) 25%, var(--card) 50%, var(--card2) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; }
@keyframes sk { 0% { background-position:200% 0; } 100% { background-position:-200% 0; } }

/* MOBILE CARDS */
.btp-cards { display: none; }
@media(max-width: 500px) { .tbl-scroll { display: none; } .btp-cards { display: block; } }
.btp-card { padding: 13px 14px; border-bottom: 1px solid rgba(30,45,61,.4); transition: background .12s; cursor: pointer; }
.btp-card:last-child { border-bottom: none; }
.btp-card:hover { background: rgba(59,130,246,.03); }
.btp-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 7px; }
.btp-card-name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; padding-right: 8px; line-height: 1.3; }
.btp-card-rend { font-family: 'JetBrains Mono', monospace; font-size: 17px; font-weight: 700; flex-shrink: 0; }
.btp-card-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btp-card-item { display: flex; flex-direction: column; }
.btp-card-item span:first-child { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.btp-card-item span:last-child { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500; }
.btp-card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; }
.btp-card-isin { font-size: 10px; color: var(--blue); }
.btp-card-fav { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--dim); padding: 2px; transition: all .2s; }
.btp-card-fav.on { color: var(--gold); }

/* FAVORITES */
#fav-sec { display: none; margin-bottom: 24px; }
#fav-sec.show { display: block; }

/* SIDEBAR */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; transition: border-color .2s; }
.card-hd { padding: 11px 14px; background: var(--card2); border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.card-bd { padding: 14px; }

/* CALCULATOR */
.calc label { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.calc input { width: 100%; padding: 9px 11px; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--rs); color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 13px; outline: none; transition: border-color .2s; margin-bottom: 10px; }
.calc input:focus { border-color: var(--accent2); }
.calc input[readonly] { opacity: .7; cursor: default; }
.calc-btn { width: 100%; padding: 11px; background: var(--accent); color: #fff; border: none; border-radius: var(--rs); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s; }
.calc-btn:hover { background: var(--accent2); }
.calc-res { margin-top: 12px; padding: 12px; background: var(--bg2); border-radius: var(--rs); display: none; }
.calc-res.show { display: block; }
.cr { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); }
.cr:last-child { border-bottom: none; }
.cr span:first-child { font-size: 11px; color: var(--muted); }
.cr span:last-child { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; }
.cr.hl span:last-child { font-size: 15px; }

/* QUICK LINKS */
.ql { display: flex; flex-direction: column; }
.ql a { padding: 8px 0; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; transition: color .15s; }
.ql a:last-child { border-bottom: none; }
.ql a:hover { color: var(--text); text-decoration: none; }
.badge { background: rgba(34,211,100,.1); border: 1px solid rgba(34,211,100,.2); color: var(--green); padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; }

/* INFO + LEGENDA */
.info-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 14px; }
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; transition: all .2s; }
.info-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.info-card h3 { font-size: 12px; font-weight: 700; color: var(--gold); margin-bottom: 8px; font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: .4px; }
.info-card p { font-size: 12px; color: var(--muted); line-height: 1.75; }
.info-card strong { color: var(--text); }
.leg-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 8px; margin-top: 10px; }
.leg-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--rs); padding: 12px; }
.leg-item b { display: block; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--gold); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.leg-item p { font-size: 11px; color: var(--muted); line-height: 1.6; }

/* WIDGETS TRADINGVIEW */
.tv-widget-wrap { background: var(--card2); border-radius: var(--rs); overflow: hidden; min-height: 240px; border: 1px solid var(--border); }
.tv-widget-section { margin: 20px 0; }
.tv-widget-section h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* ── DETAIL PAGE ── */
#detail-pg { display: none; padding: 20px 0 60px; }
.detail-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.back-btn-d { padding: 8px 16px; background: var(--card2); color: var(--text); border: 1px solid var(--border2); border-radius: var(--rs); font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.back-btn-d:hover { background: var(--border2); }
.detail-title { flex: 1; }
.detail-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.detail-isin { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-isin a { color: var(--blue); }
@media(max-width:500px) { .detail-name { font-size: 16px; } }

.detail-price-box { display: flex; gap: 16px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 20px; margin-bottom: 16px; }
.detail-metric { display: flex; flex-direction: column; gap: 4px; min-width: 100px; }
.detail-metric-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.detail-metric-val { font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 700; line-height: 1.1; }
.detail-metric-sub { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
@media(max-width:400px) { .detail-metric-val { font-size: 22px; } }

.detail-info-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 10px; margin-bottom: 20px; }
.detail-info-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--rs); padding: 11px 13px; }
.detail-info-item span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.detail-info-item b { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; }

.detail-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.detail-section h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.detail-calc-grid { max-width: 420px; }

.our-chart-wrap { background: var(--card2); border-radius: var(--rs); padding: 12px; min-height: 180px; display: flex; align-items: center; justify-content: center; }
.chart-canvas-wrap { position: relative; width: 100%; }

/* ── PRIVACY PAGE ── */
#priv-pg { display: none; padding: 32px 0 60px; }
#priv-pg.show { display: block; }
#priv-pg h2 { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
#priv-pg h3 { font-size: 13px; font-weight: 600; color: var(--gold); margin: 20px 0 6px; font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: .4px; }
#priv-pg p { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 10px; }
#priv-pg strong { color: var(--text); }
.back-btn { padding: 11px 24px; background: var(--accent); color: #fff; border: none; border-radius: var(--rs); font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 8px; }

/* ── FOOTER ── */
footer { background: var(--card); border-top: 1px solid var(--border); margin-top: 32px; padding: 20px 0 10px; }
.ft-inner { max-width: 1440px; margin: 0 auto; padding: 0 16px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.ft-inner p { font-size: 11px; color: var(--muted); }
.ft-links { display: flex; gap: 14px; flex-wrap: wrap; }
.ft-links a { font-size: 11px; color: var(--blue); }
.ft-disc { max-width: 1440px; margin: 10px auto 0; padding: 10px 16px; font-size: 10px; color: var(--dim); text-align: center; border-top: 1px solid var(--border); line-height: 1.6; }

/* ── MOBILE EXTRA ── */
@media(max-width:500px) {
  .btp-card { padding: 13px 12px; }
  .btp-card-name { font-size: 13px; }
  .fbtn { padding: 7px 12px; font-size: 12px; }
  .stat { padding: 10px 11px; }
  .stat-num { font-size: 15px; }
  .hdr { height: 48px; padding: 0 12px; }
  .detail-section { padding: 14px; }
  .detail-info-grid { grid-template-columns: repeat(2,1fr); }
  .detail-price-box { padding: 13px; }
}
@media(max-width:360px) {
  .stats { grid-template-columns: 1fr 1fr; }
}

/* Scroll hint su mobile */
@media(max-width:768px) {
  .tbl-outer::after { content: '← scorri per vedere tutto →'; display: block; text-align: center; font-size: 9px; color: var(--dim); padding: 3px; background: var(--card2); border-top: 1px solid var(--border); }
}

/* ── COOKIE BANNER GDPR ─────────────────────────────── */
#ck-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--card2); border-top: 2px solid var(--accent);
  padding: 16px 24px; box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}
#ck-content { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
#ck-text { flex: 1; min-width: 200px; }
#ck-text strong { font-size: 15px; color: var(--text); }
#ck-text p { font-size: 12px; color: var(--muted); margin: 4px 0 0; line-height: 1.5; }
#ck-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ck-btn { padding: 8px 18px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; transition: opacity .2s; }
.ck-btn:hover { opacity: .85; }
.ck-accept { background: var(--accent); color: #fff; }
.ck-reject { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.ck-settings { background: transparent; color: var(--text); border: 1px solid var(--border); }
#ck-bar.gone { display: none; }

/* Cookie Settings Panel */
#ck-settings-panel {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
}
#ck-settings-inner {
  background: var(--card2); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px; max-width: 480px; width: 90%; box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
#ck-settings-inner h3 { margin: 0 0 20px; font-size: 18px; color: var(--text); }
.ck-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.ck-row:last-of-type { border-bottom: none; }
.ck-row strong { font-size: 14px; color: var(--text); }
.ck-row p { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.ck-toggle { font-size: 11px; color: var(--accent); font-weight: 600; }
.ck-toggle-wrap { flex-shrink: 0; }
#ck-settings-btns { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* Toggle switch */
input[type=checkbox].hidden-check { display: none; }
.ck-toggle-lbl {
  display: inline-block; width: 44px; height: 24px; background: var(--border);
  border-radius: 12px; cursor: pointer; transition: background .2s; position: relative;
}
.ck-toggle-lbl::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s;
}
input[type=checkbox]:checked + .ck-toggle-lbl { background: var(--accent); }
input[type=checkbox]:checked + .ck-toggle-lbl::after { transform: translateX(20px); }
