.hl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.hl-head h1 { font-size: 20px; } .hl-head .cnt { color: var(--c-muted); font-size: 14px; font-weight: 500; margin-left: 6px; }
.view-toggle { display: inline-flex; border: 1px solid var(--c-border); border-radius: 999px; padding: 3px; gap: 2px; }
.view-toggle button { border: 0; background: transparent; padding: 0 14px; border-radius: 999px; cursor: pointer; color: var(--c-muted); font-weight: 500; }
.view-toggle button[aria-pressed="true"] { background: var(--c-accent); color: #fff; }
.filters { margin-top: 12px; border: 1px solid var(--c-border); border-radius: 10px; padding: 12px; }
.filters > summary { display: none; }
.f-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr 1fr; }
.f-grid .f-search { grid-column: 1 / -1; position: relative; }
.sug { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 360px; overflow: auto;
  background: #fff; border: 1px solid var(--c-border-strong); border-radius: 8px; color: var(--c-text); }
.sug[hidden] { display: none; }
.sug li { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.sug li[aria-selected="true"], .sug li:hover { background: var(--c-none); }
.sug .sl b { font-weight: 700; }
.sug .ss { font-size: 12px; color: var(--c-muted); }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--c-muted); min-width: 0; }
.field input, .field select { font: inherit; font-size: 14px; color: var(--c-text); border: 1px solid var(--c-border); border-radius: 6px; padding: 0 10px; background: #fff; min-width: 0; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.chip { border: 1px solid var(--c-border); background: #fff; border-radius: 999px; padding: 0 14px; cursor: pointer; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.matches { margin-left: auto; font-size: 13px; color: var(--c-muted); }
.results { margin-top: 12px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-bottom: 1px solid var(--c-border); }
/* intestazione della tabella sempre visibile quando si scorre dentro il contenitore */
table.hl thead th { position: sticky; top: 0; z-index: 2; }
.scroll-hint { display: none; font-size: 12px; color: var(--c-muted); margin: 0 0 6px; }
table.hl { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; font-size: 14px; table-layout: fixed; }
table.hl th { white-space: nowrap; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 10px 8px; border-bottom: 3px solid var(--c-border); background: #fff; }
table.hl th.d { color: var(--c-dem-text); border-bottom-color: var(--c-dem); }
table.hl th.r { color: var(--c-rep-text); border-bottom-color: var(--c-rep); }
table.hl th.o { color: var(--c-ind-text); border-bottom-color: var(--c-ind); }
table.hl td { padding: 6px 8px; border-bottom: 1px solid var(--c-border); vertical-align: middle; overflow-wrap: anywhere; }
table.hl td.c-dist { white-space: nowrap; }
table.hl td.num { white-space: nowrap; }
.dist { display: flex; align-items: center; gap: 4px; }
.dist a, .dist .nm { font-weight: 600; color: var(--c-accent); }
.star, .xp { width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; font-size: 18px; line-height: 1; color: var(--c-muted); flex: 0 0 auto; }
.star[aria-pressed="true"] { color: #C58B00; }
.xp { border: 1px solid var(--c-border); border-radius: 50%; width: 32px; height: 32px; min-height: 32px; font-size: 12px; margin-left: auto; position: relative; }
.xp::before { content: ''; position: absolute; inset: -6px; }
.xp[aria-expanded="true"] { transform: rotate(180deg); }
.lead { font-weight: 600; } .lead .mg { font-weight: 400; color: var(--c-muted); }
.wait { color: var(--c-muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--c-border); margin-left: 4px; color: var(--c-muted); }
.tag.called { border-color: var(--c-text); color: var(--c-text); }
tr.detail td { background: #FAFBFC; padding: 12px 16px; }
.detail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.detail li { display: flex; justify-content: space-between; gap: 12px; }
.detail .pm { color: var(--c-muted); font-size: 12px; margin-top: 8px; }
.mine-hint { margin: 0 0 10px; padding: 10px 14px; border-radius: 6px; font-size: 13px; background: var(--c-none); border: 1px solid var(--c-border); color: var(--c-text); }
.more { display: block; margin: 14px auto 0; padding: 0 20px; border: 1px solid var(--c-border-strong); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 500; }
/* Schede */
.cards { display: grid; gap: 10px; grid-template-columns: 1fr; }
.card { border: 1px solid var(--c-border); border-radius: 10px; padding: 10px 12px; }
.card .top { display: flex; align-items: center; gap: 4px; }
.card .top .xp { margin-left: auto; }
.card .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 3px 0; }
.card .row .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; flex: 0 0 auto; }
.card .row .v { text-align: right; overflow-wrap: anywhere; }
@media (min-width: 470px) and (max-width: 999px) { .cards { grid-template-columns: 1fr 1fr; } table.hl .c-oth { display: none; } table.hl { min-width: 700px; } }
/* Mobile (< 500 px): vista a 10 righe. L'area dei risultati ha altezza massima fissa (10 righe ≈ 810 px), con scorrimento verticale e
   orizzontale al suo interno; "Mostra altri 10" aggiunge righe dentro l'area senza cambiare l'altezza dell'embed.
   overscroll-behavior-y: auto -> a fine corsa lo scorrimento passa alla pagina (niente "trappola" di scroll). */
@media (max-width: 499px) {
  .scroll-hint { display: block; }
  table.hl { min-width: 820px; }
  .tbl-wrap, .cards { max-height: 830px; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; overscroll-behavior-x: contain; overscroll-behavior-y: auto; }
  .tbl-wrap { border: 1px solid var(--c-border); border-radius: 8px; }
  .cards { padding: 2px; }
}
@media (max-width: 469px) {
  .filters > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 600; list-style: none; }
  .f-grid { grid-template-columns: 1fr; margin-top: 10px; }
  .field input, .field select { min-height: 44px; }
  .hl-head h1 { font-size: 18px; }
}
@media (min-width: 470px) { .filters > summary { display: none; } .field input, .field select { min-height: 40px; } }
