:root {
  --bg: #f4f5f7; --card: #fff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb; --accent-text: #fff; --now: #16a34a; --cancel: #dc2626;
  --header: #0f172a; --header-text: #f8fafc; --header-btn: #1e293b; --video: #7c3aed;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --card: #151b2e; --text: #e5e7eb; --muted: #94a3b8; --line: #263049;
    --accent: #3b82f6; --now: #4ade80; --cancel: #f87171; --header: #050814; --video: #8b5cf6;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; max-width: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; cursor: pointer; }
header { position: sticky; top: 0; z-index: 5; background: var(--header); color: var(--header-text);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
h1 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sedi { position: relative; flex: 0 0 auto; align-self: center; display: flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 9px; background: var(--accent); color: var(--accent-text); border-radius: 8px;
  font-size: 12px; font-weight: 700; }
.sedi::after { content: ""; border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0; }
/* la select è invisibile sopra l'etichetta: chiusa si vede solo la sigla, aperta l'elenco nativo */
.sedi select { position: absolute; inset: 0; width: 100%; opacity: 0; font-size: 16px; cursor: pointer; }
.sub { font-size: 12px; opacity: .7; }
.nav { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.nav button { flex: 0 0 auto; background: var(--header-btn); color: inherit; border: 0; border-radius: 10px;
  height: 36px; min-width: 40px; padding: 0 12px; font-size: 15px; }
.nav .date { flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: 15px; text-transform: capitalize; }
.slots { display: flex; gap: 6px; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.slots::-webkit-scrollbar { display: none; }
.slot { flex: 0 0 auto; border: 1px solid #334155; background: transparent; color: var(--header-text);
  border-radius: 999px; padding: 6px 12px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slot small { font-weight: 500; opacity: .7; margin-left: 4px; }
.slot.past { opacity: .45; }
.slot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); opacity: 1; }
/* filtri: docente + sola videoconferenza */
.filtri { display: flex; gap: 6px; margin-top: 8px; }
.filtri select, .filtri button { height: 34px; border-radius: 10px; border: 1px solid #334155;
  background: var(--header-btn); color: var(--header-text); font-size: 14px; }
.filtri select { flex: 1; min-width: 0; padding: 0 8px; font-size: 16px; }
.filtri button { flex: 0 0 auto; padding: 0 12px; font-weight: 600; }
.filtri [hidden] { display: none; }
.filtri #noFiltriTop { padding: 0; width: 34px; }
.filtri .on { background: var(--video); border-color: var(--video); color: #fff; }
main { padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
.hero { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.hero button { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 20px; }
.hero button:disabled { opacity: .3; }
.hero .mid { flex: 1; text-align: center; }
.hero .ora { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero .info { font-size: 13px; color: var(--muted); }
.summary { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  margin-bottom: 10px; font-size: 15px; }
.summary b { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.card { overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent);
  border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.card.video { border-left-color: var(--video); }
.vc { margin-top: 6px; font-size: 14px; }
.badge.vc-badge { background: var(--video); margin: 0 0 2px; }
.vc-con { font-weight: 600; }
.vc-note { color: var(--muted); font-size: 13px; white-space: pre-line; }
.vc-giorno { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 10px; padding: 10px 12px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-left: 5px solid var(--video);
  border-radius: 12px; font-size: 15px; font-weight: 600; text-align: left; }
.vc-giorno span:first-child { flex: 1; }
.vc-giorno b { background: var(--video); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 13px; }
.giorno-head { text-align: center; margin: 0 0 6px; }
.giorno-head .link { display: block; padding: 4px 0; text-decoration: none; font-weight: 600; }
.giorno-head h2 { margin: 2px 0; font-size: 20px; }
.giorno-head .info { font-size: 13px; color: var(--muted); }
.ora-gruppo { margin: 16px 0 2px; font-size: 15px; font-weight: 800; color: var(--video); font-variant-numeric: tabular-nums; }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 8px; font-size: 15px; }
.card.cancel { border-left-color: var(--cancel); opacity: .75; }
.card.cancel .aula, .card.cancel .lez { text-decoration: line-through; }
.row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.aula { font-size: 22px; font-weight: 800; }
.fine { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lez { margin-top: 4px; font-size: 15px; }
.doc { margin-top: 2px; font-size: 14px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  color: #fff; background: var(--cancel); margin-top: 6px; }
.msg { text-align: center; color: var(--muted); padding: 40px 0; }
.err { color: var(--cancel); }

/* index.html */
.citta { margin: 18px 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.intro { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.sede-card { display: flex; align-items: center; gap: 12px; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px; margin: 8px 0; text-decoration: none; }
.sede-codice { flex: 0 0 auto; min-width: 64px; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 800;
  border-radius: 8px; padding: 6px 8px; text-align: center; }
.sede-nome { flex: 1; font-size: 18px; font-weight: 700; }
.sede-freccia { color: var(--muted); font-size: 22px; }
