:root {
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #111827;
  --accent: #00c46c;
  --muted: #6b7280;
  --border: #d1d5db;
}
/* rimosso: .pred-table td:last-child bold — causava grassetto sulla colonna "2" */
/* ---------- BASE ---------- */
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
}
.train-date {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  margin-left: 6px;
}

/* ---------- SIDEBAR ---------- */

#sidebar h2 {
  text-align: center;
  font-size: 13px;        /* più piccolo */
  font-weight: 600;       /* leggermente meno spesso */
  color: #374151;         /* grigio più tenue */
  margin-top: 4px;        /* spostato più in alto */
  margin-bottom: 4px;     /* meno spazio sotto */
  text-transform: uppercase;
  letter-spacing: 0.5px;  /* più elegante */
}
#competitionList {
  list-style: none;
  padding: 0;
  margin: 0;
}
/* Versione legacy (fallback per compat): la usiamo se la lista non ha
   .comp-list-modern. */
#competitionList:not(.comp-list-modern) > li {
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.2s;
}
#competitionList:not(.comp-list-modern) > li:hover { background: #e2e8f0; }
#competitionList:not(.comp-list-modern) > li.active { background: var(--accent); color: #fff; font-weight: 600; }

/* ===== Sidebar competizioni — stile moderno (card-like) ===== */
.comp-list-modern { padding: 8px 6px 16px; }
.comp-list-modern > li { list-style: none; }

/* Search box */
.comp-search-row {
  display: flex; align-items: center; gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  margin: 4px 4px 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.comp-search-row:focus-within {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.comp-search-icon { font-size: 13px; opacity: 0.6; }
.comp-search-input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-size: 13px; color: #1e293b;
  padding: 2px 0;
}
.comp-search-input::placeholder { color: #94a3b8; }
.comp-search-clear {
  background: transparent; border: none; cursor: pointer;
  font-size: 12px; color: #64748b; padding: 2px 4px;
  border-radius: 4px; line-height: 1;
}
.comp-search-clear:hover { background: #f1f5f9; color: #0f172a; }

/* "Tutte le competizioni" — voce in evidenza */
.comp-all-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  margin: 0 4px 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700; font-size: 13px; color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.comp-all-item:hover { background: #f8fafc; border-color: #cbd5e1; }
.comp-all-item.active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.comp-all-icon { font-size: 16px; }

/* Card-gruppo per ogni country */
.comp-group {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin: 0 4px 8px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.comp-group:hover { border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }
/* Quando una lega del gruppo è attiva, evidenzia il gruppo (header + bordo). */
.comp-group:has(.comp-item.active) {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.comp-group:has(.comp-item.active) .comp-group-head {
  color: #1d4ed8;
  background: #dbeafe;
}
.comp-group:has(.comp-item.active) .comp-group-count {
  background: #bfdbfe;
  color: #1e40af;
}

.comp-group-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: transparent; border: none;
  cursor: pointer;
  text-align: left;
  font-weight: 700; font-size: 12px;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: background 0.15s ease;
}
.comp-group-head:hover { background: #f8fafc; }
.comp-group-flag { font-size: 16px; flex-shrink: 0; display: inline-flex; align-items: center; }
.comp-group-flag img { width: 22px !important; height: 16px !important; border-radius: 2px; }
.comp-group-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-group-count {
  font-size: 10px; font-weight: 700;
  background: #f1f5f9; color: #475569;
  padding: 2px 6px; border-radius: 999px; min-width: 18px; text-align: center;
}
.comp-group-chev {
  font-size: 11px; color: #94a3b8;
  transition: transform 0.2s ease;
}
.comp-group.is-collapsed .comp-group-chev { transform: rotate(-90deg); }

.comp-group-body {
  list-style: none; padding: 4px 6px 6px; margin: 0;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
.comp-group.is-collapsed .comp-group-body { display: none; }

.comp-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px; color: #0f172a; font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.comp-item:hover { background: #e0f2fe; color: #082f49; }
.comp-item.active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff; font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.comp-item-flag { font-size: 14px; flex-shrink: 0; display: inline-flex; align-items: center; }
.comp-item-flag img { width: 20px !important; height: 14px !important; border-radius: 2px; }
.comp-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- SIDEBAR WIDTH (variabile CSS, ridimensionabile via drag) ---------- */
:root {
  --sidebar-width: 240px;
}

/* ---------- MAIN LAYOUT ---------- */
main {
  margin-left: var(--sidebar-width);
  padding: 0 20px;   /* ✅ spazio di 20px tra sidebar e contenuto */
  transition: margin-left 0.3s ease;
}
/* Durante il drag rimuoviamo la transition per non avere lag visivo. */
body.is-resizing-sidebar main { transition: none !important; }
body.is-resizing-sidebar #sidebar { transition: none !important; }

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #e5e7eb;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}
.left-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-dark);
}

/* ---------- DROPDOWNS ---------- */
.dropdown {
  position: relative;
}
.dropbtn {
  cursor: pointer;
  color: var(--text-dark);
  font-weight: 600;
  transition: color 0.2s ease;
}
.dropbtn:hover {
  color: var(--accent);
}
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 220px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08);
  z-index: 20;
}
.dropdown-content a {
  display: block;
  padding: 10px 14px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s;
}
.dropdown-content a:hover {
  background: #f3f4f6;
}
.dropdown:hover .dropdown-content {
  display: block;
}

/* ---------- BUTTON ---------- */
button {
  background: var(--accent);
  border: none;
  color: white;
  padding: 7px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
button:hover {
  background: #00b25f;
}
.login-btn {
  position: absolute;
  right: 20px;
  top: 12px;
  background: #2563eb;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.login-btn:hover {
  background: #1e40af;
}
/* ---------- TABLE ---------- */
.table-container {
  width: calc(100% - 40px);
  max-width: calc(100% - 40px);
  overflow-x: auto;   /* ← riattiva scroll orizzontale solo se serve */
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin: 20px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch; /* scorrimento fluido su mobile */
  scrollbar-width: thin;
  scrollbar-color: #00c46c #f1f5f9;
}
.table-container::-webkit-scrollbar {
  height: 10px;
}
.table-container::-webkit-scrollbar-thumb {
  background-color: #00c46c;
  border-radius: 10px;
}
.table-container::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.pred-table {
  width: max-content; /* ← la tabella usa solo lo spazio necessario */
  min-width: 100%;    /* ma non meno della larghezza schermo */
  border-collapse: collapse;
  background: var(--bg-card);
  color: var(--text-dark);
  font-size: clamp(11px, 2vw, 14px);
  word-break: break-word;
}
.pred-table th,
.pred-table td {
  padding: 6px 8px;                /* celle un po' più compatte */
  text-align: center;
  border-bottom: 1px solid var(--border);
  min-width: 60px;                 /* impedisce celle troppo strette */
  white-space: normal;             /* consente l’andata a capo */
  line-height: 1.2;                /* migliora la leggibilità */
}
.pred-table th {
  background: #f3f4f6;
  font-weight: 700;
  color: #1f2937;
}
.pred-table tr:nth-child(even) {
  background: #fafafa;
}
.pred-table tr:hover {
  background: #f1f5f9;
}

/* Variante compatta della tabella standard: usata dalla view "In attesa"
   per avere righe piu' fitte senza toccare le altre viste. */
.pred-table-compact {
  font-size: clamp(10px, 1.8vw, 12.5px);
}
.pred-table-compact th,
.pred-table-compact td {
  padding: 3px 6px;
  min-width: 0;
  line-height: 1.15;
}
.pred-table-compact th {
  font-size: 11px;
  letter-spacing: 0.2px;
}
.pred-table-compact .delete-pending-btn {
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1;
}

.team {
  text-align: left;
  font-weight: 500;
  color: var(--text-dark);
  white-space: normal;             /* i nomi lunghi vanno a capo */
  word-break: break-word;
}
/* Nomi squadre nelle tabelle partite: grassetto sobrio (semi-bold), non heavy. */
.team b,
.frozen-cell-match b {
  font-weight: 600;
  color: #1f2937;
}
.highlight {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- PLAY LIST (Gioca per me) ---------- */
.play-list {
  list-style: none;
  padding-left: 15px;
}
.play-list li {
  padding: 4px 0;
  color: var(--text-dark);
}

/* ---------- NO RESULTS ---------- */
.no-results {
  text-align: center;
  margin-top: 60px;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- LOADING ---------- */
.loading {
  text-align: center;
  margin-top: 60px;
  display: none;
}
.spinner {
  width: 45px;
  height: 45px;
  border: 4px solid var(--muted);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- TOAST ---------- */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  padding: 12px 18px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  font-size: 14px;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
/* Celle con probabilità alta (>= soglia) */
td.highlight {
  background-color: #00ff88;   /* verde acceso */
  color: #000;                 /* testo nero */
  font-weight: 700;            /* grassetto */
  text-align: center;
  border-radius: 2px;
}
/* --- Layout base (desktop) già esistente --- */



/* === MENU LATERALE MOBILE === */

.hamburger:focus {
  outline: none;
}
/* ---------- TITLE (h1) ---------- */
.topbar h1 {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  white-space: nowrap;
}
/* ===== Sidebar — voci principali (card-style coerente con .comp-group) ===== */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 4px 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.sidebar-footer:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.sidebar-footer-parent {
  justify-content: space-between;
}

.sidebar-chevron {
  font-size: 11px;
  color: #94a3b8;
  transition: transform 0.2s ease;
  margin-left: auto;
}

.sidebar-submenu {
  margin: -2px 6px 4px;
  padding: 4px 4px 6px;
  background: #fafbfc;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 10px 10px;
}
.sidebar-submenu.hidden { display: none; }

.sidebar-submenu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-submenu-item:hover {
  background: #e0f2fe;
  color: #082f49;
}

/* --- STATO ATTIVO: voce della view corrente --- */
.sidebar-footer.is-active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.sidebar-footer.is-active:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  border-color: #1d4ed8;
  color: #ffffff;
}
.sidebar-footer.is-active .sidebar-chevron { color: rgba(255, 255, 255, 0.85); }

.sidebar-submenu-item.is-active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.sidebar-submenu-item.is-active:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff;
}

/* Parent del submenu che contiene la view attiva: bordo blu chiaro per
   dare contesto visivo. */
.sidebar-footer-parent.is-active-parent {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.sidebar-footer-parent.is-active-parent .sidebar-chevron { color: #2563eb; }

/* Logout speciale: rosso chiaro, contesto distruttivo. */
.sidebar-footer.logout {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #b91c1c;
}
.sidebar-footer.logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}
/* --- COLLASSABILI --- */
.toggle {
  cursor: pointer;
  background: #f3f4f6;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}
.toggle:hover {
  background: #e2e8f0;
}

/* --- HIGHLIGHT ACCURACY >= 81% --- */
.high-accuracy {
  background-color: #d1fae5 !important; /* verde chiaro */
  color: #065f46; /* verde scuro */
  font-weight: 600;
}
/* --- TOP CAMPIONATI --- */
.top-leagues {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 15px 0 25px;
  font-size: 14px;
  line-height: 1.4;
}
.top-line {
  padding: 4px 0;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 500;
}
.top-line span.league {
  font-weight: 700;
  color: #111827;
}

.top-line:last-child {
  border-bottom: none;
}
.control-panel {
  margin: 20px 10px;
  padding: 15px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 10px;
}
.controls {
  display: flex;
  align-items: center;
  gap: 15px;
}
.control-select {
  margin-left: 5px;
  padding: 4px 6px;
  font-size: 14px;
}
.run-btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.run-btn:hover {
  background: #00b25f;
}

/* --- Selettore Gioca per me --- */
.control-panel {
  margin: 25px 15px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 8px;
}

.controls label {
  font-weight: 600;
  color: #374151;
  font-size: 15px;
}

.control-select {
  margin-left: 6px;
  padding: 6px 10px;
  font-size: 15px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  transition: all 0.2s ease;
  cursor: pointer;
}

.control-select:hover {
  border-color: #60a5fa;
  background: #f1f5f9;
}

.run-btn {
  background: #10b981;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.run-btn:hover {
  background: #059669;
}

.run-btn:active {
  background: #047857;
  transform: scale(0.97);
}
#updateOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.overlay-content {
  text-align: center;
  padding: 28px 34px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #fca5a5;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
  color: #1f2937;
  max-width: 420px;
  margin: 0 18px;
}

.overlay-content h2 {
  font-size: 26px;
  margin: 10px 0 12px;
  color: #b91c1c;
}

.overlay-content p {
  margin: 0;
  line-height: 1.45;
  color: #475569;
}

.overlay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.busy-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed !important;
}

/* Pill discreta mostrata in cima alla sidebar durante il retrain/
   aggiornamento sistema. Sostituisce l'overlay fullscreen che
   bloccava ogni interazione. */
.sidebar-busy-pill {
  margin: 12px 12px 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 2px 6px rgba(146, 64, 14, 0.12);
}
.sidebar-busy-pill-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 12px;
}
.sidebar-busy-pill-body {
  color: #7c3a0a;
}
.sidebar-busy-pill-body b {
  color: #78350f;
}
.last-train {
  font-size: 12px;
  color: #6b7280;
  position: absolute;
  top: 8px;
  right: 12px;
}
footer {
  text-align: center;
  padding: 12px 0;
  font-size: 13px;
  color: #6b7280;
  border-top: 1px solid #d1d5db;
  background: #f9fafb;
  margin-top: 25px;
  width: 100%;
  position: static;     /* ✅ evita la sovrapposizione */
  clear: both;          /* ✅ forza il footer sotto tutti gli elementi */
  z-index: 1;           /* ✅ garantisce che stia dietro alla sidebar */
}
/* === Footer sempre in basso === */
html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

body {
  min-height: 100vh;
}

main {
  flex: 1; /* occupa tutto lo spazio disponibile sopra il footer */
}

footer {
  margin-top: auto; /* forza il footer in fondo */
  position: relative;
}
/* =================================== */
/* === STILI MOBILE PER LA TABELLA === */
/* =================================== */

/* ✅ Mostra sempre le celle nella sezione "Gioca per me" su mobile */
footer a {
  color: #6b7280;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}
/* Eventi già giocati */
.past-match {
  opacity: 0.5;
  text-decoration: line-through;
  background-color: #f3f4f6;
}
.past-match:hover {
  opacity: 0.7;
}
.league-filter {
  margin: 15px 20px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
}
.league-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.league-checkboxes label {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.control-panel .controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: center;
}

.control-panel label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
}

.control-panel select,
.control-panel .run-btn {
  margin-top: 4px;
  padding: 6px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
}
/* ✅ FILTRO CAMPIONATI — compatto, senza scrollbar */
#leagueFilterContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  justify-content: flex-start;
  align-items: center;
  overflow: hidden;        /* nasconde l’eventuale eccesso */
  max-height: 100px;       /* massimo ~3 righe */
}

/* ✅ FILTRO CAMPIONATI — compatto, fluido e senza scrollbar */
#leagueFilterContainer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px 10px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  min-height: 60px;
  max-height: none;         /* niente limite verticale */
  overflow: visible;        /* nessuno scroll, si espande */
}

/* chip arrotondati per ogni campionato */
#leagueFilterContainer label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s;
  white-space: nowrap;
}

#leagueFilterContainer label:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  transform: scale(1.02);
}

#leagueFilterContainer input[type="checkbox"] {
  accent-color: var(--accent);
  transform: scale(1.1);
}
/* --- Sidebar (unica definizione) --- */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100dvh;                      /* FIX iOS */
  background: #f1f5f9;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;   /* scroll fluido iOS */
  padding: 10px 0;
  transform: translateX(0) translateZ(0);  /* FIX click iOS */
  transition: transform 0.3s ease, width 0s;
  z-index: 1000;
  will-change: transform;
  /* quando aperta deve ricevere i tap */
  pointer-events: auto;
}

/* Handle di resize: linea verticale sul bordo destro della sidebar.
   Su mouseover diventa visibile, drag la trascina per ridimensionare. */
.sidebar-resize-handle {
  position: fixed;
  top: 0;
  left: calc(var(--sidebar-width) - 3px);
  width: 6px;
  height: 100dvh;
  z-index: 1001;
  cursor: ew-resize;
  background: linear-gradient(90deg, transparent 40%, rgba(37, 99, 235, 0.18) 50%, transparent 60%);
  transition: background 0.15s ease;
  user-select: none;
  touch-action: none;
}
/* Pittogramma "≡" verticale al centro dell'handle per suggerire che si
   può trascinare per allargare/stringere la sidebar. */
.sidebar-resize-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 36px;
  border-radius: 2px;
  background: rgba(37, 99, 235, 0.55);
  box-shadow: -3px 0 0 rgba(37, 99, 235, 0.55), 3px 0 0 rgba(37, 99, 235, 0.55);
  pointer-events: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.is-active,
body.is-resizing-sidebar .sidebar-resize-handle {
  background: linear-gradient(90deg, transparent 40%, rgba(37, 99, 235, 0.45) 50%, transparent 60%);
}
.sidebar-resize-handle:hover::before,
.sidebar-resize-handle.is-active::before,
body.is-resizing-sidebar .sidebar-resize-handle::before {
  background: rgba(37, 99, 235, 0.95);
  box-shadow: -3px 0 0 rgba(37, 99, 235, 0.95), 3px 0 0 rgba(37, 99, 235, 0.95);
}
/* Su mobile (sidebar overlay) nascondiamo l'handle: la sidebar non è
   resizable, è collassata di default. */
@media (max-width: 768px) {
  .sidebar-resize-handle { display: none; }
}
#sidebar.closed ~ .sidebar-resize-handle { display: none; }

#sidebar.closed {
  transform: translateX(-100%) translateZ(0);
  /* quando è fuori schermo non deve intercettare gesti/tap vaganti */
  pointer-events: none;
}

/* fallback per browser senza dvh */
@supports not (height: 100dvh) {
  #sidebar {
    height: calc(100vh - env(safe-area-inset-bottom));
  }
}

main {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
}

main.full {
  margin-left: 0;                         /* quando sidebar chiusa */
}

/* il bottone è sempre visibile */
.hamburger {
  display: block;
  font-size: 24px;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  margin-right: 10px;
  /* evita double-tap-zoom e 300ms delay su iOS */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.hamburger {
  position: relative;
  z-index: 2000;
}
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 950;
  /* evita glitch iOS durante touch passthrough */
  touch-action: none;
}

#overlay.active {
  opacity: 1;
  pointer-events: auto;
}
/* ─── Widget Televideo ─── */
#televideoWidget {
  display: inline-block;
  margin-left: 15px;
  vertical-align: middle;
  cursor: pointer;
}
#televideoMini {
  width: 80px;
  height: 60px;
  border: 2px solid #00ff55;
  object-fit: cover;
  image-rendering: pixelated;
}

/* ─── Mini Televideo Widget sempre piccolo ─── */
#televideoWidget {
  display: inline-block;
  margin-left: 12px;
  vertical-align: middle;
  cursor: pointer;
}

#televideoMini {
  width: 80px;          /* dimensione fissa miniatura */
  height: 60px;
  border: 2px solid #00ff55;
  object-fit: cover;
  image-rendering: pixelated;
  border-radius: 4px;
}

/* televideoMini responsive – vedi sezione responsive in fondo */

/* ─── Overlay Televideo ─── */
#televideoOverlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 99999;          /* 🔼 più alto di sidebar */
}

#televideoFrame {
  position: relative;
  width: 720px;
  height: 520px;
  background: #000;
  border: 3px solid #00ff55;
  border-radius: 6px;
  box-shadow: 0 0 25px rgba(0,255,85,0.4);
  z-index: 100000;          /* 🔼 garantisce che l'iframe stia sopra */
}

#televideoFrame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}





/* === NEWS TICKER (sotto topbar) === */
#newsTicker {
  background: #f1f5f9;              /* simile alla sidebar */
  color: #111827;                   /* testo scuro */
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid #d1d5db;
  border-bottom: 1px solid #d1d5db;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  height: 32px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 5;                       /* resta sopra sidebar */
}
#tickerContent {
  display: inline-block;
  padding-left: 100%;
  animation: scrollTicker 80s linear infinite; /* più lento */
}
@keyframes scrollTicker {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
/* === SEZIONE FILTRO DATE === */
#statsFilters {
  background: #f9fafb;              /* sfondo chiaro coerente */
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 15px;
  margin: 10px 0;
  color: #111827;
  font-family: "Inter", sans-serif;
}

#statsFilters h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-main-title {
  font-size: 1.35rem;
}

.report-title {
  font-size: 1.25rem;
}

/* Campi data */
#statsFilters label {
  margin-right: 15px;
  font-weight: 500;
}

#statsFilters input[type="date"] {
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  color: #111827;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

#statsFilters input[type="date"]:focus {
  border-color: #00c46c;
  box-shadow: 0 0 0 2px rgba(0, 196, 108, 0.2);
  outline: none;
}

/* Bottone */
#loadReportBtn {
  background: #00c46c;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

#loadReportBtn:hover {
  background: #00a85d;
}
.highlight-1x2 {
  background-color: #babdff;   /* giallo chiaro */
  color: #333;
  font-weight: 600;
}
.details-box {
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:6px;
  padding:10px;
  margin-top:6px;
}
.details-row td {
  background:#fff;
  border-top:none;
}
/* ✅ Allinea la topbar alla larghezza del contenuto principale */
.topbar {
  position: sticky;         /* resta agganciata al main senza finire sotto la sidebar */
  top: 0;
  left: auto;
  right: auto;
  width: 100%;
  box-sizing: border-box;
  z-index: 100;
}
main {
  margin-top: 0;
}
main.full .topbar {
  left: auto;
  width: 100%;
}
.topbar {
  transition: left 0.3s ease, width 0.3s ease;
}
/* ============================================================
   CHAT IA – WIDGET FLOATING
   ============================================================ */

.ai-chat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 420px;
  height: 460px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 99999;
  animation: aiChatFadeIn 0.25s ease-out;
}

.ai-chat.hidden {
  display: none;
}

/* Header */
.ai-chat-header {
  background: #00c46c;
  color: white;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.ai-chat-header .ai-chat-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* Area messaggi */
.ai-chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #f9fafb;
}

/* Bolla messaggi */
.ai-msg {
  max-width: 80%;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

.ai-msg.user {
  background: #d1fae5;
  color: #065f46;
  margin-left: auto;
  border: 1px solid #bbf7d0;
}

.ai-msg.assistant {
  background: #e5e7eb;
  color: #1f2937;
  margin-right: auto;
  border: 1px solid #d1d5db;
}

/* Input */
.ai-chat-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  gap: 6px;
  background: #fff;
  border-radius: 0 0 12px 12px;
}

.ai-chat-input input {
  flex: 1;
  border: 1px solid #d1d5db;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.ai-chat-input button {
  background: #00c46c;
  border: none;
  color: white;
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.ai-chat-input button:hover {
  background: #00a85a;
}

/* Animazione */
@keyframes aiChatFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile AI Chat – vedi sezione responsive in fondo */
/* Colonna IA molto stretta */
.pred-table th.col-ia,
.pred-table td.col-ia {
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;
  text-align: center;
  padding: 0 !important;
}
.pred-table th.col-ia {
  white-space: nowrap;
}
/* Bottone IA compatto */
.ai-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px; /* riduci se vuoi ancora più stretto */
  padding: 0;
  margin: 0;
  line-height: 1;
}

.ai-btn:hover {
  opacity: 0.7;
}
/* CHAT IA - modalità espansa */
.ai-chat.expanded {
  width: 90vw !important;
  height: 90vh !important;
  right: 5vw !important;
  bottom: 5vh !important;
}

/* Bottone espandi ⤢ */
.ai-chat-expand {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  margin-right: 8px;
}

.ai-chat-expand:hover {
  background: #059669;
}
/* Header della chat: pulsanti sempre a destra */
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between; /* titolo a sinistra, pulsanti a destra */
  gap: 8px;
  padding: 8px 10px;
}

.ai-chat-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-left: auto; /* spinge il blocco pulsanti tutto a destra */
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* === Loader animato dentro la chat IA === */
.ai-chat-loader {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.ai-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: aiBounce 0.6s infinite alternate;
}

.ai-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes aiBounce {
  from { transform: translateY(0); opacity: 0.4; }
  to   { transform: translateY(-6px); opacity: 1; }
}
.gioca-section {
  margin: 20px 0;
  padding-top: 10px;
  border-top: 2px solid #e5e7eb;
}

.day-title {
  font-size: 1.35rem;
}

.league-title {
  font-size: 1.1rem;
}

.gioca-section h3 {
  font-size: 1.05rem;
}

.gioca-meta {
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
}
.gioca-section > .gioca-meta {
  width: fit-content;
  max-width: min(720px, 100%);
  line-height: 1.5;
}

.gioca-profit-breakdown {
  margin: 10px 0 14px;
  border: 1px solid #dbe4ea;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  overflow: hidden;
}

.gioca-profit-summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: 700;
  color: #1f2937;
}

.gioca-profit-summary::-webkit-details-marker {
  display: none;
}

.gioca-profit-summary::after {
  content: "+";
  float: right;
  font-size: 18px;
  line-height: 1;
  color: #475569;
}

.gioca-profit-breakdown[open] .gioca-profit-summary::after {
  content: "-";
}

.gioca-profit-content {
  padding: 0 14px 14px;
  border-top: 1px solid #e5e7eb;
}

.gioca-profit-note {
  margin: 12px 0;
  font-size: 13px;
  color: #475569;
}

.gioca-profit-block + .gioca-profit-block {
  margin-top: 12px;
}

.gioca-profit-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #0f172a;
}

.gioca-profit-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0;
}


.gioca-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
}

.gioca-card-title {
  font-weight: bold;
  margin-bottom: 6px;
}

.gioca-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 2px 0;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-high {
  background: #dcfce7;
  color: #166534;
}

.badge-mid {
  background: #fef9c3;
  color: #854d0e;
}

.badge-low {
  background: #fee2e2;
  color: #7f1d1d;
}
/* ===== Gioca per Me ===== */

.gioca-table {
  margin-top: 10px;
}

.gioca-table-wrap {
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
}

.gioca-table-wrap .gioca-table {
  margin-top: 0;
}

.gioca-table td,
.gioca-table th {
  white-space: nowrap;
}

.gioca-table td.frozen-cell-match,
.gioca-table td:nth-child(4) {
  white-space: normal; /* match può andare a capo */
  text-align: left;
  min-width: 180px;
}

.gioca-table .gioca-match-teams {
  font-size: 0.95em;
  font-weight: 600;
  line-height: 1.25;
}

