:root {
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #111827;
  --accent: #00c46c;
  --muted: #6b7280;
  --border: #d1d5db;
}
.pred-table th:last-child,
.pred-table td:last-child {
  width: 80px;
  font-weight: 600;
  color: #374151;
}
/* ---------- 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 {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #f1f5f9;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 10px 0;
}
#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;
}
#competitionList 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;   /* dimensione testo ridotta */
  transition: background 0.2s;
}
#competitionList li:hover {
  background: #e2e8f0;
}
#competitionList li.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

/* ---------- MAIN LAYOUT ---------- */
main {
  margin-left: 240px;
  padding: 0 20px;   /* ✅ spazio di 20px tra sidebar e contenuto */
  transition: margin-left 0.3s ease;
}

/* ---------- 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: 100%;
  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;
  -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;
}
.team {
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  white-space: normal;             /* i nomi lunghi vanno a capo */
  word-break: break-word;
}
.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;
}
#sidebar { transition: transform 0.3s ease; }
#sidebar.active { transform: translateX(0); }
#overlay.show { display: block; }

/* ---------- 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-footer {
  text-align: center;
  padding: 12px 0;
  font-weight: 600;
  cursor: pointer;
  border-top: 1px solid #d1d5db;
  background: #e2e8f0;
  color: #111827;
  transition: background 0.2s;
}
.sidebar-footer:hover {
  background: #cbd5e1;
}
/* --- 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(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}

.overlay-content {
  text-align: center;
  padding: 24px 48px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  color: #1f2937;
}

.overlay-content h2 {
  font-size: 26px;
  margin-bottom: 10px;
  color: #0284c7;
}
.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 adattiva --- */
/* --- Sidebar toggle valida per desktop e mobile --- */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #f1f5f9;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 10px 0;
  transform: translateX(0);               /* visibile di default */
  transition: transform 0.3s ease;
  z-index: 1000;
}

#sidebar.closed {
  transform: translateX(-100%);           /* chiusa */
}

main {
  margin-left: 240px;
  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;
}
.hamburger {
  position: relative;
  z-index: 2000;
}
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 900;
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}

#overlay.show {
  display: block;
  opacity: 1;
  pointer-events: all; /* attivo solo quando visibile */
}
/* ─── 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;
}

/* blocca ingrandimento su schermi piccoli */
@media (max-width: 768px) {
  #televideoMini {
    width: 70px;
    height: 50px;
  }
}

/* ─── 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: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 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: fixed;          /* resta fissa anche durante lo scroll */
  top: 0;
  left: 240px;              /* inizia subito dopo la sidebar */
  right: 0;
  width: calc(100% - 240px); /* copre tutto il main */
  z-index: 100;
}
main {
  margin-top: 60px;         /* evita che la prima tabella resti sotto la barra */
}
main.full .topbar {
  left: 0;
  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 */
@media (max-width: 600px) {
  .ai-chat {
    width: 90%;
    height: 70%;
    right: 5%;
    bottom: 10px;
  }
}
/* 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; }
}