/* Tema condiviso: caricato dopo gli stili delle singole pagine. Revisione 2. */
html { color-scheme: dark; }
body { background:#101010 !important; color:#ededed; font-family:'Segoe UI Variable','Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif; line-height:1.5; }
body::before, .wrap::before { background:#101010 !important; }
.bg-noise, .team-backdrop { display:none; }
body .topbar { background:#1a1a1a !important; border:1px solid #292929; border-radius:8px; box-shadow:none; backdrop-filter:none; padding:22px 24px; }
body .topbar::before, body .topbar::after { content:none; }
body .topbar .brand > img { height:76px; object-fit:contain; }
body .topbar .titlebox { line-height:1.25; transform:none; }
body .topbar .titlebox .title { font-size:26px !important; font-weight:700 !important; letter-spacing:-.5px !important; white-space:normal; }
body .topbar .sub { color:#a3a3a3; font-size:13px; }
body .topbar .rightlogo img { max-height:36px; }
body .topbar:has(.archiveNav) { padding-bottom:58px; }
body .topbar .archiveNav { bottom:10px; }
body .topbar .archiveNavItem { border-radius:5px; }
body .topbar .archiveNavItem[aria-current], body .topbar .archiveNavItem.archiveNavReturn { background:#162631; color:#65b9ef; border-color:#28516b; box-shadow:none; backdrop-filter:none; }
body .topbar .archiveNavItem::before { content:none !important; }
body .topbar .archiveNavItem:hover { background:#202c34; box-shadow:none; transform:none; }
body .card, body .cat { background:#131313; border-color:#2a2a2a; border-radius:8px; box-shadow:none; backdrop-filter:none; }
body .cardHead { background:#191919; border-color:#292929; padding:18px 20px; }
body .videoTitle, body .catTitleRow h3, body .card h3 { font-weight:600; letter-spacing:0; }
body .cat { padding:20px; margin:16px 0; }
body .catTitleRow { border-color:#292929; padding-bottom:14px; margin-bottom:10px; }
body .cat ol { list-style:none; padding-left:0 !important; }
body .videoLink { color:#e1e1e1; border-radius:4px; padding:10px 8px; line-height:1.6; }
body .videoLink:hover { background:#1c1c1c; transform:none; text-decoration:none; }
body .playDot { box-shadow:none; }
body .videoLink .playDot { clip-path:polygon(15% 0,100% 50%,15% 100%); border-radius:0; }
body .muted, body .small, body .card-meta, body .note, body .crumbs, body .userbar { color:#a3a3a3; }
body .badge, body .pill, body .legendItem { background:#191919; border-color:#303030; color:#aaa; border-radius:5px; }
body .pill.catpill { color:#66baf0; background:#14232e; border-color:#28516b; }
body .btn, body .crumbs a, body .userbar a, body .studyToolsLink { background:#1b1b1b; border:1px solid #333; color:#e5e5e5; border-radius:6px; box-shadow:none; font-weight:500; }
body .btn:hover, body .crumbs a:hover, body .userbar a:hover, body .studyToolsLink:hover { background:#242424; border-color:#555; transform:none; }
body .btnPrimary, body .btn.primary { background:#142936; border-color:#286083; color:#78c6f7; }
body .btnPrimary:hover, body .btn.primary:hover { background:#1b374a; border-color:#389bd9; }
body .btn.danger { background:#301a1a; border-color:#7a3939; color:#ffb5b5; }
body input:not([type=checkbox]):not([type=radio]):not([type=hidden]), body select, body textarea { background:#151515; color:#ededed; border:1px solid #3c3c3c; border-radius:6px; }
body input::placeholder, body textarea::placeholder { color:#999; }
body a:focus-visible, body button:focus-visible, body input:focus-visible, body select:focus-visible, body textarea:focus-visible { outline:2px solid #389bd9; outline-offset:3px; }
body button:disabled { opacity:.5; cursor:not-allowed; }
body .studyToolsTitle { color:#389bd9; font-size:11px; letter-spacing:1.2px; }
body .focusPreview { background:#191919; border-color:#3b3b3b; box-shadow:0 8px 24px #0008; }
body .focusPreview::after { content:none; }
body .focusPreviewCredit { background:#191919; }
body.archiveHome .left { gap:0; }
body.archiveHome .left > .card { border-radius:0; border-bottom:0; min-height:104px; padding:20px 18px; }
body.archiveHome .left > .card:first-child { border-radius:8px 8px 0 0; }
body.archiveHome .left > .card:nth-child(3) { border-bottom:1px solid #2a2a2a; border-radius:0 0 8px 8px; }
body.archiveHome .card-icon { filter:none; }
/* Calendario: conserva immagine, cornice, dimensioni e interazioni originali. */
body.archiveAdmin { margin:24px; }
body.archiveAdmin a:not(.btn) { color:#6cbbef; }
body.archiveAdmin table { background:#131313; color:#ededed; }
body.archiveAdmin th { background:#202020; color:#bbb; }
body.archiveAdmin td, body.archiveAdmin th { border-color:#333; }
body.archiveAdmin tr:hover td { background:#1c1c1c; }
body.archiveAdmin .dnd-item, body.archiveAdmin .handle { background:#1c1c1c; color:#ddd; border-color:#333; }
body.archiveAdmin .ok { color:#82d5a4; background:#15291c; border-color:#325e40; }
body.archiveAdmin .err, body .error { color:#ffb5b5; background:#301a1a; border-color:#7a3939; }
body.archiveAdmin .filters, body.archiveAdmin .metric, body.archiveAdmin .section, body.archiveAdmin .archiveCard { background:#191919; border-color:#333; border-radius:8px; }
body.archiveAdmin .track { background:#303030; }
body.archiveAdmin .notice { background:#142936; border-color:#28516b; }
body.archiveAdmin .warn, body.archiveAdmin .bad, body.archiveAdmin .stSleep { background:#302817; color:#e8cb84; border-color:#64532d; }
body.archiveAdmin .good, body.archiveAdmin .stActive { background:#15291c; color:#82d5a4; border-color:#325e40; }
body.archiveAdmin .stOff { background:#301a1a; color:#ffb5b5; border-color:#7a3939; }
body.archiveAdmin .tag, body.archiveAdmin .count, body.archiveAdmin .stNever { background:#202020; color:#bbb; border-color:#3a3a3a; }
body.archiveAdmin .trendLabel, body.archiveAdmin .empty { color:#aaa; }
@media(max-width:720px) {
  body .topbar { padding:14px !important; gap:10px !important; }
  body .topbar:has(.archiveNav) { padding-bottom:62px !important; }
  body .topbar .brand > img { height:56px !important; }
  body .topbar .titlebox .title { font-size:19px !important; }
  body .topbar .rightlogo img { max-height:28px; max-width:76px; }
  body .topbar .archiveNav { left:12px; right:auto; max-width:calc(100% - 24px); transform:none; }
  body .cat { padding:12px; }
  body.archiveHome .left > .card { padding:16px 12px; }
  body.archiveAdmin { margin:12px; }
}

/* Fascia piatta e gerarchia tipografica del riferimento Cash. */
body:not(.archiveAdmin) > .wrap { padding-top:0; }
body .topbar {
  top:0; border:0; border-bottom:1px solid #292929; border-radius:0;
  padding:24px 0; background:#1b1b1b !important;
  box-shadow:0 0 0 100vmax #1b1b1b;
  clip-path:inset(0 -100vmax);
}
body::before, body .wrap::before { content:none !important; }
body .topbar .brand { gap:18px; }
body .topbar .brand > img { height:60px; }
body .topbar .titlebox::before {
  content:'SCUDERIA MTT'; color:#329ddd; font-size:10px; font-weight:700;
  letter-spacing:1.4px; margin-bottom:8px;
}
body .topbar .titlebox .title { font-size:28px !important; font-weight:600 !important; letter-spacing:-.6px !important; }
body .topbar .titlebox .sub { margin-top:7px; font-size:12px; color:#a0a0a0; }
body .topbar .rightlogo img { max-height:30px; opacity:.85; }
body .topbar:has(.archiveNav) { padding-bottom:66px; }
body .topbar .archiveNav { left:0; bottom:12px; transform:none; }
body .topbar .archiveNavItem { padding:4px 10px; font-size:11px; font-weight:500; }
body.archiveEntryDestination .wrap { max-width:1100px; }
body.archiveEntryDestination .wrap > .card {
  margin-top:36px; border:0; border-radius:0; background:transparent; overflow:visible;
}
body.archiveEntryDestination .cardHead {
  padding:0 0 16px; background:transparent; border:0; gap:16px;
}
body.archiveEntryDestination .cardHead .videoTitle {
  color:#389bd9; font-size:12px !important; letter-spacing:1.1px;
  font-weight:600; white-space:normal;
}
body.archiveEntryDestination .viewerBody { padding:0 !important; }
body.archiveEntryDestination .cat { background:transparent; border:0; padding:0; margin:28px 0; }
body.archiveEntryDestination .catTitleRow { border:0; margin:0 0 14px; padding:0; justify-content:flex-start; align-items:center; }
body.archiveEntryDestination .catTitleRow h3 { font-size:19px; font-weight:600; }
body.archiveEntryDestination .catTitleRow .badge { background:transparent; border:0; padding:0; color:#999; }
body.archiveEntryDestination ol {
  list-style:none; margin:0; padding:8px 14px !important;
  border:1px solid #2b2b2b; border-radius:8px; background:#101010;
}
body.archiveEntryDestination ol > li { padding:2px 0; }
body.archiveEntryDestination .videoLink { padding:10px 8px; font-size:14px; }
body.archiveEntryDestination .legendItem { border:0; background:transparent; padding-left:0; }
body.archiveHome .userbar { margin-top:24px; }
body.archiveHome .layout { margin-top:28px; }
body.archiveHome .left::before {
  content:'CONTENUTO DELL’ARCHIVIO'; display:block; margin-bottom:18px;
  color:#389bd9; font-size:11px; font-weight:600; letter-spacing:1.2px;
}
body.archiveHome .left > .card { background:transparent; min-height:94px; }
body.archiveHome .card h3 { font-size:16px; font-weight:600; }
body.archiveHome .card-cta .btn { background:transparent; color:#64b7ec; border-color:#303030; font-size:12px; }
/* Il vecchio foglio condivisione impone un fondo chiaro con !important. */
body .btn[data-archive-share], body .archive-share-dialog .btn {
  color:#eaf6ff !important; background:#173247 !important; border-color:#38627f !important;
}
body .btn[data-archive-share]:hover, body .archive-share-dialog .btn:hover {
  color:#fff !important; background:#23465e !important; border-color:#68b4e8 !important;
}
body .archive-share-dialog .btn.primary { color:#101010 !important; background:#79c9fa !important; border-color:#79c9fa !important; }
body .archive-share-dialog .btn.primary:hover { background:#a4dcff !important; }
body .archive-share-dialog { background:#1a1a1a; border-color:#3b3b3b; border-radius:8px; }
@media(max-width:720px) {
  body .topbar { padding:18px 0 !important; }
  body .topbar .brand > img { height:48px !important; }
  body .topbar .titlebox .title { font-size:20px !important; }
  body .topbar .titlebox::before { font-size:9px; margin-bottom:5px; }
  body .topbar .archiveNav { left:0; max-width:100%; }
  body.archiveEntryDestination .wrap > .card { margin-top:28px !important; }
  body.archiveEntryDestination .cardHead { padding:0 0 14px !important; }
  body.archiveEntryDestination ol { padding:6px !important; }
  body.archiveEntryDestination .videoLink { font-size:13px; }
}

/* Marchio in filigrana: finestra CSS sul solo cavallo, senza alterare il PNG. */
body { isolation:isolate; }
body::after {
  content:'' !important; position:fixed; z-index:-1; pointer-events:none;
  left:50%; top:55%; transform:translate(-50%,-50%);
  width:min(78vw,850px); aspect-ratio:1254 / 980;
  background:url('img/scuderia-watermark-source.png') center top / 100% auto no-repeat;
  opacity:.065;
}
body .topbar .brand > img { height:102px !important; width:auto; max-width:130px; }
body .topbar .rightlogo img { height:58px !important; max-height:58px; width:auto; max-width:210px; opacity:1; }
body .topbar .titlebox .title {
  font-family:'Segoe UI Variable','Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  font-weight:650 !important; letter-spacing:-1px !important; line-height:1.15;
}
body .topbar .titlebox::before { font-family:Consolas,'Courier New',monospace; letter-spacing:2px; }
body h1, body h2, body h3, body .videoTitle, body .videoLink, body .dnd-item .title {
  font-family:'Segoe UI Variable','Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
}
body .videoLink { font-weight:500; letter-spacing:-.15px; }
body .catTitleRow h3, body.archiveHome .card h3 { font-weight:650; letter-spacing:-.4px; }
body.archiveEntryDestination ol { background:rgba(16,16,16,.8); }
@media(max-width:720px) {
  body .topbar .brand > img { height:76px !important; max-width:84px; }
  body .topbar .rightlogo img { height:38px !important; max-height:38px; max-width:118px; }
  body .topbar .brand { gap:12px; }
  body .topbar .titlebox .title { letter-spacing:-.6px !important; }
  body::after { width:94vw; opacity:.045; }
}
/* Etichette blu leggibili anche sui display piccoli. */
body .topbar .titlebox::before { font-size:14px; letter-spacing:1.6px; line-height:1.4; }
body.archiveEntryDestination .cardHead .videoTitle { font-size:15px !important; letter-spacing:.8px; }
body.archiveHome .left::before, body .studyToolsTitle { font-size:14px; letter-spacing:.8px; }
body .pill.catpill { font-size:13px !important; }
body.archiveHome .card-cta .btn { font-size:14px; }
body .previewLoader {
  position:absolute; inset:0 0 auto; aspect-ratio:16/9; background:#141414;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; z-index:3; color:#c6d5df; font-size:12px;
}
.previewHorse { width:90px; height:70px; position:relative; overflow:hidden; }
.previewHorse::before, .previewHorse i {
  content:''; position:absolute; inset:0; background:#41474b;
  mask:url('img/scuderia-watermark-source.png') center top / 90px 90px no-repeat;
  mask-mode:luminance;
  -webkit-mask:url('img/scuderia-watermark-source.png') center top / 90px 90px no-repeat;
}
.previewHorse i { background:#2aa3ff; clip-path:inset(calc(100% - var(--fill, 12%)) 0 0); transition:clip-path .45s ease; }
body.archiveLogin .center { display:flex; flex-direction:column; align-items:center; gap:20px; }
body.archiveLogin .loginHorse {
  width:170px; aspect-ratio:1254 / 980; flex-shrink:0;
  background:url('img/scuderia-watermark-source.png') center top / 100% auto no-repeat;
}
body.archiveLogin .center > .card { width:100%; max-width:440px; }
@media(max-width:720px) {
  body .topbar .titlebox::before { font-size:12px; letter-spacing:1.2px; }
  body.archiveEntryDestination .cardHead .videoTitle { font-size:14px !important; }
  body.archiveLogin .loginHorse { width:130px; }
}
@media(prefers-reduced-motion:reduce) { .previewHorse i { transition:none; } }