.gioca-table .gioca-match-league {
  font-size: 0.78em;
  color: #6b7280;
  margin-top: 2px;
}

.gioca-table tr:hover {
  background: #f9fafb;
}

.gioca-exclude-match-btn {
  border: 1px solid #ef4444;
  background: #fff5f5;
  color: #b91c1c;
  border-radius: 6px;
  padding: 2px 7px;
  line-height: 1;
  cursor: pointer;
}

.gioca-exclude-match-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.gioca-excluded-row {
  opacity: 0.55;
}

.gioca-excluded-row td {
  text-decoration: line-through;
}
/* ===== Gioca per Me – Controls ===== */

.gioca-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin: 18px 10px 22px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.gioca-controls-shell {
  margin: 18px 10px 22px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  width: fit-content;
  max-width: calc(100% - 20px);
}

.gioca-controls-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  user-select: none;
  border-bottom: 1px solid #e8eef5;
}

.gioca-controls-toggle::-webkit-details-marker {
  display: none;
}

.gioca-controls-toggle::after {
  content: "▾";
  font-size: 12px;
  color: #64748b;
  transition: transform 0.18s ease;
}

.gioca-controls-shell:not([open]) .gioca-controls-toggle::after {
  transform: rotate(-90deg);
}

.gioca-controls-toggle-meta {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.gioca-controls-shell .gioca-controls {
  margin: 0;
  padding: 16px 18px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.gioca-controls label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.gioca-controls-note {
  flex-basis: 100%;
  margin-top: -4px;
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
}

.gioca-controls select,
.gioca-controls input[type="number"] {
  margin-top: 6px;
}

.gioca-selection-summary {
  margin: 0 10px 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  width: fit-content;
  max-width: calc(100% - 20px);
  color: #1e3a8a;
  font-size: 14px;
}

.gioca-selection-summary #giocaReshuffleBtn {
  margin-left: 10px;
  border: 1px solid #2563eb;
  background: #ffffff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 600;
}

.gioca-selection-summary #giocaReshuffleBtn:hover:not(:disabled) {
  background: #2563eb;
  color: #ffffff;
}

.gioca-selection-summary #giocaResetExcludedBtn {
  margin-left: 8px;
  border: 1px solid #64748b;
  background: #ffffff;
  color: #334155;
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 600;
}

.gioca-selection-summary #giocaResetExcludedBtn:hover:not(:disabled) {
  background: #64748b;
  color: #ffffff;
}

/* ─── Escludi campionato ─── */
.gioca-league-exclude {
  margin: 0 10px 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #fde68a;
  background: linear-gradient(180deg, #fffaf0 0%, #fff7ed 100%);
  width: fit-content;
  max-width: calc(100% - 20px);
  color: #7c2d12;
  font-size: 14px;
}

.gioca-league-exclude > summary {
  cursor: pointer;
  font-weight: 700;
  color: #9a3412;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.gioca-league-exclude > summary::-webkit-details-marker { display: none; }
.gioca-league-exclude > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.18s ease;
  color: #c2410c;
}
.gioca-league-exclude[open] > summary::before {
  transform: rotate(90deg);
}

.gioca-league-exclude-meta {
  font-weight: 600;
  color: #c2410c;
  font-size: 12px;
}

.gioca-league-exclude-hint {
  margin-top: 8px;
  padding: 6px 10px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 12.5px;
  color: #78350f;
}

.gioca-league-exclude-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gioca-league-exclude-empty {
  font-style: italic;
  color: #92400e;
}

.gioca-league-exclude-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #fed7aa;
  background: #ffffff;
  color: #9a3412;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.gioca-league-exclude-btn:hover {
  background: #fff7ed;
  border-color: #fdba74;
}

.gioca-league-exclude-btn .league-count {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.gioca-league-exclude-btn.active {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
}

.gioca-league-exclude-btn.active .league-count {
  background: #fecaca;
  color: #7f1d1d;
}

.gioca-league-exclude-btn.active:hover {
  background: #b91c1c;
}

/* === Pannello "Campionati automatici esclusi" (read-only) === */
.auto-excluded-panel {
  margin-top: 10px;
}

.auto-excluded-panel > summary {
  color: #7c2d12;
}

.auto-excluded-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auto-excluded-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 13px;
}

.auto-excluded-flag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.auto-excluded-name {
  font-weight: 600;
  color: #7c2d12;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-excluded-meta {
  font-size: 12px;
  color: #9a3412;
  flex-shrink: 0;
}

.league-fasce-panel {
  padding-bottom: 24px;
}

.league-fasce-header {
  margin-bottom: 8px;
}

.league-fasce-section {
  margin: 12px 0 14px;
  border: 1px solid #dde6ef;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.league-fasce-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 11px 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e8eef5;
  user-select: none;
}

.league-fasce-summary::-webkit-details-marker {
  display: none;
}

.league-fasce-summary::after {
  content: "▾";
  font-size: 12px;
  color: #64748b;
  transition: transform 0.18s ease;
}

.league-fasce-section:not([open]) .league-fasce-summary::after {
  transform: rotate(-90deg);
}

.league-fasce-summary-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.league-fasce-summary-meta {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.league-fasce-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  padding: 10px;
}

/* league-fasce-grid responsive – vedi sezione responsive in fondo */

.league-fasce-card {
  --league-fasce-accent: #94a3b8;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  position: relative;
}

.league-fasce-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--league-fasce-accent);
}

.league-fasce-card-a {
  --league-fasce-accent: #16a34a;
}

.league-fasce-card-b {
  --league-fasce-accent: #0ea5e9;
}

.league-fasce-card-c {
  --league-fasce-accent: #f59e0b;
}

.league-fasce-card-d {
  --league-fasce-accent: #ef4444;
}

.league-fasce-card-head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid #e8eef5;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--league-fasce-accent) 11%, white) 0%, transparent 38%),
    linear-gradient(180deg, #fcfdff 0%, #f8fafc 100%);
}

.league-fasce-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.league-fasce-card-title-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.league-fasce-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--league-fasce-accent) 12%, white);
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
}

.league-fasce-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--league-fasce-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--league-fasce-accent) 18%, white);
  flex: 0 0 auto;
}

.league-fasce-card-rule {
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.league-fasce-table-wrap {
  padding: 4px 6px 6px;
}

.league-fasce-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.league-fasce-table th,
.league-fasce-table td {
  text-align: left;
  border: none;
  border-bottom: 1px solid #eef2f7;
  padding: 6px 8px;
  vertical-align: middle;
}

.league-fasce-table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.league-fasce-table tbody tr:last-child td {
  border-bottom: none;
}

.league-fasce-table tbody tr:nth-child(even) td {
  background: #fcfdff;
}

.league-fasce-table tbody tr:hover td {
  background: color-mix(in srgb, var(--league-fasce-accent) 7%, white);
}

.league-fasce-table td:first-child,
.league-fasce-table th:first-child {
  width: 62px;
  text-align: center;
}

.league-fasce-table td:last-child,
.league-fasce-table th:last-child {
  width: calc(100% - 62px);
}

.league-fasce-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
}

