/* SOLO il contenuto #max-mercato: nessun cambiamento a header, menu o footer X5 */
#max-mercato{box-sizing:border-box;background:#0e171a;color:#e9f2f3;font:14px Arial,Helvetica,sans-serif;max-width:1160px;margin:0 auto;padding:20px 14px 30px;text-align:left;border-radius:12px}
#max-mercato *{box-sizing:border-box}
#max-mercato .max-mercato-title{text-align:center;background:#18292d;border:1px solid #345459;border-radius:17px;padding:22px 14px;margin:0 0 16px}
#max-mercato .max-mercato-kicker{color:#9ac5cb;font-size:11px;letter-spacing:3px;font-weight:bold}
#max-mercato h2{color:#f6c774!important;font-size:30px!important;font-weight:800!important;margin:8px 0!important;line-height:1.3!important;border:0!important;background:none!important}
#max-mercato .max-mercato-title p{font-size:14px;color:#cae3e7;margin:0}
#max-mercato .max-mercato-sections{display:grid;gap:14px}
#max-mercato .max-mercato-panel{min-width:0;background:#18292d;border:1px solid #36545a;border-radius:13px;padding:13px 14px 16px;overflow:hidden}
#max-mercato h3,#max-mercato .max-mercato-loans-toggle{font:bold 17px Arial,Helvetica,sans-serif!important;color:#f6c774!important;padding:0 0 10px!important;margin:0!important;background:none!important;border:0!important;text-decoration:none!important}
#max-mercato .max-mercato-scroller{max-height:265px;overflow:auto;overscroll-behavior:contain;scrollbar-color:#65868c #16282c;scrollbar-width:thin;border:1px solid #35555a;border-radius:8px;background:#15272c}
#max-mercato .max-mercato-scroller:focus-visible{outline:2px solid #f6c774}
#max-mercato .max-mercato-table{min-width:650px;padding:0 0 2px}
#max-mercato .max-mercato-table table{width:100%!important;min-width:650px;border-collapse:collapse!important;color:#edf5f6!important;background:#182c30!important;font-size:12px!important;margin:0!important}
#max-mercato .max-mercato-table th,#max-mercato .max-mercato-table td{background:transparent!important;color:#eef7f8!important;border:1px solid #35545a!important;padding:9px 8px!important;vertical-align:middle!important;text-align:left!important;word-break:normal}
#max-mercato .max-mercato-table th{background:#253f43!important;color:#f6c774!important;font-weight:bold!important}
#max-mercato .max-mercato-table tr:nth-child(even){background:#20383d!important}
#max-mercato .max-mercato-table a{color:#f6c774!important;text-decoration:none}
#max-mercato .max-mercato-table a:hover{text-decoration:underline}
#max-mercato .max-mercato-table font{color:inherit!important}
#max-mercato .max-mercato-table img{max-width:100%;height:auto}
#max-mercato .max-m-error{color:#f6c774;padding:12px}
#max-mercato .max-mercato-loans-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer;text-align:left;padding-bottom:0!important}
#max-mercato .max-mercato-loans-toggle[aria-expanded="true"]{padding-bottom:12px!important}
#max-mercato .max-mercato-loans-toggle .max-mercato-chevron{font-size:24px;transition:transform .2s}
#max-mercato .max-mercato-loans-toggle[aria-expanded="true"] .max-mercato-chevron{transform:rotate(180deg)}
#max-mercato .max-mercato-loans-content[hidden]{display:none!important}
@media(max-width:720px){#max-mercato{padding:10px}#max-mercato h2{font-size:23px!important}#max-mercato .max-mercato-panel{padding:10px}}

/* FIX V2: nomi delle fantasquadre sempre bianchi, anche quando
   il gestionale applica il giallo/oro a link, span o font.
   La prima riga di intestazione conserva il colore oro. */
#max-mercato .max-mercato-table table tr:not(:first-child) > td:first-child,
#max-mercato .max-mercato-table table tr:not(:first-child) > td:first-child *,
#max-mercato .max-mercato-table table tr:not(:first-child) > td:first-child a,
#max-mercato .max-mercato-table table tr:not(:first-child) > td:first-child font {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* FIX V3: i valori della tabella restano bianchi, anche sulla prima riga.
   I titoli veri (TH) rimangono oro. */
#max-mercato .max-mercato-table table td,
#max-mercato .max-mercato-table table td *,
#max-mercato .max-mercato-table table td font {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
#max-mercato .max-mercato-table table th,
#max-mercato .max-mercato-table table th * {
  color: #f6c774 !important;
  -webkit-text-fill-color: #f6c774 !important;
}

/* Riga di intestazione identificata dal JS: oro anche se usa TD */
#max-mercato .max-mercato-table table tr.max-mercato-head-row > td,
#max-mercato .max-mercato-table table tr.max-mercato-head-row > td * {
  color:#f6c774!important;
  -webkit-text-fill-color:#f6c774!important;
  background:#253f43!important;
  font-weight:bold!important;
}

/* Colonna Gare Lista, penultima nella Lista Infortunati */
#max-mercato .max-gare-lista-heading{background:#253f43!important;color:#f6c774!important;-webkit-text-fill-color:#f6c774!important;text-align:center!important;white-space:nowrap;font-weight:bold!important}
#max-mercato .max-gare-lista-value{color:#fff!important;-webkit-text-fill-color:#fff!important;text-align:center!important;font-weight:bold!important;white-space:nowrap}

/* V5 - tutto centrato, senza alterare i dati o le altre pagine */
#max-mercato, #max-mercato .max-mercato-panel, #max-mercato .max-mercato-table,
#max-mercato .max-mercato-panel h3 {text-align:center!important}
#max-mercato .max-mercato-table table th,
#max-mercato .max-mercato-table table td,
#max-mercato .max-mercato-table table tr.max-mercato-head-row > td {
 text-align:center!important;vertical-align:middle!important
}
#max-mercato .max-mercato-table table{min-width:820px}
#max-mercato .max-mercato-history{margin-top:12px;border:1px solid #36545a;border-radius:9px;padding:10px 8px;background:#20363b}
#max-mercato .max-mercato-history summary{cursor:pointer;color:#f6c774;font-weight:700;padding:6px;text-align:center}
#max-mercato .max-mercato-history[open] summary{margin-bottom:12px}
#max-mercato .max-mercato-loans-toggle{justify-content:center;gap:18px}
#max-mercato .max-m-status-active{color:#aaf0bd!important;-webkit-text-fill-color:#aaf0bd!important;font-weight:700}
#max-mercato .max-m-status-closed{color:#cbdce0!important;-webkit-text-fill-color:#cbdce0!important}
#max-mercato .max-m-help{color:#a9c6cc;font-size:11px;margin:7px 0}