.league-fasce-league {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.league-fasce-code {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.league-fasce-name {
  font-size: 12px;
  color: #0f172a;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-fasce-empty {
  text-align: center !important;
  color: #94a3b8;
  font-style: italic;
}

.gioca-controls select,
.gioca-controls input[type="number"] {
  padding: 7px 10px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  min-width: 160px;
}

.gioca-controls select:hover,
.gioca-controls input[type="number"]:hover {
  border-color: #60a5fa;
}

.gioca-controls button {
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.gioca-controls button:hover {
  background: #00b25f;
}

.gioca-controls button:active {
  transform: scale(0.97);
}
.gioca-warning {
  background: #fff7e6;
  border: 1px solid #f0c36d;
  color: #8a6d1d;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.95em;
}

.topbar {
  display: flex;
  align-items: center;
  padding-right: 24px;   /* 🔥 distanza dalla scrollbar */
}

.topbar h1 {
  flex: 1;               /* 🔥 occupa lo spazio centrale */
  margin: 0;
}

/* Logout in sidebar */
.sidebar-footer.logout {
  background: #fee2e2;
  color: #7f1d1d;
  font-weight: 700;
}

.sidebar-footer.logout:hover {
  background: #fecaca;
}
/* ============================= */
/* === LOGIN PAGE (CalcioIA) === */
/* ============================= */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6fb;
  font-family: "Inter", sans-serif;
}

.login-box {
  width: 100%;
  max-width: 360px;
  padding: 30px 28px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  box-sizing: border-box;
  text-align: center;
}

.login-box h2 {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.login-box .subtitle {
  margin-bottom: 20px;
  font-size: 14px;
  color: #6b7280;
}

/* Input */
.login-box input {
  width: 100%;
  padding: 12px 14px;
  margin: 10px 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.login-box input:focus {
  border-color: #00c46c;
  box-shadow: 0 0 0 2px rgba(0,196,108,0.2);
  outline: none;
}

/* Bottone login */
.login-box button {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #00c46c;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.login-box button:hover {
  background: #00a85d;
}

.login-box button:active {
  transform: scale(0.97);
}

/* Errore login */
.login-error {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #b91c1c;
}

/* Footer */
.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: #9ca3af;
}
@media print {
  body * {
    visibility: hidden;
  }

  #content, #content * {
    visibility: visible;
  }

  #content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  /* opzionale: non stampare i bottoni */
  button {
    display: none !important;
  }
}
/* ============================= */
/* === SCHEDINE CONGELATE === */
/* ============================= */

.gioca-section.frozen {
  background: #f8fafc;
  border: 2px solid #c7d2fe;     /* viola chiaro */
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 4px 10px rgba(99,102,241,0.08);
}

/* badge stato frozen */
.frozen-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}
/* tabelle frozen: colonne compatte */
.gioca-section.frozen .pred-table {
  width: auto;
}

.gioca-section.frozen .pred-table td,
.gioca-section.frozen .pred-table th {
  padding: 4px 6px;
  white-space: nowrap;
  font-size: 12px;
}

/* freeze: larghezze colonne coerenti desktop */
.gioca-section.frozen .gioca-table th:nth-child(1),
.gioca-section.frozen .gioca-table td:nth-child(1) { min-width: 50px; }
.gioca-section.frozen .gioca-table th:nth-child(2),
.gioca-section.frozen .gioca-table td:nth-child(2) { min-width: 70px; }
.gioca-section.frozen .gioca-table th:nth-child(3),
.gioca-section.frozen .gioca-table td:nth-child(3) { min-width: 82px; }
.gioca-section.frozen .gioca-table th:nth-child(4),
.gioca-section.frozen .gioca-table td:nth-child(4) { min-width: 52px; }
.gioca-section.frozen .gioca-table th:nth-child(5),
.gioca-section.frozen .gioca-table td:nth-child(5) { min-width: 160px; text-align: left; }
.gioca-section.frozen .gioca-table th:nth-child(6),
.gioca-section.frozen .gioca-table td:nth-child(6) { min-width: 112px; text-align: left; }
.gioca-section.frozen .gioca-table th:nth-child(7),
.gioca-section.frozen .gioca-table td:nth-child(7) { min-width: 112px; text-align: left; }
.gioca-section.frozen .gioca-table th:nth-child(8),
.gioca-section.frozen .gioca-table td:nth-child(8) { min-width: 56px; }

/* freeze: larghezze specifiche Schede Salvate / Bolletta IA
   ordine reale: Esito · Risultato · Quando · Match · Quota · [del] */
.gioca-section.frozen .bolletta-table th:nth-child(1),
.gioca-section.frozen .bolletta-table td:nth-child(1) { min-width: 44px; text-align: center; }
.gioca-section.frozen .bolletta-table th:nth-child(2),
.gioca-section.frozen .bolletta-table td:nth-child(2) { min-width: 70px; text-align: center; }
.gioca-section.frozen .bolletta-table th:nth-child(3),
.gioca-section.frozen .bolletta-table td:nth-child(3) { min-width: 64px; text-align: center; line-height: 1.2; }
.gioca-section.frozen .bolletta-table th:nth-child(4),
.gioca-section.frozen .bolletta-table td:nth-child(4) { min-width: 160px; text-align: left; }
.gioca-section.frozen .bolletta-table th:nth-child(5),
.gioca-section.frozen .bolletta-table td:nth-child(5) { min-width: 56px; text-align: center; }
.gioca-section.frozen .bolletta-table th:nth-child(6),
.gioca-section.frozen .bolletta-table td:nth-child(6) { min-width: 40px; text-align: center; }

/* niente hover su tabelle frozen */
.gioca-section.frozen .pred-table tr:hover {
  background: inherit;
}

/* --- Modal EMULA --- */
.gioca-emula-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.gioca-emula-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17,24,39,0.55);
}
.gioca-emula-modal-box {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  min-width: 720px;
  max-width: 960px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.gioca-emula-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.gioca-emula-modal-head h3 { margin: 0; font-size: 18px; }
.gioca-emula-modal-head button {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #6b7280;
}
.gioca-emula-modal-intro {
  margin: 4px 0 12px;
  font-size: 13px;
  color: #4b5563;
}
.gioca-emula-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.gioca-emula-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.gioca-emula-stats-loading,
.gioca-emula-stats-empty {
  padding: 14px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  background: #f3f4f6;
  border-radius: 8px;
}
.gioca-emula-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.gioca-emula-stat-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gioca-emula-stat-title {
  font-weight: 700;
  font-size: 14px;
  color: #111827;
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px dashed #e5e7eb;
  text-align: center;
}
.gioca-emula-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #374151;
  gap: 8px;
}
.gioca-emula-stat-row b { color: #111827; text-align: right; }
.gioca-emula-stat-row.pos b { color: #059669; }
.gioca-emula-stat-row.neg b { color: #dc2626; }
.gioca-emula-stat-empty {
  font-size: 12px;
  color: #9ca3af;
  padding: 6px 0;
  text-align: center;
}
.gioca-emula-verdict {
  background: linear-gradient(135deg, #ecfdf5, #f0f9ff);
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #065f46;
}
.gioca-emula-verdict-head {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #064e3b;
}
.gioca-emula-verdict-body { color: #374151; }
.gioca-emula-verdict-body b { color: #111827; }
.gioca-emula-verdict-rationale {
  background: rgba(255,255,255,0.75);
  border-left: 3px solid #10b981;
  border-radius: 6px;
  padding: 9px 12px;
  margin: 6px 0 8px;
  font-size: 13px;
  color: #1f2937;
  line-height: 1.5;
}
.gioca-emula-verdict-rationale b { color: #065f46; }

/* === Tabella comparativa EMULA === */
.gioca-emula-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.gioca-emula-compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.gioca-emula-compare th,
.gioca-emula-compare td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: middle;
}
.gioca-emula-compare thead th {
  background: #f9fafb;
  color: #374151;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.gioca-emula-compare tbody tr:last-child td { border-bottom: none; }
.gioca-emula-compare tbody tr:hover { background: #f8fafc; }
.gioca-emula-compare td.emula-cell-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gioca-emula-compare td.pos { color: #059669; font-weight: 600; }
.gioca-emula-compare td.neg { color: #dc2626; font-weight: 600; }
.gioca-emula-compare .emula-col-config { min-width: 130px; }
.gioca-emula-compare .emula-config-name { font-size: 14px; color: #111827; }
.gioca-emula-compare .emula-col-config small { color: #6b7280; font-size: 11px; display: block; margin-top: 2px; }
.gioca-emula-compare tr.emula-row-winner {
  background: linear-gradient(90deg, #ecfdf5 0%, #ffffff 60%);
  box-shadow: inset 3px 0 0 #10b981;
}
.gioca-emula-compare tr.emula-row-winner:hover { background: #d1fae5; }
.gioca-emula-compare tr.emula-row-empty td { color: #9ca3af; font-style: italic; }
.gioca-emula-compare tr.emula-row-empty td.muted { text-align: center; }

.emula-cell-ev .emula-ev-val { font-weight: 600; white-space: nowrap; }
.emula-cell-ev .emula-ev-val small { font-weight: 400; color: #6b7280; }
.emula-cell-ev .emula-ev-bar {
  position: relative;
  height: 6px;
  background: #f3f4f6;
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
}
.emula-cell-ev .emula-ev-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #9ca3af;
  transition: width 0.3s ease;
}
.emula-cell-ev .emula-ev-bar span.pos { background: linear-gradient(90deg, #34d399, #059669); }
.emula-cell-ev .emula-ev-bar span.neg { background: linear-gradient(90deg, #f87171, #dc2626); }

.emula-risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.emula-risk-badge.risk-low { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.emula-risk-badge.risk-med { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.emula-risk-badge.risk-high { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.gioca-emula-verdict-detail {
  margin-top: 4px;
  font-size: 12px;
  color: #4b5563;
}
.gioca-emula-verdict-note {
  margin-top: 6px;
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
}
.gioca-emula-detail-btn {
  margin-top: 10px;
}
.gioca-emula-detail-modal .gioca-emula-detail-modal-box {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 22px 24px;
  min-width: 720px;
  max-width: 1040px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.gioca-emula-detail-block {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}
.gioca-emula-detail-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #111827;
}
.gioca-emula-detail-block ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: #374151; }
.gioca-emula-detail-block li { margin: 3px 0; }
.gioca-emula-detail-block p { margin: 4px 0; font-size: 13px; color: #374151; }
.gioca-emula-detail-block p.muted { color: #6b7280; font-size: 12px; font-style: italic; }
.gioca-emula-detail-table-wrap { overflow-x: auto; }
.gioca-emula-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
@media (max-width: 840px) {
  .gioca-emula-detail-modal .gioca-emula-detail-modal-box {
    min-width: 0;
    width: 96vw;
    padding: 16px 14px;
  }
  .gioca-emula-detail-block {
    padding: 10px 12px;
  }
  .gioca-emula-detail-table-wrap table {
    font-size: 11px;
  }
  .gioca-emula-detail-table-wrap th,
  .gioca-emula-detail-table-wrap td {
    padding: 4px 6px;
    min-width: 0;
  }
}
@media (max-width: 720px) {
  .gioca-emula-modal-box {
    min-width: 0;
    width: 96vw;
    max-height: 92vh;
    overflow-y: auto;
    padding: 14px 12px;
  }
  .gioca-emula-modal-head h3 { font-size: 15px; }
  .gioca-emula-modal-intro { font-size: 12px; }
  .gioca-emula-verdict {
    padding: 10px 12px;
    font-size: 12.5px;
  }
  .gioca-emula-verdict-head { font-size: 14px; }
  .gioca-emula-verdict-rationale {
    font-size: 12.5px;
    padding: 8px 10px;
    line-height: 1.45;
  }
  .gioca-emula-controls { gap: 6px; }
  .gioca-emula-controls input[type="number"] { width: 90px !important; }

  /* Tabella → card impilate */
  .gioca-emula-compare,
  .gioca-emula-compare thead,
  .gioca-emula-compare tbody,
  .gioca-emula-compare tr,
  .gioca-emula-compare th,
  .gioca-emula-compare td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .gioca-emula-compare { border-radius: 10px; border: none; }
  .gioca-emula-compare thead { display: none; }
  .gioca-emula-compare tbody tr {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #fff;
  }
  .gioca-emula-compare tbody tr.emula-row-winner {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16,185,129,0.15);
  }
  .gioca-emula-compare td {
    padding: 6px 0;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-align: right !important;
  }
  .gioca-emula-compare td::before {
    content: attr(data-label);
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    text-align: left;
    flex: 0 0 auto;
  }
  .gioca-emula-compare td.emula-cell-ev {
    align-items: flex-start;
  }
  .gioca-emula-compare td.emula-cell-ev > div {
    flex: 0 0 auto;
  }
  .gioca-emula-compare td.emula-cell-ev::before {
    padding-top: 2px;
  }
  .gioca-emula-compare td.emula-cell-ev .emula-ev-val,
  .gioca-emula-compare td.emula-cell-ev .emula-ev-bar {
    margin-left: auto;
  }
  .gioca-emula-compare td.emula-col-config {
    display: block;
    text-align: left !important;
    padding: 0 0 6px;
    border-bottom: 1px dashed #e5e7eb;
    margin-bottom: 6px;
  }
  .gioca-emula-compare td.emula-col-config::before { display: none; }
  .emula-cell-ev .emula-ev-bar { max-width: 140px; }
}
@media (max-width: 420px) {
  .gioca-emula-detail-table-wrap table { font-size: 10.5px; }
  .emula-cell-ev .emula-ev-bar { max-width: 110px; }
}


/* disattiva evidenziazioni dinamiche */
.gioca-section.frozen .highlight,
.gioca-section.frozen .highlight-1x2 {
  background-color: #e5e7eb !important;
  color: #374151 !important;
}
.gioca-section.frozen .gioca-meta {
  font-size: 14px;
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 1px dashed #d1d5db;
}
.frozen-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  margin: 12px 0;
  overflow: hidden;
  background: #fff;
}

.frozen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  background: #f4f6fb;
}

.frozen-title {
  font-weight: 700;
}
.frozen-title.rename-sheet { cursor: text; }
.rename-pencil {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.85em;
  opacity: 0.45;
  transition: opacity 0.15s ease;
  user-select: none;
}
.frozen-title.rename-sheet:hover .rename-pencil { opacity: 1; }

/* Matitina per editare la quota di una gamba (Bolletta Sicura, Quota mirata,
   Quote fuori posto, Bolletta IA). Click → prompt → override locale. */
.leg-quota-edit {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.85em;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
}
.leg-quota-edit:hover { opacity: 1; transform: scale(1.15); }
/* Stato visuale: quota editata manualmente. */
.qt-leg-quota.is-edited,
.macchia-quota-value.is-edited,
.bolletta-num .is-edited {
  color: #d97706;
  font-style: italic;
  position: relative;
}
.qt-leg-quota.is-edited::after,
.macchia-quota-value.is-edited::after,
.bolletta-num .is-edited::after {
  content: "✎";
  font-size: 0.7em;
  margin-left: 2px;
  opacity: 0.7;
}
/* Input inline per la modifica quota: piccolo, allineato col testo. */
.leg-quota-input {
  width: 5em;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  padding: 1px 4px;
  border: 1px solid #d97706;
  border-radius: 4px;
  background: #fffbeb;
  color: #b45309;
  outline: none;
  box-sizing: border-box;
}
.leg-quota-input:focus { box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25); }

.frozen-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.frozen-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.frozen-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0;
}

.frozen-meta[data-status]::before {
  content: attr(data-status) "  " attr(data-record) "  " attr(data-pct);
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 10px;
  line-height: 1;
}

.frozen-meta-cards {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  padding: 6px 10px;
  line-height: 1;
}

.frozen-section-title {
  font-size: 1.3rem;
}

.section-note {
  font-size: 0.8em;
  font-weight: 600;
  color: #64748b;
}

.frozen-body {
  display: none;
  padding: 12px;
  animation: expand 0.25s ease-in-out;
}

.frozen-card.open .frozen-body {
  display: block;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background-color .15s ease, transform .1s ease, border-color .15s ease;
}
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.icon-btn:disabled { opacity: .5; cursor: wait; transform: none; }
.icon-btn:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }

.refresh-sheet { border-color: #198754; color: #198754; }
.refresh-sheet:hover { background: rgba(25, 135, 84, 0.12); }

.share-sheet { border-color: #0d6efd; color: #0d6efd; }
.share-sheet:hover { background: rgba(13, 110, 253, 0.12); }

.delete-sheet { border-color: #dc3545; color: #dc3545; }
.delete-sheet:hover { background: rgba(220, 53, 69, 0.12); }

@keyframes expand {
  from { opacity: 0; transform: scaleY(0.97); }
  to   { opacity: 1; transform: scaleY(1); }
}

/* === FREEZE MATCH STATUS (senza colorazione righe) === */

.frozen-win,
.frozen-lose,
.frozen-pending {
  background-color: transparent !important;
}

.frozen-win td,
.frozen-lose td,
.frozen-pending td {
  color: #111827;
  font-weight: normal;
}

.frozen-win td:first-child,
.frozen-lose td:first-child {
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  border-radius: 0;
  text-align: center;
  min-width: 42px;
  font-size: 1.1em;
}

.frozen-pending {
  opacity: 1;
}
/* =========================================
   SFONDO CARD FROZEN (celeste fisso)
   ========================================= */

.frozen-card {
  background: #f0f9ff;          /* celeste chiaro */
  border: 1px solid #bfdbfe;
}

/* =========================================
   COLORAZIONE SINGOLA SCHEDA
   ========================================= */

.gioca-card-title {
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: inline-block;
  font-weight: 700;
}

/* 🟢 SCHEDA VINTA – verde intenso */
.frozen-scheda-win {
  background: #2bf063;          /* verde molto scuro */
  color: #ffffff;
}

/* 🔴 SCHEDA PERSA – rosso intenso */
.frozen-scheda-lose {
  background: #f74859;          /* rosso molto scuro */
  color: #ffffff;
}

/* =========================================
   PROFIT SUMMARY BOX (dentro frozen-body)
   ========================================= */
.frozen-profit-summary {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 2px solid #c7d2fe;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
}

.profit-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profit-totals {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: center;
}

/* Variante "grid": riempimento uniforme su 2 righe (4 per riga su desktop,
   2 per riga su mobile). Usata quando il numero di tile può variare
   (es. Schede Salvate con "Possibile guadagno" visibile solo su schede aperte). */
.profit-totals.profit-totals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  justify-content: stretch;
}
.profit-totals.profit-totals-grid .profit-item {
  min-width: 0;
  width: 100%;
}
@media (max-width: 768px) {
  .profit-totals.profit-totals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

/* =========================================================
   LIVE / PROVVISORIO: banner riepilogo + riga match + badge
   Valori "in tempo reale" visibili quando almeno una partita
   è in corso al click su Aggiorna.
   ========================================================= */
.frozen-live-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin: 0 0 10px 0;
  background: linear-gradient(90deg, #fff5f5 0%, #ffecec 100%);
  border: 1px solid #f5c2c2;
  border-left: 4px solid #e53935;
  border-radius: 8px;
  font-size: 0.92rem;
  color: #3d1e1e;
}
.frozen-live-banner .live-label {
  font-weight: 600;
  color: #c62828;
}
.frozen-live-banner .live-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}
.frozen-live-banner .live-stats b { font-weight: 700; }

/* Pallino "LIVE" pulsante, condiviso da banner e badge di riga */
.live-dot,
.live-dot-icon {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 0 rgba(229, 57, 53, 0.6);
  animation: livePulse 1.4s ease-out infinite;
  vertical-align: middle;
  margin-right: 4px;
}
.live-dot-icon { margin-right: 0; }
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

/* Cornice sinistra per card combinazione LIVE (riepilogo provvisorio) */
.frozen-card.frozen-card-live {
  border-left: 3px solid #e53935;
}

/* Etichetta "(live)" accanto ai valori provvisori nei tile profit */
.profit-live-hint {
  color: #c62828;
  font-weight: 600;
  margin-left: 2px;
}

/* Badge punteggio live + minuto nella cella "Risultato" */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #c62828;
  white-space: nowrap;
}

/* Righe match "live" — sfondo leggero, icona provvisoria più tenue */
tr.frozen-live td {
  background: #fff8f8;
}
tr.frozen-live-win td  { background: #f1f9f1; }
tr.frozen-live-lose td { background: #fbeeee; }
tr.frozen-live td:first-child {
  font-weight: 600;
  color: #8a5a5a;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .frozen-live-banner {
    font-size: 0.86rem;
    padding: 7px 10px;
    gap: 6px;
  }
  .live-badge {
    font-size: 0.78rem;
    padding: 2px 6px;
  }
}

.profit-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  padding: 8px 16px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.profit-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profit-value {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  margin-top: 2px;
}

.profit-subtext {
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 2px;
  text-align: center;
  line-height: 1.2;
}

.profit-net {
  font-size: 20px;
}

.profit-positive .profit-value { color: #16a34a; }
.profit-negative .profit-value { color: #dc2626; }
.profit-zero .profit-value { color: #64748b; }

.profit-positive { border-color: #bbf7d0; background: #f0fdf4; }
.profit-negative { border-color: #fecaca; background: #fef2f2; }

.profit-pending {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  font-style: italic;
  letter-spacing: 0.3px;
}

/* Tabella dettaglio per fascia/mercato */
.profit-detail-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.profit-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.profit-detail-table th {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  padding: 6px 10px;
  text-align: center;
  border-bottom: 2px solid #e2e8f0;
}

.profit-detail-table th:first-child { text-align: left; }

.profit-detail-table td {
  padding: 6px 10px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
}

.profit-detail-table td:first-child { text-align: left; }

.profit-detail-table .profit-positive { color: #16a34a; background: transparent; border-color: transparent; }
.profit-detail-table .profit-negative { color: #dc2626; background: transparent; border-color: transparent; }
.profit-detail-table .profit-zero { color: #64748b; background: transparent; border-color: transparent; }

/* Pill bilancio nell'header */
.frozen-profit-pill-pos {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #16a34a;
  border: 1px solid #15803d;
  border-radius: 999px;
  padding: 6px 12px;
  line-height: 1;
}

.frozen-profit-pill-neg {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #dc2626;
  border: 1px solid #b91c1c;
  border-radius: 999px;
  padding: 6px 12px;
  line-height: 1;
}

.frozen-profit-pill-zero {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 12px;
  line-height: 1;
}

/* Profit per singola card */
.frozen-card-profit-win {
  color: #16a34a !important;
  font-weight: 700;
}

.frozen-card-profit-lose {
  color: #dc2626 !important;
  font-weight: 700;
}

/* === Chrome CTA Topbar === */

.chrome-cta {
  background: #facc15;
  color: #111827;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-left: 15px;

  margin-right: 18px;   /* 👈 aggiungi questo */
}

.chrome-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.whatsapp-cta,
.login-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25d366;
  color: #ffffff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.whatsapp-cta {
  padding: 8px 14px;
  white-space: nowrap;
}

.login-whatsapp {
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
  padding: 12px 14px;
}

.whatsapp-cta:hover,
.login-whatsapp:hover {
  background: #1fb958;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 211, 102, 0.26);
}

.whatsapp-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.whatsapp-cta-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.whatsapp-cta-label {
  line-height: 1;
}

.hidden {
  display: none !important;
}
.suspended {
  opacity: 0.6;
  cursor: not-allowed;
}

.suspended-badge {
  background: #c62828;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.sidebar-auth {
  margin: 0 12px 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.topbar-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
  flex-shrink: 0;
}

.auth-pill {
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-logout {
  white-space: nowrap;
}

.login-form {
  display: block;
}

.login-info {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #166534;
}

.admin-panel {
  width: calc(100% - 20px);
  max-width: 1400px;
  margin: 20px 10px 20px 0;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.admin-panel h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-header .subtitle {
  margin-bottom: 0;
}

.admin-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

.admin-apisports-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #d7deea;
  border-radius: 999px;
  background: #f8fbff;
  font-size: 13px;
  color: #213052;
}

.admin-apisports-status.error {
  border-color: #f3b6b6;
  background: #fff4f4;
  color: #a12727;
}

.admin-apisports-label {
  font-weight: 600;
  opacity: 0.75;
}

.admin-apisports-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.admin-apisports-refresh {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
  color: inherit;
}

.admin-apisports-refresh:hover {
  opacity: 0.7;
}

.admin-system-update {
  min-width: 220px;
  white-space: nowrap;
}

.admin-refresh-calendar {
  background: #0d6efd;
  border-color: #0d6efd;
}

.admin-refresh-calendar:hover:not(:disabled) {
  background: #0b5ed7;
  border-color: #0a58ca;
}

.admin-refresh-calendar:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.admin-panel .subtitle {
  margin-bottom: 18px;
  color: #6b7280;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.admin-form input,
.admin-form select {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: #f9fafb;
}

.admin-actions {
  display: flex;
  align-items: flex-end;
}

.admin-config-section {
  margin-top: 18px;
}

.admin-config-subtitle {
  margin-top: 0;
  margin-bottom: 12px;
}

.admin-submenu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-submenu-btn {
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
}

.admin-submenu-btn.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.admin-subpanel {
  display: none;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.admin-subpanel.active {
  display: block;
}

.admin-stake-preview {
  margin-top: 14px;
}

.admin-stake-preview-empty {
  color: #6b7280;
  font-size: 14px;
  padding: 12px 4px 0;
}

.admin-stake-preview-wrap {
  margin-top: 4px;
}

.admin-config-full {
  grid-column: 1 / -1;
}

.admin-config-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.admin-secondary-btn {
  background: #e5e7eb;
  color: #1f2937;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}

.admin-secondary-btn:hover {
  background: #d1d5db;
}

.admin-secondary-btn:active {
  transform: translateY(1px);
}

.admin-secondary-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.tv-monitor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tv-monitor-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.4);
}
.tv-monitor-badge--on {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
  animation: tvMonitorPulse 2s ease-in-out infinite;
}
.tv-monitor-badge--off {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #e5e7eb;
}
.tv-monitor-badge--warn {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
@keyframes tvMonitorPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,101,52,0.35); }
  50% { box-shadow: 0 0 0 6px rgba(22,101,52,0); }
}

.tv-monitor-status-banner {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 18px;
}
.tv-monitor-status-banner--on {
  background: #f0fdf4;
  border-color: #86efac;
}
.tv-monitor-status-banner--warn {
  background: #fffbeb;
  border-color: #fcd34d;
}
.tv-monitor-status-banner--off {
  background: #f9fafb;
  border-color: #e5e7eb;
}
.tv-monitor-status-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tv-monitor-status-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
}
.tv-monitor-status-value {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}

.tv-action-group {
  margin-top: 18px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.tv-action-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #4b5563;
}

.tv-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tv-action-summary {
  display: none;
  white-space: pre-wrap;
  margin-top: 12px;
  background: #111827;
  color: #d1fae5;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 400;
}

.tv-action-summary.is-visible {
  display: block;
}

.tv-action-screenshot {
  display: none;
  margin-top: 12px;
}

.tv-action-screenshot.is-visible {
  display: block;
}

.tv-action-screenshot img {
  max-width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

.tv-monitor-form .tv-color-field .tv-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.tv-monitor-form input[type="color"] {
  padding: 0;
  width: 46px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
}

.tv-monitor-form .tv-color-code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #6b7280;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 6px;
}

.tv-monitor-form input[type="range"] {
  margin-top: 10px;
  accent-color: #0033a0;
}

.tv-monitor-form .tv-monitor-hint {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.tv-monitor-recipients {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.tv-monitor-recipients-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.tv-monitor-recipients-head .tv-monitor-hint {
  color: #6b7280;
  font-size: 12px;
}

.tv-monitor-recipients-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tv-monitor-recipient {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.tv-monitor-recipient input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0033a0;
  cursor: pointer;
}

.tv-monitor-recipient input[type="checkbox"]:disabled {
  cursor: progress;
}

.tv-color-preview-wrap {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.tv-color-preview-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
}

.tv-color-preview {
  padding: 14px 18px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 15px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.08), 0 1px 2px rgba(17, 24, 39, 0.08);
  background: rgba(0, 51, 160, 0.8);
  color: #fff;
  transition: background .15s ease, color .15s ease;
}

.admin-message {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 700;
}

.admin-message.success {
  color: #166534;
}

.admin-message.error {
  color: #b91c1c;
}

.admin-users-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.admin-users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.tv-monitor-toggle-btn {
  margin-left: auto;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .tv-monitor-toggle-btn {
    margin-left: 0;
    width: 100%;
  }
}

.admin-users-header h3 {
  margin: 0;
  font-size: 18px;
}

.admin-users-status {
  margin-bottom: 12px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.admin-users-status.warning {
  color: #92400e;
}

.admin-users-status.error {
  color: #b91c1c;
}

.admin-users-table-wrap {
  margin: 0;
}

.admin-mapping-table-wrap {
  margin-top: 12px;
}

.admin-mapping-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-mapping-table td {
  vertical-align: top;
}

.admin-users-table {
  width: max-content;
  min-width: 100%;
}

.admin-users-table th:last-child,
.admin-users-table td:last-child {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: nowrap;
  min-width: 220px;
  white-space: nowrap;
}

.admin-users-table td:last-child button {
  white-space: nowrap;
}

.admin-delete-user[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-tv-overlay-table-wrap {
  margin-top: 12px;
}

.admin-tv-overlay-table td:nth-child(1) strong {
  color: #111827;
}

.admin-tv-overlay-table td:nth-child(2),
.admin-tv-overlay-table td:nth-child(3),
.admin-tv-overlay-table td:nth-child(4) {
  white-space: nowrap;
}

/* ── Retrain Panel ── */
.admin-retrain-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-retrain-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.admin-retrain-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  user-select: none;
}

.admin-retrain-select-all input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #111827;
  cursor: pointer;
}

.admin-retrain-counter {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  padding: 4px 12px;
  border-radius: 999px;
}

.admin-retrain-counter span {
  color: #111827;
}

.admin-retrain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.admin-retrain-grid::-webkit-scrollbar {
  width: 6px;
}

.admin-retrain-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.admin-retrain-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
  user-select: none;
}

.admin-retrain-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.admin-retrain-card.selected {
  border-color: #111827;
  background: #f0f4ff;
  box-shadow: 0 0 0 1px #111827;
}

.admin-retrain-card input[type="checkbox"] {
  display: none;
}

.admin-retrain-card-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  background: #fff;
}

.admin-retrain-card.selected .admin-retrain-card-check {
  background: #111827;
  border-color: #111827;
}

.admin-retrain-card.selected .admin-retrain-card-check::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.admin-retrain-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.admin-retrain-card-code {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.5px;
}

.admin-retrain-card-name {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-retrain-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.admin-retrain-footer .admin-message {
  margin: 0;
  flex: 1;
}

.admin-retrain-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-retrain-submit:hover:not(:disabled) {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.admin-retrain-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.admin-retrain-submit svg {
  flex-shrink: 0;
}

.admin-retrain-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: 14px;
}

/* ── Admin Combinazioni bookmaker picker ── */
.admin-combinazioni-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-combinazioni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  padding: 4px;
  max-height: 420px;
  overflow-y: auto;
}

.admin-combinazioni-grid::-webkit-scrollbar {
  width: 6px;
}

.admin-combinazioni-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.admin-combinazioni-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
  user-select: none;
}

.admin-combinazioni-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.admin-combinazioni-card.selected {
  border-color: #047857;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px #047857;
}

.admin-combinazioni-card input[type="checkbox"] {
  display: none;
}

.admin-combinazioni-card-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  background: #fff;
}

.admin-combinazioni-card.selected .admin-combinazioni-card-check {
  background: #047857;
  border-color: #047857;
}

.admin-combinazioni-card.selected .admin-combinazioni-card-check::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.admin-combinazioni-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.admin-combinazioni-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-combinazioni-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: 14px;
}

/* ── Combinazioni · Leghe extra (solo combinazioni) ── */
.admin-combinazioni-extra-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.admin-combinazioni-extra-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #334155;
}

.admin-combinazioni-extra-row input {
  padding: 8px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
}

.admin-combinazioni-extra-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-combinazioni-extra-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.admin-combinazioni-extra-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Aggiungi Lega ── */
.admin-add-league-search {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-add-league-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-add-league-search-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
}

.admin-add-league-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 640px;
  overflow-y: auto;
}

/* Griglia di quadrati paese (modalità "Carica tutte") */
.admin-add-league-country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 4px;
}

.admin-add-league-country-grid.hidden {
  display: none !important;
}

.admin-add-league-country-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px;
  min-height: 130px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: #1e293b;
  text-align: center;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
}

.admin-add-league-country-card:hover {
  border-color: #2563eb;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.admin-add-league-country-card-flag {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.admin-add-league-country-card-flag-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: none;
}

.admin-add-league-country-card-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
  max-width: 100%;
}

.admin-add-league-country-card-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* Pannello di dettaglio di una singola nazione */
.admin-add-league-country-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-add-league-country-detail.hidden {
  display: none !important;
}

.admin-add-league-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 8px;
  border-bottom: 1px solid #e2e8f0;
}

.admin-add-league-detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  flex: 1;
  min-width: 0;
}

.admin-add-league-detail-flag {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.admin-add-league-back-btn {
  flex-shrink: 0;
}

.admin-add-league-detail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-add-league-country-count {
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Blend weight sliders ── */
.admin-blend-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-blend-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-blend-label {
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
}

.admin-blend-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-blend-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #2563eb 0%, #2563eb var(--slider-pct, 60%), #e2e8f0 var(--slider-pct, 60%), #e2e8f0 100%);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

.admin-blend-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(37,99,235,0.35);
  cursor: pointer;
}

.admin-blend-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(37,99,235,0.35);
  cursor: pointer;
}

.admin-blend-val {
  min-width: 38px;
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  color: #2563eb;
}

.admin-blend-hint {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

.team-trends-panel {
  width: calc(100% - 20px);
  max-width: 1400px;
  margin: 20px 10px 20px 0;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.team-trends-header h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.team-trends-header .subtitle {
  margin: 0 0 18px;
  color: #6b7280;
}

.team-trends-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.team-trends-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  min-width: 140px;
  flex: 0 1 150px;
}

.team-trends-filters input,
.team-trends-filters select {
  padding: 7px 9px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13px;
  background: #f9fafb;
  color: #111827;
}

.team-trends-filters input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.team-trends-filters button {
  height: 34px;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 13px;
}

.team-trends-mode-select {
  min-width: 88px;
}

.team-trends-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}

.team-trends-meta-item {
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  color: #334155;
  font-size: 13px;
}

.team-trends-status {
  margin: 10px 0 16px;
  color: #374151;
  font-weight: 600;
}

.team-trends-status.error {
  color: #b91c1c;
}

.team-trends-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.team-trends-tab {
  background: #e5e7eb;
  color: #1f2937;
}

.team-trends-tab:hover {
  background: #d1d5db;
}

.team-trends-tab.active {
  background: var(--accent);
  color: #ffffff;
}

.team-trends-category-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.team-trends-category-header {
  padding: 16px 18px 0;
}

.team-trends-category-header h3 {
  margin: 0;
  text-align: left;
  font-size: 1.05rem;
}

.team-trends-table-wrap {
  margin: 16px;
}

.team-trends-table {
  width: max-content;
  min-width: 100%;
}

.team-trends-table th:first-child,
.team-trends-table td:first-child {
  text-align: center;
}

.team-trends-table th:nth-child(2),
.team-trends-table td:nth-child(2) {
  text-align: left;
}

.team-trends-table th:last-child,
.team-trends-table td:last-child {
  width: auto;
  color: inherit;
  font-weight: inherit;
}

.team-trends-leagues {
  text-align: left;
  min-width: 220px;
  white-space: normal;
}

.team-trends-rank {
  font-weight: 700;
  color: #0f172a;
  min-width: 46px;
}

.team-trends-leagues-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-trends-league-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #f8fafc;
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}

.team-trends-league-flag {
  display: inline-flex;
  align-items: center;
}

.team-trends-league-flag img {
  width: 18px !important;
  height: 13px !important;
}

.team-trends-league-name {
  white-space: nowrap;
}

.team-trends-empty-category {
  margin: 20px;
}

/* @media 900px – spostato in sezione responsive unificata in fondo */

/* @media 768px topbar – spostato in sezione responsive unificata in fondo */

.gioca-market-reliability,
.gioca-top-leagues,
.gioca-fascia-section {
  margin-top: 14px;
}

.gioca-fasce-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.gioca-info-fasce {
  margin: 10px 0 14px;
  border: 1px solid #dbe4ea;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  overflow: hidden;
}

.gioca-info-fasce-summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 700;
  color: #1f2937;
}

.gioca-info-fasce-summary::-webkit-details-marker {
  display: none;
}

.gioca-info-fasce-summary::after {
  content: "+";
  float: right;
  font-size: 18px;
  line-height: 1;
  color: #475569;
}

.gioca-info-fasce[open] .gioca-info-fasce-summary::after {
  content: "-";
}

.gioca-info-fasce-content {
  padding: 0 16px 16px;
  border-top: 1px solid #e5e7eb;
}

.gioca-info-fasce-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.gioca-info-fascia-card {
  border: 1px solid #dbe4ea;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.gioca-info-fascia-card-head {
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.gioca-info-fascia-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #1f2937;
}

.gioca-info-fascia-card-rule {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.gioca-info-fascia-table-wrap {
  padding: 0 10px 10px;
}

.gioca-info-fascia-table {
  width: 100%;
  border-collapse: collapse;
}

.gioca-info-fascia-table th,
.gioca-info-fascia-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  font-size: 13px;
}

.gioca-info-fascia-table th {
  color: #64748b;
  font-weight: 700;
}

.gioca-info-fascia-table tbody tr:last-child td {
  border-bottom: none;
}

.gioca-fasce-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.gioca-fasce-summary-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #374151;
}

.gioca-fasce-summary-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gioca-fascia-header h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

.gioca-card-block {
  margin-top: 10px;
}

/* @media 768px/480px main/gioca – spostato in sezione responsive unificata in fondo */

/* ============================= */
/* Bootstrap Integration Layer   */
/* ============================= */

body.app-shell {
  background:
    radial-gradient(circle at top right, rgba(0, 196, 108, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #eef5f2 100%);
}

.app-main {
  min-height: 100vh;
}

.content-panel {
  min-height: 240px;
}

.min-w-0 {
  min-width: 0;
}

.topbar {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  min-height: 72px;
}

.topbar .container-fluid {
  max-width: none;
}

.dropbtn.btn {
  color: #ffffff;
  font-weight: 700;
  border-radius: 999px;
}

.dropbtn.btn:hover,
.dropbtn.btn:focus {
  color: #ffffff;
}

.filters-panel.card {
  border-radius: 18px;
  border: 1px solid rgba(209, 213, 219, 0.9);
  overflow: hidden;
}

.sidebar-brand-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(0, 196, 108, 0.12);
  color: #047857;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Brand "La Profeta" stile card pulito, coerente con la nuova sidebar */
.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 6px 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}
.sidebar-brand-logo {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.sidebar-brand-tag {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}

.sidebar-actions-top {
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.sidebar-actions {
  padding-bottom: 18px;
}

#sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.sidebar-auth,
.auth-pill {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.sidebar-footer {
  background: rgba(226, 232, 240, 0.75);
  transition: background 0.2s, color 0.2s;
}

.sidebar-footer:hover {
  background: #0f172a;
  color: #ffffff;
}

.hamburger.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

body.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(0, 196, 108, 0.16), transparent 22%),
    linear-gradient(160deg, #f8fafc 0%, #e8f5ee 50%, #ffffff 100%);
}

.login-box {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.login-error {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #b91c1c;
}

.dynamic-view-section {
  margin-bottom: 24px;
}

.dynamic-stack > * + * {
  margin-top: 16px;
}

/* ============================================================
   COMBINAZIONI – Layout, picker, suggestions, results
   ============================================================ */

.combo-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0;
}

.combo-result-block {
  background: #ffffff;
  border: 1px solid #e5ebf0;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  padding: 18px;
}

/* ── Hero ── */
.combo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #065f46 130%);
  color: #f8fafc;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.combo-hero h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

/* Variante "compact": titolo più piccolo, uniforme al colore della pagina (no gradient scuro) */
.combo-hero.combo-hero-compact {
  background: transparent;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 14px 18px;
  color: inherit;
  border-radius: 14px;
}
.combo-hero.combo-hero-compact .combo-hero-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.005em;
}
.combo-hero.combo-hero-compact .subtitle {
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.45;
}
.combo-hero.combo-hero-compact .combo-hero-stat {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  min-width: 88px;
  padding: 8px 10px;
  backdrop-filter: none;
}
.combo-hero.combo-hero-compact .combo-hero-stat-value {
  color: #059669;
  font-size: 1.15rem;
}
.combo-hero.combo-hero-compact .combo-hero-stat-label {
  color: #64748b;
  font-size: 10px;
}

.combo-hero .subtitle {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 620px;
}

.combo-hero-stats {
  display: flex;
  gap: 10px;
}

.combo-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.combo-hero-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #34d399;
  line-height: 1;
}

.combo-hero-stat-label {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

/* ── Section headings ── */
.combo-section-head {
  margin-bottom: 14px;
}

.combo-section-head h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: #0f172a;
}

.combo-structure-note {
  margin: 0;
  color: #64748b;
  font-size: 13.5px;
  line-height: 1.5;
}

/* ── Match picker ── */
.combo-picker-card {
  background: #ffffff;
  border: 1px solid #e5ebf0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.combo-picker-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.combo-picker-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.combo-picker-label {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.combo-picker-title small {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.combo-picker-search-wrap {
  flex: 1 1 220px;
  max-width: 360px;
  min-width: 180px;
  position: relative;
}

.combo-picker-search {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1px solid #d7dee4;
  border-radius: 12px;
  background: #f8fafc url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat 12px center;
  font-size: 14px;
  color: #0f172a;
  font-weight: 600;
}

.combo-picker-search:focus {
  outline: none;
  border-color: #00c46c;
  box-shadow: 0 0 0 3px rgba(0, 196, 108, 0.16);
  background-color: #ffffff;
}

/* Native select shown on mobile / fallback */
.combo-match-select {
  display: none;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfe4d8;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.combo-match-select:focus {
  outline: none;
  border-color: #00c46c;
  box-shadow: 0 0 0 3px rgba(0, 196, 108, 0.16);
}

/* Desktop custom match list */
.combo-match-list {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.combo-match-list > * + * {
  margin-top: 10px;
}

.combo-match-list::-webkit-scrollbar {
  width: 8px;
}

.combo-match-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.combo-match-list-empty {
  padding: 20px;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}

.combo-match-group {
  display: block;
  border: 1px solid #e5ebf0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.combo-match-group[open] {
  border-color: #cfe4d8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.combo-match-group-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  user-select: none;
}

.combo-match-group-summary::-webkit-details-marker {
  display: none;
}

.combo-match-group-summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(0, 196, 108, 0.12);
  color: #047857;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.combo-match-group[open] .combo-match-group-summary::before {
  content: "−";
  background: #047857;
  color: #ffffff;
}

.combo-match-group-summary:hover {
  background: linear-gradient(180deg, #f0fdf4, #ffffff);
}

.combo-match-group-label {
  flex: 1;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f172a;
}

.combo-match-group-count {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.combo-match-group[open] .combo-match-group-count {
  background: rgba(0, 196, 108, 0.12);
  border-color: rgba(0, 196, 108, 0.3);
  color: #047857;
}

.combo-match-group-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px dashed #e5ebf0;
}

.combo-match-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e5ebf0;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 52px;
  width: 100%;
}

.combo-match-item:hover,
.combo-match-item:focus-visible {
  border-color: #00c46c;
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 196, 108, 0.12);
  outline: none;
}

.combo-match-item.is-active {
  border-color: #00c46c;
  background: linear-gradient(180deg, rgba(0, 196, 108, 0.12), rgba(0, 196, 108, 0.04));
  box-shadow: inset 0 0 0 1px rgba(0, 196, 108, 0.35);
}

.combo-match-item-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13.5px;
  line-height: 1.25;
}

.combo-match-item-teams strong {
  color: #0f172a;
  font-weight: 700;
}

.combo-match-item-vs {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
}

.combo-match-item-meta {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
}

.combo-match-item-metas {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.combo-match-item-league {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 196, 108, 0.12);
  color: #047857;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Grouping toggle (Per Lega / Per Giorno) */
.combo-picker-grouping {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  background: #f1f5f9;
  border: 1px solid #e5ebf0;
  border-radius: 12px;
}

.combo-grouping-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.combo-grouping-btn:hover {
  color: #0f172a;
}

.combo-grouping-btn.is-active {
  background: #ffffff;
  color: #047857;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.combo-grouping-btn:focus-visible {
  outline: 2px solid #00c46c;
  outline-offset: 2px;
}

/* ── Context card (selected match + budget) ── */
.combo-context-card {
  background: #ffffff;
  border: 1px solid #e5ebf0;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
}

.combo-context-card.is-active {
  border-color: #00c46c;
  background: linear-gradient(180deg, #ffffff, #f0fdf4);
}

.combo-context-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  padding: 10px 6px;
}

.combo-context-empty strong {
  color: #0f172a;
  font-size: 0.98rem;
}

.combo-context-empty span {
  color: #64748b;
  font-size: 13px;
}

.combo-context-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.combo-context-match {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1 1 240px;
}

.combo-context-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 1.15rem;
  color: #0f172a;
}

.combo-context-teams strong {
  font-weight: 800;
}

.combo-context-vs {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
}

.combo-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.combo-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
}

.combo-pill-book {
  background: rgba(0, 196, 108, 0.12);
  border-color: rgba(0, 196, 108, 0.3);
  color: #047857;
}

.combo-pill-warn {
  background: rgba(234, 179, 8, 0.18);
  border-color: rgba(234, 179, 8, 0.45);
  color: #92400e;
}

.combo-context-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.combo-context-insights {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.combo-insights-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.combo-insights-row.is-loading,
.combo-insights-row.is-error {
  color: #64748b;
  font-style: italic;
}

.combo-insights-label {
  min-width: 130px;
  max-width: 180px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-insights-placeholder {
  color: #94a3b8;
}

.combo-form-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.combo-form-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #94a3b8;
  cursor: default;
  user-select: none;
}

.combo-form-dot.is-win { background: #16a34a; }
.combo-form-dot.is-draw { background: #eab308; color: #1f2937; }
.combo-form-dot.is-loss { background: #dc2626; }
.combo-form-dot.is-none { background: #cbd5e1; color: #475569; }

.combo-insights-actions-row {
  justify-content: space-between;
  margin-top: 2px;
}

.combo-insights-h2h-label {
  color: #475569;
}

.combo-insights-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.combo-insights-info-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.combo-insights-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.combo-insights-modal {
  background: #fff;
  border-radius: 14px;
  width: min(640px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}

.combo-insights-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.combo-insights-modal-head h3 {
  margin: 0;
  font-size: 15px;
  color: #0f172a;
}

.combo-insights-modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 2px 8px;
  border-radius: 6px;
}

.combo-insights-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.combo-insights-modal-body {
  padding: 14px 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.combo-insights-modal-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #1f2937;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.combo-insights-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.combo-insights-modal-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12.5px;
}

.combo-insights-modal-item > .combo-form-dot {
  grid-column: 1;
}

.combo-insights-modal-teams {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  color: #334155;
  min-width: 0;
}

.combo-insights-modal-teams > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-insights-modal-teams > span:first-child { text-align: right; }
.combo-insights-modal-teams > span:last-child  { text-align: left; }

.combo-insights-modal-teams .is-focus {
  font-weight: 700;
  color: #0f172a;
}

.combo-insights-modal-score {
  padding: 2px 8px;
  background: #e2e8f0;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  white-space: nowrap;
  word-break: keep-all;
}

.combo-insights-modal-meta {
  grid-column: 3;
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .combo-insights-modal-item {
    grid-template-columns: auto 1fr;
    row-gap: 6px;
  }
  .combo-insights-modal-teams {
    grid-column: 2;
    grid-template-columns: 1fr auto 1fr;
  }
  .combo-insights-modal-meta {
    grid-column: 1 / -1;
    text-align: right;
  }
}

.combo-insights-modal-empty {
  margin: 0;
  padding: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  font-size: 12.5px;
}

.combo-budget-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #d7dee4;
  border-radius: 12px;
}

.combo-budget-inline span {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.combo-budget-inline input {
  width: 92px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: #0f172a;
  font-weight: 800;
  font-size: 15px;
  text-align: right;
}

.combo-budget-inline input:focus {
  outline: none;
}

.combo-budget-inline:focus-within {
  border-color: #00c46c;
  box-shadow: 0 0 0 3px rgba(0, 196, 108, 0.16);
}

.combo-proposals-block {
  background: #fff;
  border: 1px solid #e4e9f2;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.combo-proposals-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.combo-proposals-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.combo-proposals-quota {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
}

.combo-proposals-quota.ok {
  background: #e6f7ee;
  color: #046c4e;
}

.combo-proposals-quota.blocked {
  background: #fee2e2;
  color: #991b1b;
}

.combo-secondary-btn {
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  color: #213052;
  font-weight: 600;
  cursor: pointer;
}

.combo-secondary-btn:hover {
  background: #f8fafc;
}

.combo-proposals-status {
  margin-top: 12px;
}

.combo-proposals-hint {
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px dashed #d0d7e2;
  border-radius: 8px;
  color: #475569;
  font-size: 13px;
}

.combo-proposals-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
  font-size: 14px;
}

.combo-proposals-meta {
  font-size: 12px;
  color: #64748b;
  margin: 8px 0 12px;
}

.combo-proposals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.combo-proposal-slot.is-hidden,
.combo-proposal-slot.is-search-hidden {
  display: none;
}

.combo-proposals-bucket.is-search-empty {
  display: none;
}

.combo-proposal-item {
  position: relative;
  padding-right: 72px;
}

.combo-proposal-profit-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e6f7ee;
  color: #046c4e;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #a7e6c3;
}

.combo-proposal-extra {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.combo-proposal-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.combo-proposal-label {
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
}

.combo-proposal-uncovered {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.combo-ai-threshold-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 8px;
  white-space: nowrap;
}

.combo-ai-threshold-label input {
  width: 52px;
  padding: 2px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  background: #fff;
  color: #0f172a;
}

.combo-ai-threshold-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  margin-left: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.combo-ai-threshold-reset:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}
.combo-ai-threshold-reset:active {
  background: #cbd5e1;
}

.combo-ai-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.combo-ai-chip.is-strong {
  background: #dcfce7;
  color: #14532d;
  border-color: #86efac;
}

.combo-ai-chip.is-muted {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.combo-ai-suggest-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.combo-ai-leg {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 1px;
  border-radius: 6px;
  background: #dcfce7;
  color: #14532d;
  font-weight: 800;
  border: 1px solid #86efac;
}

.combo-match-item.combo-proposal-item.is-ai-suggested,
.combo-suggestion-card.is-ai-suggested {
  border-color: #86efac;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.02));
}

.combo-proposals-bucket-ai .combo-proposals-bucket-title {
  color: #14532d;
}

.combo-proposals-bucket-hint {
  font-size: 12px;
  color: #475569;
  margin: 0 0 8px;
}

/* === Combo Proposal Card v2 === */
.combo-proposal-v2 {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0;
  padding: 0;
  padding-right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  overflow: hidden;
}
/* Profitto emulato in alto a destra */
.combo-proposal-v2 .cpv2-profit-corner {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}
/* Lascia spazio al chip nella prima riga del header */
.combo-proposal-v2 .cpv2-head .cpv2-teams {
  padding-right: 64px;
}
.combo-proposal-v2:hover,
.combo-proposal-v2:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}
.combo-proposal-v2.is-ai-suggested {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 60%);
}
.combo-proposal-v2 .cpv2-head {
  display: grid;
  gap: 2px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid #f1f5f9;
}
.combo-proposal-v2 .cpv2-teams {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14.5px;
  color: #0f172a;
  line-height: 1.25;
}
.combo-proposal-v2 .cpv2-teams strong { font-weight: 700; }
.combo-proposal-v2 .cpv2-vs {
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.combo-proposal-v2 .cpv2-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: #64748b;
}
.combo-proposal-v2 .cpv2-league::before { content: "🏆 "; opacity: 0.7; }
.combo-proposal-v2 .cpv2-date::before { content: "📅 "; opacity: 0.7; }
.combo-proposal-v2 .cpv2-body {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
}
.combo-proposal-v2 .cpv2-markets {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}
.combo-proposal-v2 .cpv2-uncovered {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.combo-proposal-v2 .cpv2-uncovered.is-full {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.combo-proposal-v2 .cpv2-uncovered.is-full::before { content: "🛡️ "; }
.combo-proposal-v2 .cpv2-uncovered.is-partial {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.combo-proposal-v2 .cpv2-uncovered.is-partial::before { content: "⚠️ "; }
.combo-proposal-v2 .cpv2-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 14px 12px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}
.combo-proposal-v2 .cpv2-profit {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
}
.combo-proposal-v2 .cpv2-profit.is-strong {
  background: #dcfce7;
  color: #14532d;
  border-color: #86efac;
}
.combo-proposal-v2 .cpv2-profit.is-mid {
  background: #fef9c3;
  color: #713f12;
  border-color: #fde68a;
}
.combo-proposal-v2 .cpv2-profit.is-low {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}
/* L'eventuale leg AI evidenziata dentro i mercati */
.combo-proposal-v2 .cpv2-markets .combo-ai-leg {
  font-size: 12px;
}
/* Disabilita il vecchio profit badge assoluto quando siamo in v2 */
.combo-proposal-v2 .combo-proposal-profit-badge { display: none; }

@media (max-width: 768px) {
  .combo-proposals-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .combo-proposal-v2 {
    border-radius: 12px;
  }
  .combo-proposal-v2 .cpv2-head {
    padding: 11px 12px 7px;
  }
  .combo-proposal-v2 .cpv2-teams {
    font-size: 15px;
  }
  .combo-proposal-v2 .cpv2-body {
    padding: 9px 12px;
  }
  .combo-proposal-v2 .cpv2-markets {
    font-size: 13px;
  }
  .combo-proposal-v2 .cpv2-foot {
    padding: 9px 12px 11px;
    gap: 5px;
  }
  .combo-proposal-v2 .cpv2-profit {
    font-size: 12px;
    padding: 2px 9px;
  }
  .combo-proposal-v2 .cpv2-profit-corner {
    top: 8px;
    right: 8px;
  }
  .combo-proposal-v2 .cpv2-head .cpv2-teams {
    padding-right: 60px;
  }
  .combo-ai-chip {
    font-size: 10.5px;
    padding: 2px 7px;
  }
  .combo-ai-suggest-badge {
    font-size: 10px;
    padding: 2px 7px;
  }
}

.combo-proposals-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.combo-proposals-more-btn small {
  color: #64748b;
  font-weight: 500;
  margin-left: 4px;
}

@media (max-width: 600px) {
  .combo-proposals-block {
    padding: 14px;
  }
  .combo-proposals-head {
    flex-direction: column;
    align-items: stretch;
  }
  .combo-proposals-actions {
    justify-content: space-between;
    width: 100%;
  }
  .combo-proposals-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .combo-proposal-item {
    padding-right: 62px;
  }
  .combo-proposal-profit-badge {
    top: 8px;
    right: 8px;
    font-size: 12px;
    padding: 3px 7px;
  }
  .combo-proposals-bucket-title {
    font-size: 13px;
  }
}

.combo-proposals-bucket {
  margin-top: 16px;
}

.combo-proposals-bucket-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

.combo-proposals-bucket-title small {
  font-weight: 500;
  color: #64748b;
  margin-left: 6px;
}

.combo-proposal-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 14px;
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  background: #fafbff;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.combo-proposal-card:hover {
  border-color: #0d6efd;
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.12);
  transform: translateY(-1px);
}

.combo-proposal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.combo-proposal-match {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.combo-proposal-match small {
  color: #64748b;
  font-size: 12px;
}

.combo-primary-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #00c46c, #059669);
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 196, 108, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.combo-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 196, 108, 0.34);
}

.combo-primary-btn:active {
  transform: translateY(0);
}

/* ── Suggestions ── */
.combo-suggestions-slot:empty {
  display: none;
}

.combo-loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
}

.combo-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #cbd5e1;
  border-top-color: #00c46c;
  border-radius: 50%;
  animation: combo-spin 0.8s linear infinite;
}

@keyframes combo-spin {
  to { transform: rotate(360deg); }
}

.combo-no-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  padding: 24px;
  border-color: #fecaca !important;
  background: linear-gradient(180deg, #fff1f2, #ffffff) !important;
}

.combo-no-results strong {
  font-size: 1rem;
  color: #b91c1c;
}

.combo-no-results span {
  color: #64748b;
  font-size: 13px;
}

.combo-bookmaker-group {
  border: 1px solid #e5ebf0;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  margin-bottom: 12px;
}

.combo-bookmaker-group[open] {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.combo-bookmaker-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}

.combo-bookmaker-summary::-webkit-details-marker { display: none; }

.combo-bookmaker-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: capitalize;
}

.combo-bookmaker-count {
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 196, 108, 0.12);
}

.combo-bookmaker-summary::after {
  content: "▾";
  margin-left: auto;
  color: #64748b;
  font-size: 14px;
  transition: transform 0.18s ease;
}

.combo-bookmaker-group[open] .combo-bookmaker-summary::after {
  transform: rotate(180deg);
}

.combo-bookmaker-body {
  padding: 8px 16px 16px;
}

.combo-suggestion-section + .combo-suggestion-section {
  margin-top: 18px;
}

.combo-suggestion-section h4 {
  margin: 10px 0 10px;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.combo-suggestion-section h4 small {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}

.combo-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.combo-suggestion-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #cfe4d8;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(0, 196, 108, 0.06), #ffffff);
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.combo-suggestion-card:hover,
.combo-suggestion-card:focus-visible {
  transform: translateY(-2px);
  border-color: #00c46c;
  box-shadow: 0 14px 28px rgba(0, 196, 108, 0.16);
  outline: none;
}

.combo-suggestion-card.is-active {
  border-color: #047857;
  background: linear-gradient(180deg, rgba(0, 196, 108, 0.16), rgba(0, 196, 108, 0.04));
  box-shadow: inset 0 0 0 2px rgba(4, 120, 87, 0.35);
}

.combo-suggestion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.combo-suggestion-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
  font-size: 11.5px;
  font-weight: 800;
}

.combo-suggestion-profit {
  font-size: 1rem;
  font-weight: 900;
  color: #047857;
}

.combo-suggestion-label {
  font-size: 0.95rem;
  color: #0f172a;
  line-height: 1.3;
  font-weight: 800;
}

.combo-suggestion-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.combo-overlap-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.14);
  color: #c2410c;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid rgba(234, 88, 12, 0.25);
}

.combo-suggestion-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.combo-suggestion-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.combo-suggestion-chip.combo-chip-good {
  background: rgba(0, 196, 108, 0.14);
  color: #047857;
}

.combo-suggestion-uncovered {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
  border-top: 1px dashed #e5ebf0;
  padding-top: 8px;
}

/* ── Selected markets (Copertura Selezionata) ── */
.combo-selected-block {
  border-color: #cfe4d8;
  background: linear-gradient(180deg, rgba(0, 196, 108, 0.04), #ffffff);
}

.combo-selected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.combo-selected-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e5ebf0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.combo-selected-card strong {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
}

.combo-selected-card .combo-selected-quota {
  font-size: 1.2rem;
  font-weight: 800;
  color: #047857;
}

.combo-selected-quota-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}

.combo-selected-quota-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.combo-selected-quota-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed #00c46c;
  border-radius: 10px;
  background: #f0fdf4;
  font-size: 1.15rem;
  font-weight: 800;
  color: #047857;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -moz-appearance: textfield;
  cursor: text;
}

.combo-editable-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
}

.combo-selected-quota-input::-webkit-outer-spin-button,
.combo-selected-quota-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.combo-selected-quota-input:hover {
  background: #ffffff;
}

.combo-selected-quota-input:focus {
  outline: none;
  border-color: #00c46c;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 196, 108, 0.18);
}

.combo-selected-card small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

/* Budget come carta nella stessa griglia delle quote */
.combo-selected-card-budget {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 70%);
}
.combo-selected-card-budget .combo-selected-quota-input {
  border-color: #6366f1;
  background: #eef2ff;
  color: #312e81;
}
.combo-selected-card-budget .combo-selected-quota-input:hover {
  background: #ffffff;
}
.combo-selected-card-budget .combo-selected-quota-input:focus {
  border-color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.combo-selected-index-budget {
  background: rgba(99, 102, 241, 0.14) !important;
  color: #4338ca !important;
}

.combo-selected-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 196, 108, 0.14);
  color: #047857 !important;
  font-size: 11px;
  font-weight: 800;
}

/* ── Results (tables + summary) ── */
.combo-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.combo-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.combo-summary-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e5ebf0;
  border-radius: 12px;
  background: #ffffff;
}

.combo-summary-card strong {
  font-size: 1.05rem;
  color: #0f172a;
}

.combo-summary-card small,
.combo-summary-label {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
}

.combo-score-list-cell {
  text-align: left;
  min-width: 200px;
}

.combo-score-extra {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.combo-score-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.combo-score-summary-card {
  padding: 12px 14px;
  border: 1px solid #e5ebf0;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
}

.combo-score-summary-card strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 0.9rem;
}

.combo-table td:first-child,
.combo-table th:first-child {
  min-width: 60px;
}

.combo-bollette-block {
  width: fit-content;
  max-width: 100%;
}

.combo-bollette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.combo-bollette-header h3 {
  margin: 0;
}

.combo-freeze-btn {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.combo-freeze-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.combo-freeze-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.frozen-card-combinazione .combo-frozen-meta {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e5ebf0;
  border-radius: 10px;
}

.frozen-card-combinazione .combo-frozen-meta > div:first-child {
  font-size: 1.05rem;
  color: #0f172a;
}

.combo-frozen-analysis-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding-top: 8px;
  border-top: 1px dashed #d8e1ea;
}

.combo-frozen-analysis-meta > div {
  font-size: 0.9rem;
  color: #334155;
}

.combo-frozen-meta-label {
  color: #64748b;
  font-weight: 500;
}

.frozen-global-aggregate {
  margin-bottom: 14px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* ========== TABELLA RECAP (sotto le card informative) ========== */
.frozen-recap {
  margin-top: 12px;
  border-top: 1px dashed #cbd5e1;
  padding-top: 10px;
}
.frozen-recap-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-weight: 600;
  color: #0f172a;
  user-select: none;
}
.frozen-recap-summary::-webkit-details-marker { display: none; }
.frozen-recap-toggle {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.15s;
}
.frozen-recap[open] .frozen-recap-toggle {
  transform: rotate(45deg);
}
.frozen-recap-count {
  color: #64748b;
  font-weight: 500;
  font-size: 0.9em;
}
.frozen-recap-body {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}
.frozen-recap-table-wrap {
  width: auto;
  max-width: 100%;
}
.frozen-recap-table {
  border-collapse: collapse;
  font-size: 13px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #94a3b8;
}
.frozen-recap-table th,
.frozen-recap-table td {
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  text-align: left;
  line-height: 1.3;
}
.frozen-recap-table thead th {
  background: #e2e8f0;
  color: #1f2937;
  font-weight: 700;
  font-size: 12px;
}
.frozen-recap-table td.recap-value,
.frozen-recap-table th.recap-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.frozen-recap-table .recap-kind {
  display: inline-block;
  margin-right: 4px;
  padding: 0 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.frozen-recap-table tfoot tr.frozen-recap-total td {
  background: #f1f5f9;
  font-weight: 700;
  border-top: 2px solid #475569;
}
.frozen-recap-table tr.profit-positive td.recap-value { color: #047857; }
.frozen-recap-table tr.profit-negative td.recap-value { color: #b91c1c; }
.frozen-recap-table .profit-pending { color: #64748b; font-style: italic; }

/* ========== SESSIONI ========== */
.frozen-session-current {
  margin-bottom: 24px;
}
.bookmaker-budget-panel {
  background: #f6fbff;
  border: 1px solid #cfe3f5;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.bookmaker-budget-panel .bb-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bookmaker-budget-panel .bb-label {
  font-weight: 600;
  margin: 0;
  color: #1d3557;
}
.bookmaker-budget-panel .bb-hint {
  font-weight: 400;
  color: #6c757d;
  font-size: 0.85em;
}
.bookmaker-budget-panel .bb-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bookmaker-budget-panel .bb-input {
  max-width: 180px;
}
.bookmaker-budget-panel .bb-status {
  font-size: 0.9em;
  color: #6c757d;
}
.bookmaker-budget-panel .bb-status.bb-ok { color: #198754; }
.bookmaker-budget-panel .bb-status.bb-err { color: #dc3545; }

/* Andamento Economico */
.andamento-economico {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ae-header h2 {
  margin: 0 0 4px 0;
}
.ae-header .ae-sub {
  color: #6c757d;
  font-size: 0.95em;
}
.ae-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.ae-kpi {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.ae-kpi .ae-kpi-label {
  font-size: 0.8em;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ae-kpi .ae-kpi-value {
  font-size: 1.4em;
  font-weight: 700;
  margin-top: 4px;
}
.ae-kpi.ae-pos .ae-kpi-value { color: #198754; }
.ae-kpi.ae-neg .ae-kpi-value { color: #dc3545; }
.ae-chart-card {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.ae-chart-card h3 {
  font-size: 1.05em;
  margin: 0 0 10px 0;
}
.ae-empty {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 10px;
  padding: 14px 16px;
  color: #6d4c00;
}
.ae-scaled-pill {
  display: inline-block;
  font-size: 0.7em;
  font-weight: 600;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  border-radius: 999px;
  padding: 2px 10px;
  vertical-align: middle;
  margin-left: 8px;
}
.frozen-session-current > .frozen-session-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.frozen-session-current > .frozen-session-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #0f172a;
}
.close-session-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.close-session-btn:hover { background: #dc2626; }
.close-session-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}
.frozen-session-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.refresh-all-btn {
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.refresh-all-btn:hover { background: #15803d; }
.refresh-all-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}
.share-session-btn {
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.share-session-btn:hover { background: #0284c7; }
.share-session-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}
.share-archived-session {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.share-archived-session:hover { background: #e2e8f0; }
.frozen-session-empty {
  padding: 20px;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.frozen-sessions-archive {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 2px solid #e2e8f0;
}
.frozen-session-archived {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 10px;
  overflow: hidden;
}
.frozen-session-archived .frozen-session-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.frozen-session-archived .frozen-session-head:hover {
  background: #f1f5f9;
}
.frozen-session-title {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  flex-wrap: wrap;
}
.frozen-session-number {
  font-weight: 700;
  color: #0f172a;
}
.frozen-session-date {
  color: #64748b;
  font-size: 0.9rem;
}
.frozen-session-count {
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.frozen-session-recap b {
  font-size: 1.05rem;
}
.frozen-session-recap.profit-positive b { color: #16a34a; }
.frozen-session-recap.profit-negative b { color: #dc2626; }
.frozen-session-recap.profit-zero b { color: #64748b; }
.frozen-session-toggle {
  font-size: 1.2rem;
  color: #64748b;
  transition: transform 0.2s;
}
.frozen-session-archived.is-open .frozen-session-toggle {
  transform: rotate(180deg);
}
.frozen-session-body {
  display: none;
  padding: 14px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.frozen-session-archived.is-open .frozen-session-body {
  display: block;
}
.frozen-archived-subtitle {
  font-size: 1rem;
  color: #475569;
  margin: 10px 0 6px;
}
.frozen-archived-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.frozen-cashout-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 4px;
}

.combo-bollette-table-wrap {
  overflow-x: auto;
}

.combo-bollette-table {
  width: auto;
  table-layout: auto;
  border-collapse: collapse;
}

.combo-bollette-table th,
.combo-bollette-table td {
  padding: 6px 12px;
  white-space: nowrap;
}

.combo-bollette-table th:not(:first-child),
.combo-bollette-table td:not(:first-child) {
  text-align: right;
}

.combo-bollette-table td:first-child,
.combo-bollette-table th:first-child {
  min-width: 0;
}

.combo-summary-table td.combo-summary-detail,
.combo-summary-table th:last-child {
  text-align: left;
  color: #64748b;
  font-size: 0.85rem;
}

.combo-summary-block {
  margin-bottom: 14px;
}

.combo-row-disabled {
  opacity: 0.55;
}

.combo-empty-state {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
  text-align: center;
  font-weight: 600;
}

.combo-positive { color: #047857; }
.combo-negative { color: #b91c1c; }

/* ===== Bucket Goal Dutching & Target Hedge (shared styles) ===== */
.combo-match-search {
  margin-bottom: 10px;
  max-width: 420px;
}
.bucket-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}
.bucket-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.bucket-controls input[type="number"] {
  width: 130px;
}
.bucket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.bucket-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bucket-cell:hover:not(:disabled) {
  border-color: #10b981;
  background: #ecfdf5;
}
.bucket-cell.is-selected {
  border-color: #059669;
  background: #d1fae5;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15);
}
.bucket-cell.is-disabled,
.bucket-cell:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.bucket-cell-label {
  font-size: 0.92rem;
  font-weight: 700;
}
.bucket-cell-quota {
  font-size: 0.82rem;
  color: #475569;
  font-weight: 600;
}
.bucket-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.bucket-summary-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.bucket-summary-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 600;
}
.bucket-summary-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}
.bucket-summary-value.profit-positive { color: #059669; }
.bucket-summary-value.profit-negative { color: #b91c1c; }
.bucket-stake-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.9rem;
}
.bucket-stake-table th,
.bucket-stake-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}
.bucket-stake-table thead th {
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bucket-stake-table td.profit-positive { color: #059669; font-weight: 700; }

/* Target Hedge market checkboxes */
.target-markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.target-market-chk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}
.target-market-chk:hover {
  border-color: #0ea5e9;
  background: #f0f9ff;
}
.target-market-chk.is-selected {
  border-color: #0284c7;
  background: #e0f2fe;
}
.target-market-chk input[type="checkbox"] {
  margin: 0;
}
.target-market-label {
  flex: 1;
  font-weight: 600;
  color: #0f172a;
}
.target-market-quota {
  font-weight: 700;
  color: #475569;
  font-size: 0.82rem;
}
.target-hedge-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  border-left: 3px solid #0284c7;
  color: #0c4a6e;
  font-size: 0.85rem;
  line-height: 1.45;
}

.report-category-section .pred-table,
.gioca-top-leagues .pred-table,
.gioca-card-block .pred-table,
.gioca-profit-block .pred-table,
.team-trends-category-card .pred-table {
  width: 100%;
  min-width: 100%;
}

.report-category-section .card-body,
.gioca-card-block .card-body,
.gioca-profit-block .card-body,
.gioca-top-leagues .card-body {
  padding: 1rem;
}

.team-trends-filters.card label,
.gioca-controls.card label {
  font-weight: 600;
  color: #374151;
}

.alert.no-results {
  margin-top: 16px;
}

/* ============================================================
   RESPONSIVE – SEZIONE UNIFICATA
   Breakpoint: 900px (tablet), 768px (mobile), 480px (small)
   ============================================================ */

/* ─── TABLET ≤ 900px ─── */
@media (max-width: 900px) {
  .topbar-inner {
    align-items: stretch !important;
  }
  .topbar h1 {
    width: 100%;
    text-align: left;
    white-space: normal;
    font-size: 18px;
  }
  .topbar-auth {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .chrome-cta { margin-left: auto; }
  .whatsapp-cta { order: 2; margin-left: 0; }

  .league-fasce-grid { grid-template-columns: 1fr; }

  .team-trends-panel {
    width: 100%;
    margin-right: 0;
    padding: 16px;
  }
  .team-trends-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .team-trends-filters label {
    min-width: 0;
    flex: 1 1 auto;
  }
  .team-trends-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-header { flex-direction: column; align-items: stretch; }
  .admin-header-actions { flex-direction: column; }
  .admin-system-update { width: 100%; min-width: 0; }

  /* Combinazioni hero collapses */
  .combo-hero {
    grid-template-columns: 1fr;
    padding: 18px 20px;
  }
  .combo-hero-stats { justify-content: flex-start; }
}

/* ─── MOBILE ≤ 768px ─── */
@media (max-width: 768px) {

  /* --- Layout --- */
  main,
  main.full {
    margin-left: 0 !important;
    padding: 0 8px;
  }

  #sidebar {
    width: min(280px, 86vw);
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.18);
  }
  body.app-mobile-sidebar-open { overflow: hidden; }

  /* --- Topbar --- */
  .topbar { padding: 8px 10px; }
  .topbar-inner {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) 40px auto;
    align-items: center !important;
    min-height: 52px;
    column-gap: 8px;
    row-gap: 0;
  }
  .hamburger.btn {
    min-width: 40px;
    min-height: 40px;
    font-size: 21px;
  }
  .dropbtn.btn { padding: 0.4rem 0.75rem; font-size: 0.9rem; }
  .chrome-cta { display: none !important; }
  .topbar-primary { grid-column: 1; grid-row: 1; min-width: 0; }
  .topbar-title-wrap { grid-column: 2; grid-row: 1; min-width: 0; }
  .topbar h1 {
    margin: 0;
    width: auto;
    font-size: 1.05rem;
    line-height: 1.15;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .whatsapp-cta {
    grid-column: 3;
    grid-row: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0;
    box-shadow: none;
    gap: 0;
  }
  .whatsapp-cta-label { display: none; }
  .whatsapp-cta-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }
  .auth-pill {
    padding: 5px 8px;
    font-size: 11px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-auth {
    grid-column: 4;
    grid-row: 1;
    width: auto;
    margin-left: 0;
    gap: 6px;
    justify-content: flex-end;
  }

  /* --- Tabelle generiche --- */
  .table-container {
    width: 100%;
    max-width: 100%;
    margin: 10px 0;
    border-radius: 8px;
  }
  .pred-table {
    font-size: 12px;
  }
  .pred-table th,
  .pred-table td {
    padding: 5px 4px;
    min-width: 42px;
    font-size: 11px;
  }

  /* --- Gioca per me --- */
  .gioca-controls-shell { margin: 10px 4px 14px; }
  .gioca-controls-toggle { padding: 10px 12px; }
  .gioca-controls-shell .gioca-controls { padding: 12px; }
  .gioca-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 10px 0 14px;
    padding: 12px;
  }
  .gioca-controls label,
  .gioca-controls button,
  .gioca-controls select,
  .gioca-controls input[type="number"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .gioca-card-title,
  .gioca-meta,
  .gioca-fasce-summary-title,
  .gioca-info-fascia-card-title {
    line-height: 1.4;
    flex-wrap: wrap;
    font-size: 13px;
  }
  .gioca-table-wrap,
  .gioca-info-fascia-table-wrap,
  .gioca-top-leagues .table-container,
  .gioca-profit-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .gioca-table,
  .gioca-info-fascia-table,
  .gioca-top-leagues-table,
  .gioca-profit-table {
    width: max-content;
    min-width: 100%;
  }
  .gioca-table td,
  .gioca-table th,
  .gioca-info-fascia-table td,
  .gioca-info-fascia-table th,
  .gioca-top-leagues-table td,
  .gioca-top-leagues-table th,
  .gioca-profit-table td,
  .gioca-profit-table th {
    white-space: nowrap;
    font-size: 11px;
    padding: 5px 4px;
  }
  .gioca-table td::before,
  .gioca-info-fascia-table td::before,
  .gioca-top-leagues-table td::before,
  .gioca-profit-table td::before {
    content: none;
  }
  .gioca-table th:nth-child(7),
  .gioca-table td:nth-child(7) {
    white-space: nowrap;
  }
  .gioca-fasce-summary,
  .gioca-info-fasce-grid {
    grid-template-columns: 1fr;
  }

  /* --- Frozen sheets --- */
  .frozen-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .frozen-title {
    font-size: 14px;
    text-align: left;
  }
  .frozen-actions {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
  }
  .frozen-icons {
    flex: 0 0 100%;
    justify-content: flex-end;
    gap: 8px;
  }
  .frozen-meta {
    font-size: 0;
    flex-wrap: wrap;
    gap: 6px;
  }
  .frozen-meta[data-status]::before {
    font-size: 11px;
    padding: 4px 8px;
  }
  .frozen-meta-cards {
    font-size: 11px;
    padding: 4px 8px;
  }
  .frozen-meta-pill {
    font-size: 11px;
    padding: 4px 8px;
  }
  .frozen-profit-pill-pos,
  .frozen-profit-pill-neg,
  .frozen-profit-pill-zero {
    font-size: 11px;
    padding: 4px 10px;
  }
  .frozen-body { padding: 8px; }
  .gioca-section.frozen {
    padding: 10px 8px;
    border-radius: 10px;
  }
  .gioca-section.frozen .gioca-table th:nth-child(1),
  .gioca-section.frozen .gioca-table td:nth-child(1) { min-width: 46px; }
  .gioca-section.frozen .gioca-table th:nth-child(2),
  .gioca-section.frozen .gioca-table td:nth-child(2) { min-width: 64px; }
  .gioca-section.frozen .gioca-table th:nth-child(3),
  .gioca-section.frozen .gioca-table td:nth-child(3) { min-width: 78px; }
  .gioca-section.frozen .gioca-table th:nth-child(4),
  .gioca-section.frozen .gioca-table td:nth-child(4) { min-width: 48px; }
  .gioca-section.frozen .gioca-table th:nth-child(5),
  .gioca-section.frozen .gioca-table td:nth-child(5) { min-width: 56px; }
  .gioca-section.frozen .gioca-table th:nth-child(6),
  .gioca-section.frozen .gioca-table td:nth-child(6) { min-width: 108px; }
  .gioca-section.frozen .gioca-table th:nth-child(7),
  .gioca-section.frozen .gioca-table td:nth-child(7) { min-width: 96px; }
  .gioca-section.frozen .gioca-table th:nth-child(8),
  .gioca-section.frozen .gioca-table td:nth-child(8) { min-width: 96px; }
  .gioca-section.frozen .gioca-table th:nth-child(9),
  .gioca-section.frozen .gioca-table td:nth-child(9) { min-width: 52px; }
  /* Schede Salvate / Bolletta IA — mobile */
  .gioca-section.frozen .bolletta-table th:nth-child(1),
  .gioca-section.frozen .bolletta-table td:nth-child(1) { min-width: 40px; }
  .gioca-section.frozen .bolletta-table th:nth-child(2),
  .gioca-section.frozen .bolletta-table td:nth-child(2) { min-width: 64px; }
  .gioca-section.frozen .bolletta-table th:nth-child(3),
  .gioca-section.frozen .bolletta-table td:nth-child(3) { min-width: 60px; line-height: 1.2; }
  .gioca-section.frozen .bolletta-table th:nth-child(4),
  .gioca-section.frozen .bolletta-table td:nth-child(4) { min-width: 130px; }
  .gioca-section.frozen .bolletta-table th:nth-child(5),
  .gioca-section.frozen .bolletta-table td:nth-child(5) { min-width: 50px; }
  .gioca-section.frozen .bolletta-table th:nth-child(6),
  .gioca-section.frozen .bolletta-table td:nth-child(6) { min-width: 38px; }
  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
  }

  /* --- Profit summary --- */
  .frozen-profit-summary { padding: 12px; }
  .profit-totals {
    gap: 8px;
    flex-wrap: wrap;
  }
  .profit-item {
    min-width: 70px;
    padding: 6px 10px;
    flex: 1 1 calc(50% - 8px);
  }
  .profit-label { font-size: 10px; }
  .profit-value { font-size: 15px; }
  .profit-net { font-size: 17px; }
  .profit-detail-table { font-size: 11px; }
  .profit-detail-table th,
  .profit-detail-table td {
    padding: 4px 6px;
  }
  .profit-detail-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* --- Stats filters --- */
  #statsFilters { padding: 10px; margin: 8px 0; }
  #statsFilters h2 { font-size: 15px; }
  #statsFilters .row { gap: 8px; }
  #statsFilters .d-flex { gap: 4px; }
  #statsFilters .btn {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* --- Report / main-report --- */
  .main-report {
    width: 100%;
    margin: 10px 0;
    padding: 12px;
    border-radius: 10px;
  }

  /* --- AI Chat --- */
  .ai-chat {
    width: calc(100% - 16px);
    height: 65vh;
    right: 8px;
    bottom: 8px;
    left: 8px;
    border-radius: 10px;
  }

  /* --- Televideo --- */
  #televideoFrame {
    width: calc(100vw - 20px);
    height: calc(100vw * 0.72);
    max-width: 720px;
    max-height: 520px;
  }
  #televideoMini { width: 60px; height: 44px; }

  /* --- News ticker --- */
  #newsTicker { font-size: 13px; height: 28px; }

  /* --- Content padding --- */
  .content-panel { padding: 0; }
  section.container-fluid { padding-left: 0; padding-right: 0; }

  /* ── Combinazioni mobile ── */
  .combo-page {
    gap: 12px;
  }
  .combo-result-block,
  .combo-picker-card,
  .combo-context-card {
    padding: 14px;
    border-radius: 14px;
  }
  .combo-hero {
    padding: 16px;
    border-radius: 14px;
  }
  .combo-hero h2 { font-size: 1.3rem; }
  .combo-hero .subtitle { font-size: 0.88rem; }
  .combo-hero-stats {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .combo-hero-stat { min-width: 0; padding: 10px; }
  .combo-hero-stat-value { font-size: 1.3rem; }

  .combo-picker-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .combo-picker-search-wrap {
    max-width: 100%;
  }

  /* On mobile: keep the custom clickable list (native <select> is visually ugly)
     and tighten tap targets + layout so it feels native on small screens. */
  .combo-match-select {
    display: none;
  }
  .combo-match-list {
    display: block;
    max-height: 58vh;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .combo-match-list > * + * {
    margin-top: 8px;
  }
  .combo-match-group {
    border-radius: 14px;
  }
  .combo-match-group-summary {
    padding: 12px 14px;
    gap: 10px;
  }
  .combo-match-group-summary::before {
    width: 26px;
    height: 26px;
    font-size: 17px;
  }
  .combo-match-group-label {
    font-size: 12px;
    letter-spacing: 0.03em;
  }
  .combo-match-group-count {
    font-size: 11px;
    padding: 3px 8px;
  }
  .combo-match-group-items {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 10px 12px;
  }
  .combo-match-item {
    padding: 12px 14px;
    min-height: 58px;
    border-radius: 12px;
    gap: 6px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  .combo-match-item:hover,
  .combo-match-item:focus-visible {
    transform: none;
  }
  .combo-match-item:active {
    transform: scale(0.99);
    background: #f0fdf4;
  }
  .combo-match-item-teams {
    font-size: 14px;
    width: 100%;
    justify-content: flex-start;
  }
  .combo-match-item-teams strong {
    font-weight: 800;
  }
  .combo-match-item-meta {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 700;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 999px;
    align-self: flex-start;
  }
  .combo-match-item-metas {
    flex-wrap: wrap;
    gap: 5px;
  }
  .combo-match-item-league {
    max-width: 100%;
    font-size: 10.5px;
    padding: 3px 7px;
  }

  /* Mobile grouping toggle stretches full width for easier tapping */
  .combo-picker-grouping {
    display: flex;
    width: 100%;
  }
  .combo-grouping-btn {
    flex: 1;
    padding: 9px 12px;
    font-size: 12px;
  }

  .combo-context-main {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .combo-context-teams {
    font-size: 1.05rem;
  }
  .combo-context-actions {
    justify-content: space-between;
  }
  .combo-budget-inline {
    flex: 1 1 auto;
  }
  .combo-budget-inline input {
    width: 100%;
    min-width: 0;
  }
  .combo-primary-btn {
    flex: 0 0 auto;
    padding: 10px 16px;
  }

  .combo-suggestion-grid {
    grid-template-columns: 1fr;
  }
  .combo-suggestion-card {
    padding: 12px 14px;
  }
  .combo-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .combo-score-summary-grid {
    grid-template-columns: 1fr;
  }
  .combo-selected-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .combo-bookmaker-summary {
    padding: 12px 14px;
  }
  .combo-bookmaker-body {
    padding: 6px 12px 14px;
  }

  /* --- League filter chips --- */
  #leagueFilterContainer {
    gap: 4px;
    padding: 6px;
  }
  #leagueFilterContainer label {
    font-size: 11px;
    padding: 4px 6px;
  }
}

/* ─── SMALL MOBILE ≤ 480px ─── */
@media (max-width: 480px) {

  .topbar { padding: 6px 8px; }
  .topbar-inner { min-height: 46px; column-gap: 6px; }
  .topbar h1 { font-size: 0.95rem; }
  .auth-pill { font-size: 10px; max-width: 90px; padding: 4px 6px; }

  /* Tabelle: scroll forzato con min-width */
  .pred-table th,
  .pred-table td {
    padding: 4px 3px;
    min-width: 36px;
    font-size: 10px;
  }
  .gioca-table,
  .gioca-info-fascia-table,
  .gioca-top-leagues-table,
  .gioca-profit-table {
    min-width: 580px;
  }

  /* Frozen header ultra-compact */
  .frozen-header { padding: 8px 10px; }
  .frozen-title { font-size: 13px; }
  .frozen-meta[data-status]::before { font-size: 10px; padding: 3px 6px; }
  .frozen-meta-cards { font-size: 10px; padding: 3px 6px; }

  /* Profit items: 2 per riga */
  .profit-item {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    padding: 5px 8px;
  }
  .profit-value { font-size: 14px; }
  .profit-label { font-size: 9px; }

  /* Gioca controls */
  .gioca-controls { padding: 10px; gap: 8px; }
  .gioca-section.frozen { padding: 8px 6px; }

  /* Sidebar slightly narrower */
  #sidebar { width: min(260px, 82vw); }

  /* Team trends */
  .team-trends-table {
    min-width: 500px;
  }

  /* Combinazioni extra-small */
  .combo-hero { padding: 14px; }
  .combo-hero h2 { font-size: 1.18rem; }
  .combo-hero .subtitle { font-size: 0.82rem; }
  .combo-hero-stat-value { font-size: 1.15rem; }
  .combo-hero-stat-label { font-size: 10px; }
  .combo-summary-grid { grid-template-columns: 1fr; }
  .combo-selected-grid { grid-template-columns: 1fr; }
  .combo-context-teams { font-size: 0.98rem; }
  .combo-suggestion-profit { font-size: 0.92rem; }
  .combo-suggestion-label { font-size: 0.9rem; }
  .combo-picker-card,
  .combo-result-block,
  .combo-context-card { padding: 12px; border-radius: 12px; }
}

/* ─── EXTRA SMALL ≤ 360px ─── */
@media (max-width: 360px) {
  .topbar h1 { font-size: 0.85rem; }
  .auth-pill { max-width: 70px; font-size: 9px; }
  #sidebar { width: min(240px, 80vw); }

  .profit-item { padding: 4px 6px; }
  .profit-value { font-size: 13px; }

  .frozen-title { font-size: 12px; }
  .frozen-meta[data-status]::before { font-size: 9px; }
}

/* ============================================================
   La Macchia — value-bet scanner (sezione isolata)
   ============================================================ */
.macchia-block {
  background: #ffffff;
  border: 1px solid #e5ebf0;
  border-radius: 14px;
  padding: 18px;
  margin: 12px 0 24px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.macchia-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.macchia-head h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.macchia-subtitle {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
  max-width: 720px;
}

.macchia-subtitle code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #0f172a;
}

.macchia-quota-chip {
  font-weight: 800;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.macchia-quota-chip.is-ok { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.macchia-quota-chip.is-blocked { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }

.macchia-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin: 12px 0;
}

.macchia-filters label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.macchia-hint-inline {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
  font-size: 10px;
}

.macchia-filters input {
  width: 96px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
}
.macchia-filters input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.macchia-run-btn {
  padding: 9px 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}
.macchia-run-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3); }
.macchia-run-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.macchia-reset-btn,
.qt-reset-btn {
  padding: 9px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}
.macchia-reset-btn:hover,
.qt-reset-btn:hover { background: #e2e8f0; border-color: #94a3b8; color: #1e293b; }

.macchia-status { margin: 8px 0 10px; }

.macchia-hint {
  padding: 10px 14px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
}
.macchia-hint.is-error { background: #fee2e2; color: #7f1d1d; }
.macchia-hint.is-blocked { background: #fef3c7; color: #78350f; border: 1px solid #fde68a; }
.macchia-hint a { color: #0284c7; font-weight: 700; }

.macchia-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  color: #075985;
  font-weight: 600;
}

.macchia-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #bae6fd;
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: macchia-spin 0.8s linear infinite;
}
@keyframes macchia-spin { to { transform: rotate(360deg); } }

.macchia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.macchia-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 12px;
  border: 1px solid #e5ebf0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}
.macchia-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); border-color: #cbd5e1; }
.macchia-card.is-big { border-color: #86efac; background: linear-gradient(180deg, rgba(34,197,94,0.06), #ffffff); }
.macchia-card.is-huge {
  border-color: #22c55e;
  background: linear-gradient(180deg, rgba(34,197,94,0.13), #ffffff);
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.2);
}

.macchia-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.macchia-rank {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.05em;
}

.macchia-ev-badge {
  font-weight: 800;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
}

.macchia-teams {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #0f172a;
}
.macchia-teams strong { font-weight: 800; }
.macchia-vs { color: #94a3b8; font-size: 11px; text-transform: uppercase; }

.macchia-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
}
.macchia-league {
  background: #dcfce7;
  color: #14532d;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}
.macchia-when { color: #475569; font-weight: 600; }

.macchia-pick-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  margin-top: 4px;
}
.macchia-pick { font-weight: 800; color: #0f172a; font-size: 14px; }
.macchia-quota { font-weight: 800; color: #047857; font-size: 16px; font-variant-numeric: tabular-nums; }

.macchia-bookmaker {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: capitalize;
}

.macchia-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.macchia-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.macchia-chip.is-edge { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }
.macchia-chip.is-kelly { background: #fef3c7; color: #78350f; border-color: #fde68a; }

.macchia-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .macchia-grid { grid-template-columns: 1fr; }
  .macchia-filters input { width: 80px; }
  .macchia-filters { gap: 8px 10px; }
  .macchia-head h2 { font-size: 1.15rem; }
}

/* === Gioca per me — restyling totale === */
.gioca-page-v2 {
  --gpv-text: #0f172a;
  --gpv-muted: #64748b;
  --gpv-border: #e2e8f0;
  --gpv-soft: #f1f5f9;
  --gpv-card: #ffffff;
  --gpv-accent: #6366f1;
  --gpv-accent-2: #10b981;
  --gpv-shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.04);
  --gpv-shadow-md: 0 1px 3px rgba(15,23,42,0.05), 0 8px 24px rgba(15,23,42,0.06);
  --gpv-shadow-hover: 0 4px 12px rgba(15,23,42,0.08), 0 16px 32px rgba(15,23,42,0.08);

  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px 0 24px;
}

/* — Hero del titolo — */
.gioca-page-v2 .gioca-page-title {
  margin: 0;
  padding: 26px 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(99,102,241,0.30), transparent 55%),
    radial-gradient(circle at 92% 110%, rgba(16,185,129,0.32), transparent 55%),
    linear-gradient(135deg, #0b1224 0%, #1e293b 60%, #0f172a 110%);
  color: #f8fafc;
  border-radius: 20px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 10px 32px rgba(15,23,42,0.20);
}

/* — Pannello Filtri schedina (shell) — */
.gioca-page-v2 .gioca-controls-shell {
  margin: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  border: 1px solid var(--gpv-border) !important;
  border-radius: 18px !important;
  background: var(--gpv-card) !important;
  box-shadow: var(--gpv-shadow-md) !important;
  overflow: hidden;
}
.gioca-page-v2 .gioca-controls-toggle {
  background: linear-gradient(180deg, #fafbff 0%, #eef2f7 100%);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--gpv-text);
  padding: 14px 20px;
  border-bottom: 1px solid var(--gpv-border);
}
.gioca-page-v2 .gioca-controls-toggle-meta {
  background: rgba(99,102,241,0.10);
  color: #4f46e5;
  border: 1px solid rgba(99,102,241,0.20);
  font-weight: 700;
}
.gioca-page-v2 .gioca-controls {
  padding: 16px 18px;
  gap: 12px;
  background: var(--gpv-card);
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important;
  grid-template-columns: none !important;
}
.gioca-page-v2 .gioca-controls > * {
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
}
.gioca-page-v2 .gioca-controls-groups {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.1fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 12px;
  width: 100%;
}
@media (max-width: 1100px) {
  .gioca-page-v2 .gioca-controls-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .gioca-page-v2 .gioca-controls-groups {
    grid-template-columns: 1fr;
  }
}

/* — Desktop/tablet ≥721px: layout flat orizzontale, tutti i campi nella stessa griglia — */
@media (min-width: 721px) {
  .gioca-page-v2 .gioca-controls {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    grid-auto-rows: auto;
    gap: 10px 12px !important;
    align-items: end !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }
  .gioca-page-v2 .gioca-controls-groups,
  .gioca-page-v2 .gioca-controls-group,
  .gioca-page-v2 .gioca-controls-group-grid {
    display: contents !important;
  }
  .gioca-page-v2 .gioca-controls-group {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .gioca-page-v2 .gioca-controls-group-title {
    display: none !important;
  }
  .gioca-page-v2 .gioca-controls-group-grid > label {
    grid-column: span 1;
    align-self: end;
    min-width: 0;
    max-width: none;
    flex: initial;
    margin: 0;
  }
  .gioca-page-v2 .gioca-controls-group-grid > label > span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .gioca-page-v2 .gioca-controls-group-grid > label > input,
  .gioca-page-v2 .gioca-controls-group-grid > label > select {
    width: 100%;
    min-width: 0;
    height: 38px;
    margin: 0;
  }
  .gioca-page-v2 .gioca-controls > .gioca-controls-note,
  .gioca-page-v2 .gioca-controls > .gioca-controls-actions {
    grid-column: 1 / -1;
  }
}
/* Tablet 901-1100px: 4 colonne (8 fields su 2 righe) */
@media (min-width: 901px) and (max-width: 1100px) {
  .gioca-page-v2 .gioca-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
/* Tablet stretto 721-900px: 3 colonne */
@media (min-width: 721px) and (max-width: 900px) {
  .gioca-page-v2 .gioca-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
.gioca-page-v2 .gioca-controls-group {
  border: 1px solid var(--gpv-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fcfdff 0%, #f6f8fc 100%);
  padding: 12px 14px 14px;
  margin: 0;
  display: block;
  position: relative;
}
.gioca-page-v2 .gioca-controls-group-title {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--gpv-accent);
  background: #fff;
  border: 1px solid var(--gpv-border);
  border-radius: 999px;
  line-height: 1.4;
}
.gioca-page-v2 .gioca-controls-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 14px;
  width: 100%;
}
.gioca-page-v2 .gioca-controls-group-grid > label {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--gpv-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 0;
  width: 100%;
}
.gioca-page-v2 .gioca-controls-group-grid > label > span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gioca-page-v2 .gioca-controls-group-grid > label > input,
.gioca-page-v2 .gioca-controls-group-grid > label > select {
  height: 38px;
  padding: 0 10px;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--gpv-text);
  text-transform: none;
  letter-spacing: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gioca-page-v2 .gioca-controls-group-grid > label > input:focus,
.gioca-page-v2 .gioca-controls-group-grid > label > select:focus {
  outline: none;
  border-color: var(--gpv-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Riga azioni: CTA primario "Genera" grande, gli altri secondari piu' piccoli */
.gioca-page-v2 .gioca-controls-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-top: 6px;
}
.gioca-page-v2 .gioca-controls-actions .gioca-controls-cta {
  flex: 1 1 240px;
  min-height: 46px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gpv-accent-2) 0%, #059669 100%);
  color: #fff;
  border: none;
  box-shadow: 0 6px 16px rgba(16,185,129,0.30);
  cursor: pointer;
  letter-spacing: 0.02em;
  margin: 0;
}
.gioca-page-v2 .gioca-controls-actions .gioca-controls-cta:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
.gioca-page-v2 .gioca-controls-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 320px;
}
.gioca-page-v2 .gioca-controls-actions-secondary .run-btn {
  flex: 1 1 calc(50% - 4px);
  background: #fff;
  color: var(--gpv-text);
  border: 1px solid var(--gpv-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
  min-height: 38px;
  margin: 0;
}
.gioca-page-v2 .gioca-controls-actions-secondary .run-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

@media (max-width: 768px) {
  .gioca-page-v2 .gioca-controls {
    padding: 12px;
    gap: 10px;
  }
  .gioca-page-v2 .gioca-controls-group {
    padding: 10px 12px 12px;
  }
  .gioca-page-v2 .gioca-controls-group-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .gioca-page-v2 .gioca-controls-actions .gioca-controls-cta {
    flex: 1 1 100%;
  }
  .gioca-page-v2 .gioca-controls-actions-secondary {
    flex: 1 1 100%;
  }
  .gioca-page-v2 .gioca-controls-actions-secondary .run-btn {
    flex: 1 1 calc(50% - 4px);
    font-size: 12.5px;
    padding: 8px 6px;
  }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .gioca-page-v2 .gioca-controls-group-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}
.gioca-page-v2 .gioca-controls > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--gpv-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gioca-page-v2 .gioca-controls > label > input,
.gioca-page-v2 .gioca-controls > label > select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--gpv-text);
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gioca-page-v2 .gioca-controls > label > input:focus,
.gioca-page-v2 .gioca-controls > label > select:focus {
  outline: none;
  border-color: var(--gpv-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.gioca-page-v2 .gioca-controls-note {
  flex-basis: 100%;
  margin-top: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(99,102,241,0.06);
  border: 1px dashed rgba(99,102,241,0.25);
  color: #4f46e5;
  font-size: 12.5px;
}
.gioca-page-v2 .gioca-controls #giocaGenerate {
  background: linear-gradient(135deg, var(--gpv-accent-2) 0%, #059669 100%);
  box-shadow: 0 6px 16px rgba(16,185,129,0.30);
}
.gioca-page-v2 .gioca-controls #giocaGenerate:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* — Status row (Raggruppamento, Match depennati) — */
.gioca-page-v2 .gioca-selection-summary {
  margin: 0 !important;
  padding: 12px 16px !important;
  border: 1px solid var(--gpv-border) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5ff 100%) !important;
  box-shadow: var(--gpv-shadow-sm);
  width: auto !important;
  max-width: 100% !important;
  font-size: 13px;
  color: var(--gpv-text);
}
.gioca-page-v2 .gioca-selection-summary b {
  color: var(--gpv-accent);
}
.gioca-page-v2 .gioca-league-exclude {
  margin: 0 !important;
  padding: 12px 16px !important;
  border: 1px solid #fbe9b6 !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #fffaf0 0%, #fff5e0 100%) !important;
  box-shadow: var(--gpv-shadow-sm);
  width: auto !important;
  max-width: 100% !important;
}

/* — Sezione mercato (Over 1.5, Over 2.5, ecc.) — */
.gioca-page-v2 .gioca-section:not(.frozen) {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--gpv-border);
  border-top: 1px solid var(--gpv-border);
  border-radius: 20px;
  background: var(--gpv-card);
  box-shadow: var(--gpv-shadow-md);
  position: relative;
  overflow: hidden;
  width: auto;
  max-width: 100%;
}
.gioca-page-v2 .gioca-section:not(.frozen)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gpv-accent) 0%, var(--gpv-accent-2) 100%);
}
.gioca-page-v2 .gioca-section:not(.frozen) > h3 {
  margin: 0 0 14px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--gpv-text);
}
.gioca-page-v2 .gioca-section:not(.frozen) > .gioca-meta {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--gpv-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fafbff 0%, #f4f6fb 100%);
  color: var(--gpv-text);
  font-size: 13px;
  line-height: 1.6;
  width: fit-content;
  max-width: min(640px, 100%);
}
.gioca-page-v2 .gioca-section:not(.frozen) > .gioca-meta b {
  color: var(--gpv-accent);
  font-weight: 700;
}

/* — Card singola scheda — */
.gioca-page-v2 .gioca-card-block {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--gpv-border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: var(--gpv-shadow-sm);
  transition: transform 0.15s, box-shadow 0.2s;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.gioca-page-v2 .gioca-card-block:hover {
  box-shadow: var(--gpv-shadow-hover);
  transform: translateY(-1px);
}
.gioca-page-v2 .gioca-card-block .gioca-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(99,102,241,0.08) 0%, rgba(16,185,129,0.06) 100%);
  border-left: 3px solid var(--gpv-accent);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gpv-text);
}
.gioca-page-v2 .gioca-card-block .gioca-card-title b {
  color: var(--gpv-accent-2);
}

/* Toggle apri/chiudi card scheda — attivo sia su desktop che mobile */
.gioca-card-toggle {
  cursor: pointer;
  user-select: none;
}
.gioca-card-toggle .gioca-card-title-content {
  flex: 1 1 auto;
  display: inline;
}
.gioca-card-toggle .gioca-card-chevron {
  display: inline-block;
  margin-left: auto;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--gpv-accent, #6366f1);
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}
.gioca-card-block.is-collapsed .gioca-card-chevron {
  transform: rotate(-90deg);
}
.gioca-card-block.is-collapsed > .gioca-table-wrap {
  display: none;
}
.gioca-card-block.is-collapsed .gioca-card-title {
  margin-bottom: 0;
}

/* — Tabella schede dentro le card — */
.gioca-page-v2 .gioca-card-block .gioca-table-wrap {
  margin-top: 0;
}
.gioca-page-v2 .gioca-card-block .gioca-table-wrap:has(.gioca-table-narrow) {
  margin-right: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.gioca-page-v2 .gioca-table.gioca-table-narrow {
  border: 1px solid var(--gpv-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.gioca-page-v2 .gioca-table.gioca-table-narrow thead th {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gpv-muted);
  padding: 10px 8px;
  border-bottom: 1px solid var(--gpv-border);
}
.gioca-page-v2 .gioca-table.gioca-table-narrow tbody tr {
  transition: background 0.1s;
}
.gioca-page-v2 .gioca-table.gioca-table-narrow tbody tr + tr td {
  border-top: 1px solid #f1f5f9;
}
.gioca-page-v2 .gioca-table.gioca-table-narrow tbody tr:hover {
  background: rgba(99,102,241,0.035);
}
.gioca-page-v2 .gioca-table.gioca-table-narrow .gioca-conf-pill.is-high {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: #fff;
  box-shadow: 0 1px 3px rgba(16,185,129,0.30);
}

/* — Profit breakdown (se presente) — */
.gioca-page-v2 .gioca-profit-breakdown {
  margin: 0 0 16px;
  border-radius: 14px;
  border: 1px solid var(--gpv-border);
  box-shadow: var(--gpv-shadow-sm);
}

/* — Mobile responsive — */
@media (max-width: 768px) {
  .gioca-page-v2 {
    gap: 12px;
    padding: 0 0 16px;
  }
  .gioca-page-v2 .gioca-page-title {
    padding: 18px 18px;
    border-radius: 16px;
    font-size: 1.25rem;
    letter-spacing: -0.015em;
  }
  .gioca-page-v2 .gioca-controls-shell {
    border-radius: 14px !important;
  }
  .gioca-page-v2 .gioca-controls-toggle {
    padding: 12px 14px;
    font-size: 13px;
  }
  .gioca-page-v2 .gioca-controls {
    padding: 14px !important;
    gap: 12px !important;
    grid-template-columns: 1fr 1fr;
  }
  .gioca-page-v2 .gioca-controls > label {
    font-size: 10px;
  }
  .gioca-page-v2 .gioca-controls > label > input,
  .gioca-page-v2 .gioca-controls > label > select {
    height: 38px;
    font-size: 13px;
  }
  .gioca-page-v2 .gioca-controls .gioca-controls-note,
  .gioca-page-v2 .gioca-controls button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .gioca-page-v2 .gioca-selection-summary,
  .gioca-page-v2 .gioca-league-exclude {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    font-size: 12.5px;
  }
  .gioca-page-v2 .gioca-section:not(.frozen) {
    padding: 16px 14px;
    border-radius: 16px;
  }
  .gioca-page-v2 .gioca-section:not(.frozen) > h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
  }
  .gioca-page-v2 .gioca-section:not(.frozen) > .gioca-meta {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 10px;
  }
  .gioca-page-v2 .gioca-card-block {
    margin-top: 12px;
    padding: 12px 12px;
    border-radius: 14px;
    width: 100%;
    max-width: 100%;
  }
  .gioca-page-v2 .gioca-card-block:hover {
    transform: none;
  }
  .gioca-page-v2 .gioca-card-block .gioca-card-title {
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    gap: 8px;
    border-radius: 10px;
  }
  .gioca-page-v2 .gioca-card-block .gioca-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .gioca-page-v2 .gioca-table.gioca-table-narrow {
    font-size: 11.5px;
  }
  .gioca-page-v2 .gioca-table.gioca-table-narrow thead th {
    font-size: 9.5px;
    padding: 8px 6px;
  }
  .gioca-page-v2 .gioca-table.gioca-table-narrow th,
  .gioca-page-v2 .gioca-table.gioca-table-narrow td {
    padding: 6px 6px;
  }
  .gioca-page-v2 .gioca-table.gioca-table-narrow .gioca-cell-when {
    width: auto;
    min-width: 90px;
  }
  .gioca-page-v2 .gioca-table.gioca-table-narrow .gioca-cell-league {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .gioca-page-v2 .gioca-page-title {
    padding: 16px 16px;
    font-size: 1.15rem;
  }
  .gioca-page-v2 .gioca-controls {
    grid-template-columns: 1fr;
  }
  .gioca-page-v2 .gioca-section:not(.frozen) {
    padding: 14px 12px;
  }
  .gioca-page-v2 .gioca-card-block .gioca-card-title {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}

/* === Gioca per me — variante compatta (gioca-table-narrow) === */
.gioca-table.gioca-table-narrow {
  font-size: 12.5px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.gioca-table-wrap:has(.gioca-table-narrow) {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-right: auto;
  background: transparent;
  border: none;
  border-radius: 0;
}
.gioca-table.gioca-table-narrow th,
.gioca-table.gioca-table-narrow td {
  padding: 6px 8px;
  vertical-align: middle;
}
.gioca-table.gioca-table-narrow .gioca-cell-when {
  white-space: nowrap;
  text-align: center;
  line-height: 1.25;
}
.gioca-table.gioca-table-narrow .gioca-cell-matchday-col {
  text-align: center;
  white-space: nowrap;
  width: 64px;
}
.gioca-table.gioca-table-narrow .gioca-cell-matchday {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
}
.gioca-table.gioca-table-narrow .gioca-match-teams {
  white-space: nowrap;
  line-height: 1.3;
}
.gioca-table.gioca-table-narrow .gioca-cell-league {
  white-space: nowrap;
  font-size: 12px;
  color: #334155;
  width: 1%;
  text-align: left;
  padding-left: 12px;
}
.gioca-table.gioca-table-narrow .gioca-league-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gioca-table.gioca-table-narrow .gioca-cell-quota {
  font-weight: 700;
  cursor: help;
  text-decoration: underline dotted #94a3b8;
  text-underline-offset: 3px;
  width: 56px;
  text-align: center;
  white-space: nowrap;
}
.gioca-table.gioca-table-narrow .gioca-cell-conf {
  width: 70px;
  text-align: center;
  background: transparent !important;
  color: inherit !important;
}
.gioca-table.gioca-table-narrow .gioca-conf-pill {
  display: inline-block;
  min-width: 52px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11.5px;
  background: #f1f5f9;
  color: #334155;
}
.gioca-table.gioca-table-narrow .gioca-conf-pill.is-high {
  background: #00ff88;
  color: #052e16;
}
.gioca-table.gioca-table-narrow th:first-child,
.gioca-table.gioca-table-narrow td:first-child {
  width: 36px;
  text-align: center;
}
.gioca-table.gioca-table-narrow th:last-child,
.gioca-table.gioca-table-narrow td:last-child {
  width: 80px;
  text-align: center;
  white-space: nowrap;
}
.gioca-table.gioca-table-narrow .gioca-cell-when {
  width: 96px;
}
.gioca-table.gioca-table-narrow .gioca-cell-match {
  width: auto;
}

/* === Gioca per me — schede in card layout su mobile (solo gioca-table-narrow) === */
@media (max-width: 768px) {
  /* Annulla lo scroll orizzontale solo per le tabelle schede generate */
  .gioca-table-wrap:has(.gioca-table-narrow) {
    overflow: visible;
    border: none;
    background: transparent;
  }
  .gioca-table.gioca-table-narrow,
  .gioca-table.gioca-table-narrow tbody,
  .gioca-table.gioca-table-narrow tr,
  .gioca-table.gioca-table-narrow td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .gioca-table.gioca-table-narrow {
    font-size: 13px;
  }
  .gioca-table.gioca-table-narrow thead {
    display: none;
  }
  .gioca-table.gioca-table-narrow tbody tr {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 10px;
    row-gap: 6px;
  }
  .gioca-table.gioca-table-narrow tbody tr:hover {
    background: #fff;
  }
  .gioca-table.gioca-table-narrow tbody tr + tr td {
    border-top: none;
  }
  .gioca-table.gioca-table-narrow td {
    border: none;
    padding: 0;
    text-align: left;
    white-space: normal;
    width: auto;
    min-height: 0;
    line-height: 1.3;
  }
  /* Etichetta inline da data-label per ogni cella */
  .gioca-table.gioca-table-narrow td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 2px;
  }
  /* Match: full-width in cima, niente label, font più grande */
  .gioca-table.gioca-table-narrow td.gioca-cell-match {
    grid-column: 1 / -1;
    order: -1;
    padding-right: 36px; /* spazio per il cestino */
    margin-bottom: 2px;
  }
  .gioca-table.gioca-table-narrow td.gioca-cell-match::before {
    content: none;
  }
  .gioca-table.gioca-table-narrow td.gioca-cell-match .gioca-match-teams {
    white-space: normal;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
  }
  /* Lega: full-width sotto al match come riga meta */
  .gioca-table.gioca-table-narrow td.gioca-cell-league {
    grid-column: 1 / -1;
    padding-left: 0;
    color: #475569;
    font-size: 12px;
  }
  .gioca-table.gioca-table-narrow td.gioca-cell-league::before {
    content: none;
  }
  .gioca-table.gioca-table-narrow td.gioca-cell-league .gioca-league-inline {
    color: #475569;
  }
  /* Quando + Giornata: due colonne in una riga compatta */
  .gioca-table.gioca-table-narrow td.gioca-cell-when,
  .gioca-table.gioca-table-narrow td.gioca-cell-matchday-col {
    text-align: left;
    white-space: normal;
    font-size: 12.5px;
  }
  .gioca-table.gioca-table-narrow td.gioca-cell-when {
    width: auto;
  }
  /* Cestino: chip in alto a destra */
  .gioca-table.gioca-table-narrow tbody tr > td:first-child {
    position: absolute;
    top: 8px;
    right: 8px;
    width: auto;
    padding: 0;
    margin: 0;
  }
  .gioca-table.gioca-table-narrow tbody tr > td:first-child::before {
    content: none;
  }
  .gioca-table.gioca-table-narrow .gioca-exclude-match-btn {
    padding: 6px 9px;
    font-size: 14px;
    line-height: 1;
    border-radius: 8px;
  }
  /* Confidenza / Quota / Fascia: riga di chip compatti */
  .gioca-table.gioca-table-narrow td.gioca-cell-conf,
  .gioca-table.gioca-table-narrow td.gioca-cell-quota,
  .gioca-table.gioca-table-narrow tbody tr > td:last-child {
    width: auto;
    text-align: left;
    font-size: 12.5px;
  }
  /* Confidenza, Quota e Fascia sulla stessa riga: split in 3 colonne. */
  .gioca-table.gioca-table-narrow td.gioca-cell-conf,
  .gioca-table.gioca-table-narrow td.gioca-cell-quota,
  .gioca-table.gioca-table-narrow tbody tr > td:last-child {
    grid-column: span 2; /* default in griglia 6-col */
  }
  .gioca-table.gioca-table-narrow tbody tr {
    grid-template-columns: repeat(6, 1fr);
  }
  .gioca-table.gioca-table-narrow td.gioca-cell-match,
  .gioca-table.gioca-table-narrow td.gioca-cell-league {
    grid-column: 1 / -1;
  }
  .gioca-table.gioca-table-narrow td.gioca-cell-when {
    grid-column: span 3;
  }
  .gioca-table.gioca-table-narrow td.gioca-cell-matchday-col {
    grid-column: span 3;
  }
  .gioca-table.gioca-table-narrow .gioca-conf-pill {
    min-width: 0;
  }
  /* Riga depennata: la trasformiamo in card barrata */
  .gioca-table.gioca-table-narrow tr.gioca-excluded-row {
    opacity: 0.6;
  }
  .gioca-table.gioca-table-narrow tr.gioca-excluded-row td {
    text-decoration: none;
  }
  .gioca-table.gioca-table-narrow tr.gioca-excluded-row .gioca-match-teams {
    text-decoration: line-through;
  }
}

/* La Macchia — toggle "Modello puro (pre-blend)" */
.macchia-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 12px !important;
  color: #9a3412 !important;
}
.macchia-toggle input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: #ea580c;
  cursor: pointer;
}
.macchia-toggle small { color: #c2410c; font-weight: 500; }

.macchia-chip.is-raw {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

/* === Stat. Combinazioni === */
.stat-comb-page { padding: 16px; }
.stat-comb-summary {
  display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 20px;
}
.stat-comb-card {
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 10px 14px; min-width: 110px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.stat-comb-card-val { font-size: 1.25rem; font-weight: 600; color: #111827; }
.stat-comb-card-lbl { font-size: 0.8rem; color: #6b7280; }
.stat-comb-net-pos { color: #059669; }
.stat-comb-net-neg { color: #dc2626; }
.stat-comb-table-wrap { overflow-x: auto; }
.stat-comb-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.stat-comb-table th, .stat-comb-table td {
  padding: 8px 10px; border-bottom: 1px solid #e5e7eb; text-align: left;
}
.stat-comb-table thead th {
  background: #f3f4f6; font-weight: 600; color: #374151;
  position: sticky; top: 0;
}
.stat-comb-table tbody tr:hover { background: #fafafa; }
.stat-comb-status-win { color: #059669; font-weight: 600; text-transform: uppercase; }
.stat-comb-status-lose { color: #dc2626; font-weight: 600; text-transform: uppercase; }
.stat-comb-status-draw { color: #6b7280; font-weight: 600; text-transform: uppercase; }
.stat-comb-status-void { color: #9ca3af; font-weight: 600; text-transform: uppercase; }
.stat-comb-status-pending { color: #6b7280; font-weight: 600; text-transform: uppercase; }
.sc-row-subline {
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 2px;
  line-height: 1.3;
}
.stat-comb-ok { color: #059669; font-weight: 700; font-size: 1.1rem; }
.stat-comb-ko { color: #dc2626; font-weight: 700; font-size: 1.1rem; }

/* === Stat. Combinazioni — accordion mesi === */
.stat-comb-months { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.stat-comb-month { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: #fff; }
.stat-comb-month-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; background: #f9fafb; border: none;
  cursor: pointer; font-size: 0.95rem; color: #111827; text-align: left;
}
.stat-comb-month-head:hover { background: #f3f4f6; }
.stat-comb-month-title { font-weight: 600; }
.stat-comb-month-meta { display: flex; gap: 12px; color: #6b7280; font-size: 0.85rem; flex: 1; justify-content: flex-end; }
.stat-comb-month-chev { transition: transform 0.15s; color: #6b7280; }
.stat-comb-month.is-open .stat-comb-month-chev { transform: rotate(180deg); }
.stat-comb-month-body { padding: 12px 16px; border-top: 1px solid #e5e7eb; background: #fff; }
.stat-comb-month-loading { padding: 12px 0; color: #6b7280; }
.stat-comb-group { margin-bottom: 16px; }
.stat-comb-group-title { margin: 0 0 8px; font-size: 0.95rem; color: #374151; }

/* === Stat. Combinazioni — snapshot status pills === */
.stat-comb-status-overlap { color: #2563eb; font-weight: 600; text-transform: uppercase; }
.stat-comb-status-scoperto { color: #d97706; font-weight: 600; text-transform: uppercase; }
.stat-comb-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; line-height: 1.4;
  border: 1px solid transparent; white-space: nowrap;
}
.stat-comb-pill-win { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.stat-comb-pill-overlap { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.stat-comb-pill-scoperto { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.stat-comb-pill-lose { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.stat-comb-pill-void { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }
.stat-comb-ai-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  background: #ede9fe; color: #5b21b6; font-size: 0.7rem; font-weight: 700;
  vertical-align: middle;
}

/* === Stat. Combinazioni v2 — legenda, header mesi, summary, tabella === */

/* Legenda in cima alla pagina */
.sc-legend {
  display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 8px 0 16px;
  padding: 10px 14px; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 8px; font-size: 0.82rem; color: #374151;
}
.sc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.sc-legend-item b { font-weight: 600; color: #111827; }
.sc-legend-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid transparent;
}
.sc-legend-win .sc-legend-dot { background: #10b981; border-color: #065f46; }
.sc-legend-overlap .sc-legend-dot { background: #3b82f6; border-color: #1e3a8a; }
.sc-legend-scoperto .sc-legend-dot { background: #f59e0b; border-color: #92400e; }
.sc-legend-lose .sc-legend-dot { background: #ef4444; border-color: #991b1b; }

/* Header mesi (accordion): mini-pill raggruppate */
.stat-comb-month-meta {
  display: flex; flex-wrap: wrap; gap: 6px; flex: 1; justify-content: flex-end;
  align-items: center; font-size: 0.82rem;
}
.sc-mini {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px; font-size: 0.78rem;
  font-weight: 500; color: #374151; background: #f3f4f6;
  border: 1px solid #e5e7eb; white-space: nowrap; line-height: 1.4;
}
.sc-mini b { font-weight: 700; }
.sc-mini-total { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.sc-mini-win { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.sc-mini-overlap { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.sc-mini-scoperto { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.sc-mini-lose { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.sc-mini-hr { background: #f3e8ff; color: #6b21a8; border-color: #d8b4fe; }
.sc-mini-profit { font-weight: 700; }

/* Colori profitto (universali per pill, badge, testi) */
.sc-profit-pos { color: #065f46; background: #d1fae5; border-color: #6ee7b7; }
.sc-profit-neg { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
.sc-profit-zero { color: #4b5563; background: #f3f4f6; border-color: #d1d5db; }
.sc-mini.sc-profit-pos, .sc-mini.sc-profit-neg, .sc-mini.sc-profit-zero { font-weight: 700; }

/* Summary bar dentro il mese aperto */
.sc-summary-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin: 4px 0 16px;
}
.sc-sum {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 10px 12px; position: relative; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.sc-sum::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: #d1d5db;
}
.sc-sum-val { font-size: 1.45rem; font-weight: 700; color: #111827; line-height: 1.1; }
.sc-sum-lbl { font-size: 0.78rem; color: #4b5563; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.sc-sum-icon { font-weight: 700; font-size: 0.9rem; }
.sc-sum-total::before { background: #6366f1; }
.sc-sum-total .sc-sum-val { color: #3730a3; }
.sc-sum-win::before { background: #10b981; }
.sc-sum-win .sc-sum-val { color: #065f46; }
.sc-sum-overlap::before { background: #3b82f6; }
.sc-sum-overlap .sc-sum-val { color: #1e3a8a; }
.sc-sum-scoperto::before { background: #f59e0b; }
.sc-sum-scoperto .sc-sum-val { color: #92400e; }
.sc-sum-lose::before { background: #ef4444; }
.sc-sum-lose .sc-sum-val { color: #991b1b; }
.sc-sum-hr::before { background: #a855f7; }
.sc-sum-hr .sc-sum-val { color: #6b21a8; }
.sc-sum-hr-above::before { background: #f59e0b; }
.sc-sum-hr-above .sc-sum-val { color: #92400e; }
.sc-sum-hr-above .sc-hr-bar { background: #fef3c7; }
.sc-sum-hr-above .sc-hr-fill { background: linear-gradient(90deg, #f59e0b, #d97706); }
.sc-mini-hr-above { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.sc-hr-bar {
  margin-top: 6px; height: 6px; background: #f3e8ff; border-radius: 3px;
  overflow: hidden;
}
.sc-hr-fill { height: 100%; background: linear-gradient(90deg, #a855f7, #7c3aed); transition: width 0.3s; }
.sc-sum-profit.sc-profit-pos::before { background: #10b981; }
.sc-sum-profit.sc-profit-pos .sc-sum-val { color: #065f46; background: transparent; }
.sc-sum-profit.sc-profit-neg::before { background: #ef4444; }
.sc-sum-profit.sc-profit-neg .sc-sum-val { color: #991b1b; background: transparent; }
.sc-sum-profit.sc-profit-zero::before { background: #9ca3af; }
.sc-sum-profit.sc-profit-zero .sc-sum-val { color: #4b5563; background: transparent; }

.sc-sum-profit-above.sc-profit-pos::before { background: #10b981; }
.sc-sum-profit-above.sc-profit-pos .sc-sum-val { color: #065f46; background: transparent; }
.sc-sum-profit-above.sc-profit-neg::before { background: #ef4444; }
.sc-sum-profit-above.sc-profit-neg .sc-sum-val { color: #991b1b; background: transparent; }
.sc-sum-profit-above.sc-profit-zero::before { background: #9ca3af; }
.sc-sum-profit-above.sc-profit-zero .sc-sum-val { color: #4b5563; background: transparent; }

.sc-sum-profit-below.sc-profit-pos::before { background: #10b981; }
.sc-sum-profit-below.sc-profit-pos .sc-sum-val { color: #065f46; background: transparent; }
.sc-sum-profit-below.sc-profit-neg::before { background: #ef4444; }
.sc-sum-profit-below.sc-profit-neg .sc-sum-val { color: #991b1b; background: transparent; }
.sc-sum-profit-below.sc-profit-zero::before { background: #9ca3af; }
.sc-sum-profit-below.sc-profit-zero .sc-sum-val { color: #4b5563; background: transparent; }

.sc-mini-profit-above, .sc-mini-profit-below { font-weight: 700; }

/* Summary divisa in sezioni: Tutte / Sopra soglia / Sotto soglia */
.sc-summary-section { margin: 4px 0 14px; }
.sc-summary-section-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #4b5563;
  margin: 0 0 6px; display: flex; align-items: center; gap: 6px;
}
.sc-summary-section-title small { font-weight: 600; color: #6b7280; }
.sc-summary-section-above .sc-summary-section-title { color: #92400e; }
.sc-summary-section-below .sc-summary-section-title { color: #1f2937; }

/* Cards: varianti sopra/sotto soglia (riusano colori delle versioni "totale"
 * con bordo a sinistra ambrato/grigio per distinguere il bucket).            */
.sc-sum-win-above::before { background: #f59e0b; }
.sc-sum-overlap-above::before { background: #f59e0b; }
.sc-sum-lose-above::before { background: #f59e0b; }
.sc-sum-hr-below::before { background: #6b7280; }
.sc-sum-hr-below .sc-sum-val { color: #374151; }
.sc-sum-hr-below .sc-hr-bar { background: #e5e7eb; }
.sc-sum-hr-below .sc-hr-fill { background: linear-gradient(90deg, #6b7280, #4b5563); }
.sc-sum-win-below::before,
.sc-sum-overlap-below::before,
.sc-sum-lose-below::before { background: #9ca3af; }

/* Tabella dettaglio v2 — stile "statistiche" (bordered/striped/centered) */
.sc-detail-table, .sc-compact-table { font-size: 0.9em; width: 100%; border-collapse: collapse; }
.sc-detail-table thead th, .sc-compact-table thead th {
  background: #f0f0f5; color: #374151; font-weight: 700;
  padding: 8px 8px; border: 1px solid #ddd;
  text-align: center; white-space: nowrap; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.sc-detail-table tbody td, .sc-compact-table tbody td {
  padding: 8px; vertical-align: middle;
  border: 1px solid #ddd; text-align: center;
}
.sc-detail-table tbody tr:nth-child(even),
.sc-compact-table tbody tr:nth-child(even) { background: #fafafa; }
.sc-detail-table tbody tr:hover, .sc-compact-table tbody tr:hover { background: #eaf4ff; }

/* Stat. Bolletta IA — riga scheda espandibile */
.sc-compact-table tr.bia-sheet-row { cursor: pointer; }
.sc-compact-table tr.bia-sheet-row.is-open { background: #eaf4ff; }
.sc-compact-table tr.bia-sheet-row.is-open td:first-child::before { content: "▾ "; color: #2563eb; font-weight: bold; }
.sc-compact-table tr.bia-sheet-row:not(.is-open) td:first-child::before { content: "▸ "; color: #94a3b8; }
.sc-compact-table tr.bia-sheet-detail > td { background: #f8fafc; padding: 0.5rem 0.75rem; }
.bia-sheet-detail-wrap { overflow-x: auto; }
.bia-detail-table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
.bia-detail-table thead th { background: #eef2f7; padding: 4px 8px; text-align: left; border-bottom: 1px solid #d1d5db; }
.bia-detail-table tbody td { padding: 4px 8px; border-bottom: 1px solid #e5e7eb; }
.bia-detail-table tbody tr.bia-leg-win { background: #ecfdf5; }
.bia-detail-table tbody tr.bia-leg-lose { background: #fef2f2; }
.bia-detail-table tbody tr.bia-leg-void { background: #f1f5f9; color: #64748b; }
.bia-detail-table tbody tr.bia-leg-pending { background: #fff; color: #475569; }
.bia-detail-table .bia-leg-icon { width: 1.5em; text-align: center; font-weight: bold; }
.bia-detail-empty { padding: 8px; color: #64748b; font-style: italic; }

/* Riga: bordo sinistro colorato per stato */
.sc-detail-table tbody tr, .sc-compact-table tbody tr { border-left: 4px solid transparent; }
.stat-comb-row-win { border-left-color: #10b981 !important; }
.stat-comb-row-overlap { border-left-color: #3b82f6 !important; background: #f5f9ff; }
.stat-comb-row-scoperto { border-left-color: #f59e0b !important; background: #fffaf0; }
.stat-comb-row-lose { border-left-color: #ef4444 !important; }
.stat-comb-row-void { border-left-color: #9ca3af !important; }

/* Bucket sopra/sotto soglia AI */
.sc-bucket { margin: 18px 0 22px; }
.sc-bucket-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 6px; font-size: 1rem; color: #111827; font-weight: 700;
  padding: 8px 12px; border-radius: 6px;
}
.sc-bucket-title small { color: #6b7280; font-weight: 500; font-size: 0.85em; }
.sc-bucket-above .sc-bucket-title {
  background: linear-gradient(90deg, #ede9fe, #f5f3ff);
  border-left: 4px solid #7c3aed;
}
.sc-bucket-below .sc-bucket-title {
  background: #f3f4f6;
  border-left: 4px solid #9ca3af;
}
.sc-bucket-icon { font-size: 1.1em; }
.sc-bucket-hint {
  margin: 0 0 10px; padding: 0 4px; font-size: 0.82rem; color: #6b7280;
}

/* Tabella compatta (sotto soglia) */
.sc-compact-table { font-size: 0.82rem; }
.sc-compact-table .sc-td-status-compact { width: 44px; padding: 6px 4px; }
.sc-compact-table .sc-td-status-compact .sc-row-status-badge {
  padding: 2px; gap: 0;
}
.sc-compact-table .sc-td-profit { width: 80px; }
.sc-compact-table .sc-td-date { width: 80px; color: #4b5563; font-size: 0.78rem; }
.sc-compact-table .sc-td-score { width: 60px; }
.sc-compact-table .sc-td-markets-compact {
  font-size: 0.76rem; color: #374151;
  max-width: 240px; word-break: break-word;
}
.sc-compact-table .sc-td-ai-compact {
  width: 56px; font-size: 0.78rem; color: #5b21b6; font-weight: 600;
}
.sc-compact-table .sc-match-teams { font-size: 0.82rem; font-weight: 600; }
.sc-compact-table .sc-match-league { font-size: 0.7rem; }

/* Colonna Esito: badge grande con icona */
.sc-row-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-weight: 700;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em;
  border: 1px solid transparent; white-space: nowrap;
}
.sc-row-status-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 0.82rem; font-weight: 700; line-height: 1;
}
.sc-row-status-win { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.sc-row-status-win .sc-row-status-icon { background: #10b981; color: #fff; }
.sc-row-status-overlap { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.sc-row-status-overlap .sc-row-status-icon { background: #3b82f6; color: #fff; }
.sc-row-status-scoperto { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.sc-row-status-scoperto .sc-row-status-icon { background: #f59e0b; color: #fff; }
.sc-row-status-lose { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.sc-row-status-lose .sc-row-status-icon { background: #ef4444; color: #fff; }
.sc-row-status-void { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }
.sc-row-status-void .sc-row-status-icon { background: #9ca3af; color: #fff; }

/* Colonna profitto: pill prominente */
.sc-profit-pill {
  display: inline-block; padding: 4px 10px; border-radius: 6px;
  font-weight: 700; font-size: 0.85rem; border: 1px solid transparent;
  white-space: nowrap; min-width: 66px; text-align: center;
}
.sc-td-profit { white-space: nowrap; }

/* Colonna Match: due righe */
.sc-match-teams { font-weight: 600; color: #111827; line-height: 1.3; }
.sc-match-league { font-size: 0.76rem; color: #6b7280; margin-top: 2px; }

/* Colonna Risultato */
.sc-td-score { text-align: center; font-size: 1rem; color: #111827; }

/* Colonna mercati + coverage */
.sc-markets-row {
  font-size: 0.82rem; color: #374151; line-height: 1.3;
  max-width: 280px;
}
.sc-markets-cov { margin-top: 4px; display: flex; gap: 4px; }
.sc-chip {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 600; border: 1px solid transparent;
}
.sc-chip-sc { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.sc-chip-ov { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }

/* Colonna Vinti: badge conteggio + lista */
.sc-wincount-overlap {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: 999px; font-weight: 700;
  background: #3b82f6; color: #fff; font-size: 0.78rem;
}
.sc-wincount-single {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #10b981; color: #fff; font-weight: 700; font-size: 0.78rem;
}
.sc-wincount-none {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #e5e7eb; color: #6b7280; font-weight: 700; font-size: 0.78rem;
}
.sc-winning-list {
  font-size: 0.76rem; color: #4b5563; margin-top: 3px;
  max-width: 180px; line-height: 1.3;
}

/* Colonna AI */
.sc-td-ai { font-size: 0.82rem; color: #374151; }
.sc-td-ai small { color: #6b7280; font-size: 0.72rem; }

/* Mobile: summary a 2 colonne, tabella come card stack (no scroll orizzontale) */
@media (max-width: 640px) {
  .sc-summary-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-comb-month-meta { justify-content: flex-start; gap: 4px; }
  .sc-mini { font-size: 0.72rem; padding: 2px 7px; }
  .stat-comb-page { padding: 10px; }
  .stat-comb-month-body { padding: 10px; }

  /* Bucket headings più compatti su mobile */
  .sc-bucket { margin: 12px 0 16px; }
  .sc-bucket-title { font-size: 0.92rem; padding: 6px 10px; }
  .sc-bucket-hint { font-size: 0.76rem; }

  /* ─── Sopra soglia: card stack (una card per proposta) ─── */
  .stat-comb-table-wrap { overflow-x: visible; }
  .sc-above-table { min-width: 0; font-size: 0.82rem; display: block; border: 0; }
  .sc-above-table thead { display: none; }
  .sc-above-table tbody { display: block; }
  .sc-above-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #fff;
  }
  .sc-above-table tbody tr:nth-child(even) { background: #fff; }
  .sc-above-table tbody td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .sc-above-table .sc-td-status { grid-column: 1; align-self: center; }
  .sc-above-table .sc-td-profit { grid-column: 2; text-align: right; align-self: center; }
  .sc-above-table .sc-td-date {
    grid-column: 1 / -1;
    font-size: 0.72rem; color: #6b7280;
  }
  .sc-above-table .sc-td-match { grid-column: 1 / -1; }
  .sc-above-table .sc-td-score {
    grid-column: 1 / -1;
    text-align: left;
    font-size: 0.95rem;
  }
  .sc-above-table .sc-td-score::before {
    content: "Risultato: ";
    font-size: 0.7rem; color: #6b7280; font-weight: 400;
    text-transform: uppercase; letter-spacing: 0.04em;
  }
  .sc-above-table .sc-td-markets { grid-column: 1 / -1; }
  .sc-above-table .sc-markets-row { max-width: none; }
  .sc-above-table .sc-td-markets::before {
    content: "Mercati proposta";
    display: block; font-size: 0.68rem; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px;
  }
  .sc-above-table .sc-td-winning { grid-column: 1 / -1; }
  .sc-above-table .sc-winning-list { max-width: none; }
  .sc-above-table .sc-td-winning::before {
    content: "Vinti";
    display: block; font-size: 0.68rem; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px;
  }
  .sc-above-table .sc-td-ai { grid-column: 1 / -1; }
  .sc-above-table .sc-td-ai::before {
    content: "AI best";
    display: block; font-size: 0.68rem; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px;
  }

  /* ─── Sotto soglia: mini-card strette (2 colonne) ─── */
  .sc-compact-table { display: block; border: 0; font-size: 0.78rem; }
  .sc-compact-table thead { display: none; }
  .sc-compact-table tbody { display: block; }
  .sc-compact-table tbody tr {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    grid-template-areas:
      "status match  profit"
      "status match  date"
      "mkts   mkts   score"
      "ai     ai     ai";
    column-gap: 8px;
    row-gap: 2px;
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    border-radius: 8px;
    margin-bottom: 6px;
    padding: 6px 8px;
    background: #fff;
    align-items: center;
  }
  .sc-compact-table tbody tr:nth-child(even) { background: #fff; }
  .sc-compact-table tbody td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .sc-compact-table .sc-td-status-compact { grid-area: status; align-self: center; }
  .sc-compact-table .sc-td-match { grid-area: match; }
  .sc-compact-table .sc-td-profit { grid-area: profit; text-align: right; }
  .sc-compact-table .sc-td-date { grid-area: date; text-align: right; font-size: 0.68rem; color: #6b7280; }
  .sc-compact-table .sc-td-score { grid-area: score; text-align: right; font-size: 0.8rem; }
  .sc-compact-table .sc-td-score::before {
    content: "Esito: "; font-size: 0.64rem; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500;
  }
  .sc-compact-table .sc-td-markets-compact {
    grid-area: mkts; font-size: 0.7rem; color: #374151;
    max-width: none;
  }
  .sc-compact-table .sc-td-markets-compact::before {
    content: "Mercati: "; font-size: 0.64rem; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500;
  }
  .sc-compact-table .sc-td-ai-compact {
    grid-area: ai; font-size: 0.7rem; color: #5b21b6;
    text-align: left;
  }
  .sc-compact-table .sc-td-ai-compact::before {
    content: "AI: "; font-size: 0.64rem; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500;
  }
  .sc-compact-table .sc-match-teams { font-size: 0.8rem; line-height: 1.2; }
  .sc-compact-table .sc-match-league { font-size: 0.66rem; }
  .sc-compact-table .sc-profit-pill {
    font-size: 0.72rem; padding: 2px 6px; min-width: 0;
  }

  /* ─── Stat. Bolletta IA: layout card su mobile ─── */
  .sc-compact-table tr.bia-sheet-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date   profit"
      "name   name"
      "status meta";
    column-gap: 8px;
    row-gap: 4px;
    align-items: center;
  }
  .sc-compact-table tr.bia-sheet-row > td:nth-child(1) { grid-area: date; font-size: 0.72rem; color: #6b7280; }
  .sc-compact-table tr.bia-sheet-row > td:nth-child(2) { grid-area: name; font-weight: 600; font-size: 0.85rem; }
  .sc-compact-table tr.bia-sheet-row > td:nth-child(3) {
    grid-area: meta; text-align: right; font-size: 0.72rem; color: #475569;
  }
  .sc-compact-table tr.bia-sheet-row > td:nth-child(3)::before {
    content: "Match: "; color: #6b7280;
  }
  .sc-compact-table tr.bia-sheet-row > td:nth-child(4) { display: none; }
  .sc-compact-table tr.bia-sheet-row > td:nth-child(5) { grid-area: status; font-size: 0.78rem; }
  .sc-compact-table tr.bia-sheet-row > td:nth-child(6) {
    grid-area: profit; text-align: right; font-weight: 700; font-size: 0.82rem;
  }
  .sc-compact-table tr.bia-sheet-row.is-open td:first-child::before { content: "▾ "; }
  .sc-compact-table tr.bia-sheet-row:not(.is-open) td:first-child::before { content: "▸ "; }

  /* Riga dettaglio: full-width, niente grid */
  .sc-compact-table tr.bia-sheet-detail {
    display: block;
    border: 0;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
    margin: -6px 0 6px;
    padding: 0;
  }
  .sc-compact-table tr.bia-sheet-detail > td {
    display: block; padding: 8px; background: #f8fafc; border: 0;
  }
  .bia-sheet-detail-wrap { overflow-x: visible; }

  /* Tabella annidata partite → cards verticali */
  .bia-detail-table { display: block; font-size: 0.78rem; }
  .bia-detail-table thead { display: none; }
  .bia-detail-table tbody { display: block; }
  .bia-detail-table tbody tr {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    grid-template-areas:
      "icon match  quota"
      "icon pick   pick"
      "icon result result";
    column-gap: 6px;
    row-gap: 2px;
    padding: 6px 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
  }
  .bia-detail-table tbody td { display: block; padding: 0; border: 0; }
  .bia-detail-table tbody td:nth-child(1) { grid-area: icon; align-self: center; text-align: center; font-weight: bold; }
  .bia-detail-table tbody td:nth-child(2) { grid-area: match; font-weight: 600; }
  .bia-detail-table tbody td:nth-child(3) { grid-area: pick; color: #374151; }
  .bia-detail-table tbody td:nth-child(3)::before { content: "Pronostico: "; font-size: 0.68rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; }
  .bia-detail-table tbody td:nth-child(4) { grid-area: result; color: #374151; }
  .bia-detail-table tbody td:nth-child(4)::before { content: "Risultato: "; font-size: 0.68rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; }
  .bia-detail-table tbody td:nth-child(5) { grid-area: quota; text-align: right; font-weight: 600; }
  .bia-detail-table tbody td:nth-child(5)::before { content: "Q "; font-size: 0.68rem; color: #6b7280; }
}

/* Tablet intermedio: tabella compatta con font ridotto */
@media (min-width: 641px) and (max-width: 900px) {
  .sc-compact-table { font-size: 0.76rem; }
  .sc-compact-table thead th { font-size: 0.7rem; padding: 6px 4px; }
  .sc-compact-table tbody td { padding: 6px 4px; }
  .sc-compact-table .sc-td-markets-compact { max-width: 160px; }
  .sc-detail-table { font-size: 0.82rem; }
}

/* Sopra soglia (compact): bordo viola per richiamare l'header del bucket */
.sc-bucket-above .sc-compact-table-above tbody tr { border-left: 4px solid #7c3aed; }
.sc-bucket-above .sc-compact-table-above .sc-td-ai-compact { color: #5b21b6; font-weight: 700; }

/* =========================================================
   SCHEDE SALVATE — fix mobile minimale (telefono ≤ 640px)
   Mantiene il layout tabellare ma:
   - rimuove min-width per colonna e white-space: nowrap
   - permette scroll orizzontale controllato nel wrap
   - riduce font e padding
   - compatta l'header evitando overflow
   ========================================================= */
@media (max-width: 640px) {
  /* Card scheda */
  .frozen-card { margin: 8px 0; }

  /* Header: titolo a capo, azioni sotto, flex-wrap */
  .frozen-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .frozen-title {
    font-size: 15px;
    line-height: 1.25;
    flex: 1 1 100%;
    overflow-wrap: anywhere;
  }
  .frozen-actions {
    flex-wrap: wrap;
    gap: 6px 8px;
    width: 100%;
    justify-content: flex-start;
  }
  .frozen-header .gioca-meta,
  .frozen-header .frozen-header-profit { font-size: 12.5px; }
  .frozen-meta { flex-wrap: wrap; gap: 6px; }
  .frozen-meta[data-status]::before { font-size: 12px; padding: 5px 9px; }
  .frozen-meta-cards,
  .frozen-meta-pill { font-size: 12px; padding: 5px 9px; }
  .frozen-icons { margin-left: auto; gap: 4px; }
  .frozen-icons .icon-btn { width: 38px; height: 38px; }

  /* Tabella: consenti scroll-x interno, reset min-width e nowrap */
  .gioca-section.frozen .gioca-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .gioca-section.frozen .gioca-table td,
  .gioca-section.frozen .gioca-table th,
  .gioca-section.frozen .pred-table td,
  .gioca-section.frozen .pred-table th {
    min-width: 0 !important;
    white-space: nowrap; /* nel wrap scorre orizzontalmente */
    font-size: 12px;
    padding: 5px 6px;
  }
  /* Cella Match (squadre + campionato) può andare a capo */
  .gioca-section.frozen .gioca-table td.frozen-cell-match {
    white-space: normal;
    min-width: 140px !important;
    max-width: 220px;
  }
  .gioca-section.frozen .gioca-table td.frozen-cell-when {
    white-space: nowrap;
  }

  /* Titoli mercato / scheda più compatti */
  .gioca-section.frozen > h3 { font-size: 14px; margin: 12px 0 6px; }
  .gioca-section.frozen .gioca-card-title { font-size: 14px; padding: 6px 10px; }
  .gioca-section.frozen .gioca-meta { font-size: 12.5px; line-height: 1.4; }

  /* Recap: scroll orizzontale come fallback se i nomi schede sono molto lunghi */
  .frozen-recap-body { display: block; }
  .frozen-recap-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .frozen-recap-table { width: 100%; }
  .frozen-recap-table td,
  .frozen-recap-table th { font-size: 13px; padding: 6px 8px; }
  /* Nomi tipo "24_aprile_in_corso" non hanno break naturali: forza il wrap */
  .frozen-recap-table td.recap-name {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* ============================================================
   La Bolletta IA
   ============================================================ */
.bolletta-page {
  background: #ffffff;
  border: 1px solid #e5ebf0;
  border-radius: 14px;
  padding: 20px;
  margin: 12px 0 24px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.bolletta-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.bolletta-hero h2 { margin: 0 0 6px; font-size: 1.45rem; font-weight: 800; color: #0f172a; }
.bolletta-subtitle { margin: 0; color: #475569; font-size: 13px; line-height: 1.5; max-width: 720px; }
.bolletta-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.bolletta-importo-wrap {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 700; color: #475569;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.bolletta-importo-wrap input {
  width: 130px; padding: 8px 12px;
  border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 1.05rem; font-weight: 800; color: #0f172a; background: #ffffff;
}
.bolletta-importo-wrap input:focus {
  outline: none; border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.bolletta-gen-btn {
  padding: 9px 18px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4f46e5); color: #ffffff;
  font-weight: 800; font-size: 14px; cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}
.bolletta-gen-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.bolletta-gen-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.bolletta-dado-btn {
  padding: 9px 16px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #ffffff;
  font-weight: 800; font-size: 14px; cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}
.bolletta-dado-btn:hover { transform: translateY(-1px) rotate(-2deg); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35); }
.bolletta-dado-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.bolletta-dado-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e; font-size: 11px; font-weight: 800;
  border: 1px solid #fcd34d; vertical-align: middle;
}
.bolletta-card.is-dado { border-color: #fcd34d; box-shadow: 0 0 0 1px #fcd34d33 inset; }

.bolletta-status { margin: 8px 0 12px; }
.bolletta-hint {
  padding: 10px 14px; border-radius: 10px;
  background: #eef2ff; color: #312e81;
  font-size: 13px; border: 1px solid #c7d2fe;
}
.bolletta-hint.is-warn { background: #fef3c7; color: #78350f; border-color: #fde68a; }
.bolletta-hint.is-error { background: #fee2e2; color: #7f1d1d; border-color: #fecaca; }

.bolletta-result { display: flex; flex-direction: column; gap: 16px; }

.bolletta-card {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 16px;
}
.bolletta-card-head {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.bolletta-card-head h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: #0f172a; }
.bolletta-meta { font-size: 12px; color: #64748b; }
.bolletta-empty { padding: 18px; color: #64748b; font-size: 13px; text-align: center; }

.bolletta-freeze-btn {
  padding: 8px 14px; border: none; border-radius: 8px;
  background: #0ea5e9; color: #ffffff;
  font-weight: 800; font-size: 13px; cursor: pointer;
  transition: background 0.1s ease, transform 0.1s ease;
}
.bolletta-freeze-btn:hover { background: #0284c7; transform: translateY(-1px); }
.bolletta-freeze-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.bolletta-table-wrap { background: #ffffff; border-radius: 8px; }
.bolletta-table th, .bolletta-table td { padding: 8px 10px; vertical-align: middle; }
.bolletta-table th { background: #eef2ff; color: #312e81; font-size: 12px; }
.bolletta-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.bolletta-pick {
  /* Cella tabella "Pronostico": testo in chiaro (1, X, 2, Over 1.5, ...).
     Niente display:inline-block o sfondi pill (il <td> deve restare cella
     di tabella per allinearsi alla colonna). Solo nowrap per evitare che
     "Over 1.5" / "Under 1.5" vadano a capo. */
  white-space: nowrap;
  font-weight: 700;
  color: #5b21b6;
}
.bolletta-league { color: #64748b; font-size: 11px; }

.bolletta-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px; margin-top: 12px;
}
.bolletta-summary > div {
  background: #ffffff; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.bolletta-summary span { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.bolletta-summary strong { font-size: 1.05rem; color: #0f172a; font-variant-numeric: tabular-nums; }
.bolletta-summary .is-pos strong { color: #15803d; }
.bolletta-summary .is-neg strong { color: #b91c1c; }

.bolletta-footer { margin-top: 14px; color: #64748b; font-size: 12px; }

/* Strip rendimento "Bolletta del Giorno": ROI 30gg, record, striscia. */
.bdg-perf-wrap { margin: 0 0 12px; }
.bdg-perf {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.bdg-perf-chip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 14px; border-radius: 10px;
  background: #f8fafc; border: 1px solid #e2e8f0; min-width: 110px;
}
.bdg-perf-chip .bdg-perf-lbl {
  font-size: 10px; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.bdg-perf-chip strong { font-size: 1.05rem; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
.bdg-perf-chip.is-pos { background: #ecfdf5; border-color: #a7f3d0; }
.bdg-perf-chip.is-pos strong { color: #15803d; }
.bdg-perf-chip.is-neg { background: #fef2f2; border-color: #fecaca; }
.bdg-perf-chip.is-neg strong { color: #b91c1c; }
.bdg-perf-empty {
  padding: 10px 14px; border-radius: 10px; font-size: 12.5px;
  background: #f1f5f9; color: #475569; border: 1px dashed #cbd5e1;
}

/* Opzioni avanzate collassabili (max match, comb. min %). */
.bolletta-adv {
  margin: 0 0 14px; border: 1px solid #e2e8f0; border-radius: 10px;
  background: #f8fafc; padding: 4px 12px;
}
.bolletta-adv > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: #475569;
  padding: 6px 2px; list-style: none; user-select: none;
}
.bolletta-adv > summary::-webkit-details-marker { display: none; }
.bolletta-adv[open] > summary { border-bottom: 1px solid #e2e8f0; margin-bottom: 10px; }
.bolletta-adv-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding-bottom: 10px; }

@media (max-width: 768px) {
  .bolletta-hero { flex-direction: column; }
  .bolletta-controls { width: 100%; justify-content: space-between; }
  .bdg-perf-chip { flex: 1 1 100px; }
}

/* =========================================================
   BOLLETTE GIOCATE — vista verticale (combinazioni in freeze)
   Una card per scheda con label/valore impilati: leggibile in app
   e quando la card viene condivisa via /share.
   ========================================================= */
.bollette-vert-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.bollette-vert-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.bollette-vert-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 3px;
  border-bottom: 1px dashed #e5e7eb;
  margin-bottom: 1px;
}
.bollette-vert-esito {
  font-size: 1.05em;
  line-height: 1;
}
.bollette-vert-market {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.92rem;
  line-height: 1.15;
  flex: 1 1 auto;
  word-break: break-word;
}
.bollette-vert-status {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}
.bollette-vert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0;
  line-height: 1.2;
}
.bollette-vert-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  color: #6b7280;
}
.bollette-vert-value {
  font-size: 0.9rem;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}
/* Stati: bordo + sfondo sottile, allineati alle classi frozen-* esistenti */
.bollette-vert-card.bollette-vert-win {
  background: #f1fbf3;
  border-color: #bbf7d0;
}
.bollette-vert-card.bollette-vert-win .bollette-vert-status { color: #15803d; }
.bollette-vert-card.bollette-vert-lose {
  background: #fdf3f3;
  border-color: #fecaca;
}
.bollette-vert-card.bollette-vert-lose .bollette-vert-status { color: #b91c1c; }
.bollette-vert-card.bollette-vert-live {
  background: #fffbeb;
  border-color: #fde68a;
}
.bollette-vert-card.bollette-vert-live .bollette-vert-status { color: #92400e; }
.bollette-vert-card.bollette-vert-live-win { background: #f1f9f1; border-color: #bbf7d0; }
.bollette-vert-card.bollette-vert-live-lose { background: #fbeeee; border-color: #fecaca; }
.bollette-vert-card.bollette-vert-cashout {
  background: #fef3c7;
  border-color: #fcd34d;
}
.bollette-vert-card.bollette-vert-cashout .bollette-vert-status { color: #92400e; font-weight: 700; }
.frozen-scheda-cashout { box-shadow: inset 0 0 0 2px #fcd34d; }
.gioca-card-title .cashout-card { float: right; }

@media (max-width: 560px) {
  .bollette-vert-list {
    grid-template-columns: 1fr;
  }
  .bollette-vert-head { flex-wrap: wrap; }
  .bollette-vert-status { font-size: 10px; }
}





/* Value Hunter — addon: stake row globale, badge "Consigliata IA", payout */
.macchia-stake-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.macchia-stake-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #78350f;
  margin: 0;
}
.macchia-stake-row input {
  width: 110px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d4a373;
  font-weight: 700;
  font-size: 14px;
  text-align: right;
}
.macchia-stake-row small { color: #78350f; }

.macchia-card.is-ai-rec {
  border: 2px solid #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12), 0 1px 3px rgba(0,0,0,0.06);
}
.macchia-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.macchia-payout {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 13px;
  color: #14532d;
}
.macchia-payout-net {
  color: #15803d;
  font-size: 16px;
  margin: 0 4px;
}
.macchia-payout small {
  color: #15803d;
  opacity: 0.75;
  font-size: 11px;
  display: block;
  margin-top: 2px;
}

/* ============================================================ */
/* QUOTA TARGET                                                 */
/* ============================================================ */
.qt-block {
  background: linear-gradient(135deg, #fafaff 0%, #f0f4ff 100%);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.qt-head { margin-bottom: 14px; }
.qt-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: #1e1b4b; }
.qt-subtitle { margin: 0; color: #475569; font-size: 14px; }

.qt-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.qt-controls label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.qt-controls input {
  margin-top: 4px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-weight: 700;
  font-size: 14px;
  width: 110px;
  text-align: right;
}
.qt-controls input[type="date"] {
  width: 150px;
  text-align: left;
  font-size: 13px;
  min-height: 36px;
}
.qt-hint-inline { color: #94a3b8; font-weight: 400; text-transform: none; letter-spacing: 0; }
.qt-info { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 4px; border-radius: 50%; color: #94a3b8; font-size: 11px; cursor: help; opacity: 0.8; }
.qt-info:hover, .qt-info:focus { opacity: 1; color: #38bdf8; outline: none; }
@media (max-width: 640px) {
  .qt-controls { gap: 10px; padding: 12px; }
  .qt-controls label { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .qt-controls input { width: 100%; box-sizing: border-box; }
  .qt-controls input[type="date"] { width: 100%; font-size: 14px; }
  .qt-controls label:has(#qtDateFrom),
  .qt-controls label:has(#qtDateTo) { flex: 1 1 calc(50% - 5px); }
  .qt-run-btn { flex: 1 1 100%; padding: 12px; font-size: 15px; }
}
.qt-run-btn {
  padding: 9px 18px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.qt-run-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
.qt-run-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.qt-result { margin-top: 6px; }
.qt-progress {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 12px 14px;
  color: #475569;
}
.qt-spinner {
  width: 18px; height: 18px;
  border: 2px solid #c7d2fe; border-top-color: #4f46e5;
  border-radius: 50%; animation: qt-spin 0.7s linear infinite;
}
@keyframes qt-spin { to { transform: rotate(360deg); } }

.qt-hint {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 12px 14px;
  color: #475569; font-size: 14px;
}
.qt-hint.is-warn { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
.qt-result-meta { color: #475569; font-size: 13px; margin-bottom: 12px; }

.qt-alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}
.qt-alt-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qt-alt-card.is-best {
  border: 2px solid #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.qt-alt-card.is-safe   { border-left: 4px solid #10b981; }
.qt-alt-card.is-mid    { border-left: 4px solid #f59e0b; }
.qt-alt-card.is-risky  { border-left: 4px solid #ef4444; }

.qt-alt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.qt-alt-head > div:first-child { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.qt-alt-badge {
  background: #f1f5f9; color: #334155;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.qt-alt-best-badge {
  background: #d1fae5; color: #065f46;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  border: 1px solid #6ee7b7;
}
.qt-alt-k {
  background: #ede9fe; color: #5b21b6;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.qt-alt-quota { text-align: right; }
.qt-alt-quota strong { font-size: 22px; color: #1e1b4b; }
.qt-alt-quota small { display: block; font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }

.qt-legs {
  list-style: none; padding: 0; margin: 0;
  border-top: 1px dashed #e2e8f0;
}
.qt-leg {
  padding: 8px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 13px;
}
.qt-leg:last-child { border-bottom: none; }
.qt-leg-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qt-leg-pick {
  background: #ede9fe; color: #5b21b6;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; margin-left: auto;
}
.qt-leg-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: #94a3b8; margin-top: 2px;
}
.qt-leg-bm { font-style: italic; }
.qt-leg-stats {
  display: flex; gap: 10px; margin-top: 4px;
  font-size: 12px;
}
.qt-leg-quota { font-weight: 700; color: #1e293b; }
.qt-leg-prob  { font-weight: 700; color: #16a34a; }

.qt-alt-foot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}
.qt-stat { display: flex; flex-direction: column; }
.qt-stat span {
  font-size: 10px; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
}
.qt-stat strong { font-size: 15px; color: #1e1b4b; margin-top: 2px; }
.qt-stat .is-pos { color: #15803d; }
.qt-stat .is-neg { color: #b91c1c; }
.qt-stat.qt-payout strong { color: #15803d; font-size: 18px; }
.qt-stat.qt-payout small { color: #15803d; opacity: 0.75; font-size: 10px; }
.qt-stat.qt-payout-total strong { color: #14532d; font-size: 16px; }
.qt-stat.qt-payout-total span { color: #15803d; }

.qt-footer { margin-top: 14px; color: #64748b; }
.qt-footer small { font-size: 11px; }

/* Quota Target — addon: badge "Aff. IA" + indicatore per-leg high conf */
.qt-alt-card.is-ai-trusted {
  border: 2px solid #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.qt-alt-card.is-ai-trusted.is-best {
  border-color: #10b981;
  box-shadow:
    0 0 0 3px rgba(16, 185, 129, 0.12),
    0 0 0 5px rgba(99, 102, 241, 0.10);
}
.qt-alt-ai-badge {
  background: #ede9fe;
  color: #4338ca;
  border: 1px solid #c4b5fd;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.qt-leg-prob.is-high {
  color: #4338ca;
  background: #ede9fe;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #c4b5fd;
}

/* Quota Target — Freeze button */
.qt-alt-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}
.qt-freeze-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.qt-freeze-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.qt-freeze-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(135deg, #10b981, #059669);
}

/* Quota Target — affidabilità circle + tags row */
.qt-alt-affid-block { flex: 0 0 auto; }
.qt-affid-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 3px solid #94a3b8;
  background: #fff;
  color: #1e1b4b;
  text-align: center;
  line-height: 1;
}
.qt-affid-circle strong {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 2px;
}
.qt-affid-circle small {
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.qt-affid-circle.is-safe   { border-color: #10b981; color: #065f46; }
.qt-affid-circle.is-safe small { color: #10b981; }
.qt-affid-circle.is-mid    { border-color: #f59e0b; color: #78350f; }
.qt-affid-circle.is-mid small { color: #f59e0b; }
.qt-affid-circle.is-risky  { border-color: #ef4444; color: #7f1d1d; }
.qt-affid-circle.is-risky small { color: #ef4444; }

.qt-alt-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e2e8f0;
}

/* Value Hunter — Freeze button per singola giocata */
.macchia-card-actions {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}
.macchia-freeze-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.macchia-freeze-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.macchia-freeze-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(135deg, #10b981, #059669);
}

/* Quota Target — banner approssimazione + badge */
.qt-mode-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #78350f;
}
.qt-mode-banner small {
  display: block;
  margin-top: 4px;
  color: #92400e;
  font-size: 11px;
  font-style: italic;
}
.qt-below-floor {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px dashed #cbd5e1;
}
.qt-below-floor-title {
  margin: 0 0 6px 0;
  font-size: 18px;
  color: #475569;
  font-weight: 700;
}
.qt-below-floor-hint {
  margin: 0 0 14px 0;
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}
.qt-alt-approx-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Quota Target — pulsante "Salva per statistiche" (shadow log) */
.qt-alt-actions { gap: 8px; flex-wrap: wrap; }
.qt-stats-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.qt-stats-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.qt-stats-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(135deg, #10b981, #059669);
}

/* Bolletta IA — stats button + actions wrapper */
.bolletta-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bolletta-stats-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.bolletta-stats-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.bolletta-stats-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: linear-gradient(135deg, #10b981, #059669);
}


/* Bottone "ⓘ" info forma + H2H — usato da Value Hunter, Bolletta IA, Quota Target */
.fixture-insights-btn,
.macchia-info-btn,
.bolletta-info-btn,
.qt-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin: 0 4px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  vertical-align: middle;
}
.fixture-insights-btn:hover,
.macchia-info-btn:hover,
.bolletta-info-btn:hover,
.qt-info-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* Stat. Combinazioni — bottone "+" expand su "Sotto soglia AI" */
.sc-summary-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sc-section-expand-btn {
  margin-left: auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.sc-section-expand-btn:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  transform: scale(1.05);
}
.sc-section-expand-btn.is-open {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}
.sc-section-expand-icon { font-size: 16px; line-height: 1; }
.sc-bucket-collapsed { display: none; }

/* =====================================================================
 * Aggiungi Custom Bolletta (giocate esterne)
 * Stile coerente con .frozen-card (light/celeste)
 * ===================================================================== */
.ccb {
  margin-top: 18px;
  margin-bottom: 12px;
  background: #f0f9ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  overflow: hidden;
}
.ccb-head {
  display: flex;
  align-items: stretch;
  background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
  border-bottom: 1px solid transparent;
}
.ccb.is-open .ccb-head { border-bottom-color: #bfdbfe; }
.ccb-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease;
}
.ccb-toggle:hover { background: rgba(255, 255, 255, 0.35); }
.ccb-toggle:focus-visible { outline: 2px solid #0d6efd; outline-offset: -2px; }
.ccb-trash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(191, 219, 254, 0.6);
  color: #b91c1c;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s ease;
}
.ccb-trash:hover { background: rgba(220, 38, 38, 0.1); }
.ccb-trash:focus-visible { outline: 2px solid #dc2626; outline-offset: -2px; }
.ccb-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.ccb-toggle-label { flex: 1; min-width: 0; }
.ccb-toggle-caret {
  font-size: 14px;
  color: #475569;
  transition: transform .2s ease;
}
.ccb.is-open .ccb-toggle-caret { transform: rotate(180deg); }
.ccb-head-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}
.ccb-head-pill {
  background: #dbeafe;
  color: #1e40af;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.ccb-head-pl { font-variant-numeric: tabular-nums; }
.ccb-head-pl.profit-positive { color: #15803d; }
.ccb-head-pl.profit-negative { color: #b91c1c; }
.ccb-head-pl.profit-zero { color: #475569; }

.ccb-body {
  display: none;
  padding: 14px 16px 16px;
  animation: expand 0.2s ease-out;
}
.ccb.is-open .ccb-body { display: block; }

/* Form */
.ccb-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
}
.ccb-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.ccb-field-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ccb-field input,
.ccb-field select {
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}
.ccb-field input:focus,
.ccb-field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.ccb-field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ccb-submit {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.ccb-submit:hover { background: #1d4ed8; }
.ccb-submit:active { transform: translateY(1px); }

/* Summary */
.ccb-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.ccb-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
}
.ccb-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ccb-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.ccb-stat.profit-positive .ccb-stat-value { color: #15803d; }
.ccb-stat.profit-negative .ccb-stat-value { color: #b91c1c; }

/* Lista (no tabella -> mobile-friendly) */
.ccb-empty {
  margin: 0;
  padding: 18px 12px;
  text-align: center;
  color: #64748b;
  font-style: italic;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}
.ccb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ccb-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #cbd5e1;
  border-radius: 8px;
}
.ccb-item-win  { border-left-color: #22c55e; }
.ccb-item-lose { border-left-color: #ef4444; }
.ccb-item-pending { border-left-color: #f59e0b; }
.ccb-item-main { min-width: 0; }
.ccb-item-match {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ccb-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.82rem;
  color: #475569;
  margin-top: 3px;
}
.ccb-meta-stake, .ccb-meta-odd { font-variant-numeric: tabular-nums; font-weight: 600; }
.ccb-meta-sep { color: #94a3b8; }
.ccb-meta-status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 4px;
}
.ccb-meta-status-win { background: #dcfce7; color: #166534; }
.ccb-meta-status-lose { background: #fee2e2; color: #991b1b; }
.ccb-meta-status-pending { background: #fef3c7; color: #92400e; }
.ccb-item-pl {
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ccb-item-pl.profit-positive { color: #15803d; }
.ccb-item-pl.profit-negative { color: #b91c1c; }
.ccb-item-pl.profit-zero { color: #475569; }
.ccb-item-actions {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.ccb-act {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background .12s ease, border-color .12s ease;
}
.ccb-act:hover { background: #f1f5f9; }
.ccb-act-win:hover { border-color: #22c55e; background: #dcfce7; }
.ccb-act-lose:hover { border-color: #ef4444; background: #fee2e2; }
.ccb-act-pending:hover { border-color: #f59e0b; background: #fef3c7; }
.ccb-act-del:hover { border-color: #ef4444; background: #fee2e2; }

/* Mobile */
@media (max-width: 640px) {
  .ccb-toggle { padding: 10px 12px; font-size: 0.95rem; gap: 8px; }
  .ccb-toggle-label { font-size: 0.95rem; }
  .ccb-head-summary { display: none; }
  .ccb-body { padding: 12px; }
  .ccb-field-row { grid-template-columns: 1fr 1fr; }
  .ccb-field-row .ccb-field:nth-child(3) { grid-column: 1 / -1; }
  .ccb-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ccb-item {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "main pl"
      "actions actions";
    gap: 8px;
  }
  .ccb-item-main { grid-area: main; }
  .ccb-item-pl { grid-area: pl; align-self: start; }
  .ccb-item-actions { grid-area: actions; justify-content: flex-end; }
  .ccb-act { width: 36px; height: 36px; font-size: 16px; }
}

/* Card Custom Bolletta — usa .frozen-card di base, aggiunge solo header */
.ccb-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ccb-card .ccb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  flex-wrap: wrap;
}
.ccb-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.ccb-card-status {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.ccb-card-status.win { background: #dcfce7; color: #166534; }
.ccb-card-status.lose { background: #fee2e2; color: #991b1b; }
.ccb-card-status.pending { background: #fef3c7; color: #92400e; }
.ccb-card-date {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
}
.ccb-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.ccb-card-btn {
  width: 30px;
  height: 30px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
}
.ccb-card-btn.ccb-act-win:not(:disabled):hover { border-color: #22c55e; background: #dcfce7; }
.ccb-card-btn.ccb-act-lose:not(:disabled):hover { border-color: #ef4444; background: #fee2e2; }
.ccb-card-btn.ccb-act-pending:not(:disabled):hover { border-color: #f59e0b; background: #fef3c7; }
.ccb-card-btn:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 640px) {
  .ccb-card .ccb-card-head { padding: 9px 10px; }
  .ccb-card-actions { width: 100%; justify-content: flex-end; }
  .ccb-card-btn { width: 36px; height: 36px; font-size: 16px; }
}

/* Modal input personalizzato (rinomina schedina, ecc.) */
.app-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}
.app-modal {
  background: #1c1f24;
  color: #f1f1f1;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 18px 18px 14px;
  width: min(420px, 92vw);
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
  animation: appModalIn 0.16s ease-out;
}
@keyframes appModalIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.app-modal-header {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #fff;
}
.app-modal-label {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 6px;
}
.app-modal-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0f1115;
  color: #fff;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.app-modal-input:focus {
  border-color: #4c8bf5;
  box-shadow: 0 0 0 2px rgba(76,139,245,0.25);
}
.app-modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 14px;
}
.app-modal-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #2a2f37;
  color: #f1f1f1;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.app-modal-btn:hover { background: #353b45; }
.app-modal-ok {
  background: #4c8bf5;
  border-color: #4c8bf5;
  color: #fff;
  font-weight: 600;
}
.app-modal-ok:hover { background: #3a78e0; border-color: #3a78e0; }

/* =========================================================
   Bolletta Manuale
   ========================================================= */
.bolletta-manuale { display: flex; flex-direction: column; gap: 16px; }
.bolletta-manuale .bolletta-head h2 { margin: 0 0 4px; }
.bolletta-manuale .bolletta-hint { color: #64748b; font-size: 13px; }
.bm-controls {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  align-items: end;
}
@media (max-width: 640px) { .bm-controls { grid-template-columns: 1fr; } }
.bm-field { display: flex; flex-direction: column; gap: 4px; }
.bm-field-label { font-size: 12px; color: #475569; font-weight: 600; }
.bm-field input {
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px;
  font-size: 14px; background: #fff;
}
.bm-field input:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,0.18); }

.bm-suggestions { min-height: 8px; }
.bm-empty-hint { color: #64748b; font-size: 13px; margin: 4px 0; }
.bm-suggestions-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.bm-suggestion-btn {
  width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto auto;
  gap: 12px; align-items: center;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
}
.bm-suggestion-btn:hover { background: #eef2f7; border-color: #cbd5e1; }
.bm-suggestion-teams { font-weight: 600; color: #0f172a; }
.bm-suggestion-meta { color: #64748b; font-size: 12px; }
.bm-suggestion-add { color: #0ea5e9; font-weight: 600; font-size: 13px; }

.bm-picked { display: flex; flex-direction: column; gap: 12px; }
.bm-match-card {
  border: 1px solid #e2e8f0; border-radius: 12px; background: #fff;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 12px;
}
.bm-match-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.bm-match-teams { font-weight: 700; color: #0f172a; }
.bm-match-meta { color: #64748b; font-size: 12px; }
.bm-remove-match {
  background: transparent; border: none; cursor: pointer; font-size: 18px;
  padding: 4px; border-radius: 6px;
}
.bm-remove-match:hover { background: #fee2e2; }

.bm-markets { display: flex; flex-direction: column; gap: 10px; }
.bm-group-title { font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.bm-group-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.bm-chip {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 88px; padding: 8px 10px;
  background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 10px;
  color: #0f172a;
  cursor: pointer; transition: all 0.15s ease;
}
.bm-chip:hover { background: #eef2f7; border-color: #94a3b8; color: #0f172a; }
.bm-chip.is-selected {
  background: #0ea5e9; border-color: #0284c7; color: #fff;
  box-shadow: 0 2px 8px rgba(14,165,233,0.3);
}
.bm-chip { position: relative; }
.bm-chip-label { font-size: 13px; font-weight: 600; }
.bm-chip-quota { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.bm-chip.is-edited .bm-chip-quota { font-weight: 700; opacity: 1; text-decoration: underline; }
.bm-chip-edit {
  position: absolute; top: 2px; right: 2px;
  font-size: 11px; line-height: 1;
  padding: 2px 4px; border-radius: 6px;
  background: rgba(255,255,255,0.85); color: #0f172a;
  cursor: pointer; opacity: 0.9;
}
.bm-chip-edit:hover { background: #fff; opacity: 1; }

.bm-summary { background: #f1f5f9; border-radius: 10px; padding: 10px 14px; }
.bm-summary-row { display: flex; flex-wrap: wrap; gap: 18px; }
.bm-summary-row > div { display: flex; flex-direction: column; }
.bm-sum-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.bm-sum-value { font-weight: 700; color: #0f172a; font-size: 15px; }

.bm-actions { display: flex; }
.bm-status:empty { display: none; }

/* ===== Pannello "Escludi campionati" condiviso (stile chip "Gioca per me") ===== */
.excl-leagues-panel { margin: 12px 0; }
.excl-leagues-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px dashed #fed7aa;
}
.excl-leagues-save {
  background: #16a34a; color: #fff; border: 0; border-radius: 999px;
  padding: 7px 16px; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: background 0.15s ease;
}
.excl-leagues-save:hover:not(:disabled) { background: #15803d; }
.excl-leagues-save:disabled { opacity: 0.6; cursor: wait; }
.excl-leagues-clear {
  background: #ffffff; color: #9a3412; border: 1px solid #fed7aa; border-radius: 999px;
  padding: 6px 14px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.excl-leagues-clear:hover { background: #fff7ed; border-color: #fdba74; }
.excl-leagues-status { font-size: 12px; color: #475569; }

/* ===== Prima/Ultima panel ===== */
.pa-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; margin-top: 18px; }
.pa-head h3 { margin: 0 0 6px; color: #0f172a; }
.pa-sub { margin: 0 0 12px; font-size: 13px; color: #475569; }
.pa-loading, .pa-empty { padding: 14px; color: #64748b; font-style: italic; }
.pa-layout { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.pa-sidebar { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; }
.pa-sidebar h4 { margin: 4px 0 8px; font-size: 13px; color: #0f172a; }
.pa-sidebar hr { margin: 14px 0; border: 0; border-top: 1px dashed #cbd5e1; }
.pa-config-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pa-config-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; min-width: 240px; flex: 0 1 auto; }
.pa-config-item.is-selected { border-color: #00c46c; box-shadow: 0 0 0 2px rgba(0,196,108,.15); }
.pa-config-item.is-inactive { opacity: 0.55; }
.pa-config-pick { background: none; border: 0; cursor: pointer; text-align: left; padding: 2px; display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 12px; flex: 1 1 auto; min-width: 0; color: #0f172a; }
.pa-cfg-league { font-weight: 700; color: #0f172a; font-size: 11px; text-transform: uppercase; background: #e2e8f0; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.pa-cfg-vs { color: #1e293b; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-cfg-vs small { color: #64748b; font-weight: 400; }
.pa-cfg-stake { color: #64748b; font-size: 11px; white-space: nowrap; flex-shrink: 0; }
.pa-cfg-toggle, .pa-cfg-del, .pa-cfg-edit { background: #fff; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 14px; line-height: 1; flex-shrink: 0; }
.pa-cfg-edit:hover { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.pa-cfg-toggle:hover { background: #fff7ed; color: #c2410c; border-color: #fdba74; }
.pa-cfg-del:hover { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.pa-form { display: flex; flex-direction: column; gap: 8px; }
.pa-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: end; }
.pa-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; }
.pa-field-narrow { max-width: 110px; }
.pa-field input, .pa-field select { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; font-size: 13px; }
.pa-field select:disabled { background: #f1f5f9; color: #94a3b8; }
.pa-btn-primary { background: #00c46c; color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.pa-btn-primary:hover { background: #00a85a; }
.pa-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.pa-btn-secondary:hover { background: #e2e8f0; }
.pa-form-hint { margin: 4px 0 0; font-size: 11px; color: #64748b; }
.pa-main { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; min-width: 0; width: 100%; margin: 0; text-align: left; }
.pa-main > * { text-align: left; }
.pa-card { width: 100%; margin: 0; }
.pa-summary { justify-content: flex-start; }
.pa-table-wrap { width: 100%; margin: 0; }
.pa-result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.pa-result-head h4 { margin: 0; font-size: 14px; color: #0f172a; }
.pa-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #fff; }
.pa-card.is-collapsed { padding-bottom: 6px; }
.pa-card-head { width: 100%; }
.pa-card-toggle { background: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 0; flex: 1 1 auto; min-width: 0; text-align: left; color: inherit; }
.pa-card-toggle:hover .pa-chevron { color: #0f766e; }
.pa-chevron { display: inline-block; width: 16px; font-size: 14px; color: #64748b; }
.pa-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pa-btn-freeze { background: #0ea5e9; color: #fff; border: 0; padding: 6px 12px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 12px; }
.pa-btn-freeze:hover:not(:disabled) { background: #0284c7; }
.pa-btn-freeze:disabled { background: #cbd5e1; color: #64748b; cursor: not-allowed; }
.pa-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; padding: 10px; background: #f8fafc; border-radius: 8px; }
.pa-stat { display: flex; flex-direction: column; min-width: 80px; }
.pa-stat span { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.pa-stat b { font-size: 16px; color: #0f172a; }
.pa-stat-big b { font-size: 20px; }
.pa-stat .is-win { color: #16a34a; }
.pa-stat .is-loss { color: #dc2626; }
.pa-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(15,23,42,0.04); }
.pa-table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; font-size: 12.5px; background: #fff; }
.pa-table thead th { position: sticky; top: 0; z-index: 2; background: linear-gradient(180deg,#1e293b,#0f172a); color: #fff; padding: 9px 10px; text-align: left; font-weight: 600; font-size: 11px; letter-spacing: 0.03em; text-transform: uppercase; border-bottom: 2px solid #334155; white-space: nowrap; }
.pa-table thead th small { font-weight: 400; color: #94a3b8; text-transform: none; letter-spacing: 0; }
.pa-table tbody td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: middle; white-space: nowrap; }
.pa-table tbody tr:nth-child(even) td { background: #fafbfc; }
.pa-table tbody tr:hover td { background: #f1f5f9; }
.pa-table .pa-score { display: inline-block; font-weight: 700; color: #0f172a; background: #e2e8f0; padding: 1px 6px; border-radius: 4px; margin-left: 4px; font-size: 11px; }
.pa-table .is-win { background: #d1fae5 !important; color: #065f46; font-weight: 700; }
.pa-table .is-loss { background: #fee2e2 !important; color: #991b1b; font-weight: 700; }
.pa-row-won td { background: #ecfdf5 !important; }
.pa-row-lost td { background: #fef2f2 !important; }
.pa-row-upcoming td { background: #fffbeb !important; }
.pa-row-upcoming { box-shadow: inset 3px 0 0 #f59e0b; }
.pa-cell-match { text-align: left !important; }
.pa-match-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.pa-match-text { flex: 1 1 auto; min-width: 0; }
.pa-match-action { flex: 0 0 auto; }
.pa-freeze-inline { background: linear-gradient(180deg,#fbbf24,#f59e0b); color: #1f2937; border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 11.5px; font-weight: 700; box-shadow: 0 1px 2px rgba(245,158,11,0.35); white-space: nowrap; transition: transform .08s ease, box-shadow .08s ease; }
.pa-freeze-inline:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(245,158,11,0.45); }
.pa-freeze-inline:disabled { opacity: 0.55; cursor: not-allowed; }
.pa-freeze-pending { color: #92400e; font-size: 11px; font-style: italic; opacity: 0.8; white-space: nowrap; }

/* ===== Mobile: tabella -> card stack ===== */
@media (max-width: 720px) {
  .pa-table-wrap { overflow: visible; border: 0; box-shadow: none; }
  .pa-table { min-width: 0; display: block; background: transparent; }
  .pa-table thead { display: none; }
  .pa-table tbody { display: block; }
  .pa-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.05);
  }
  .pa-table tbody tr:nth-child(even) td { background: transparent; }
  .pa-table tbody td {
    border: 0;
    padding: 4px 0;
    text-align: left;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    background: transparent !important;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
  }
  .pa-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #64748b;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: normal;
  }
  .pa-table tbody td.pa-cell-match {
    grid-column: 1 / -1;
    text-align: left !important;
    padding: 6px 8px;
    background: #f8fafc !important;
    border-radius: 6px;
    flex-direction: column;
    align-items: stretch;
  }
  .pa-table tbody td.pa-cell-match::before { margin-bottom: 4px; }
  .pa-row-upcoming { box-shadow: inset 0 0 0 2px #f59e0b !important; }
  .pa-summary { gap: 8px; padding: 8px; }
  .pa-stat { min-width: 70px; }
  .pa-stat b { font-size: 14px; }
  .pa-stat-big b { font-size: 16px; }
  .pa-freeze-inline, .pa-freeze-pending { white-space: normal; }
}

@media (max-width: 480px) {
  .pa-table tbody tr {
    grid-template-columns: 1fr;
  }
}
