/* Barra in alto condivisa da tutte le pagine (vetrina, regole, indici, lista d attesa, privacy) e, per le parti .tbar, anche dall app.
   Tutto sotto .site-top, così non si mescola con gli stili delle pagine. */
.site-top { display: flex; align-items: center; gap: 14px; padding: 0 20px; min-height: 54px; box-sizing: border-box;
  border-bottom: 1px solid #273142; background: #151b24; position: sticky; top: 0; z-index: 30;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: normal; }
.site-top * { box-sizing: border-box; }
.site-top .logo { font-weight: 700; font-size: 18px; letter-spacing: .3px; text-decoration: none; color: #e6edf3; white-space: nowrap; }
.site-top .logo span { color: #f5c542; }
.site-top .spacer { flex: 1; }
.site-top .items { display: contents; }
.site-top .topnav { display: flex; gap: 2px; margin-left: 10px; }
.site-top .topnav a { color: #e6edf3; text-decoration: none; font-weight: 600; font-size: 14px; padding: 7px 11px; border-radius: 7px; }
.site-top .topnav a:hover, .site-top .topnav a.on { color: #f5c542; }
.site-top .topnav a:hover { background: #1c2430; }
.site-top .badge { padding: 3px 8px; border-radius: 999px; background: #1c2430; border: 1px solid #5a4a14; font-size: 12px;
  color: #f5c542; font-weight: 700; letter-spacing: .5px; }
.site-top .signin { padding: 6px 13px; border-radius: 8px; background: #f5c542; color: #1a1500; font-weight: 700;
  text-decoration: none; font-size: 13px; white-space: nowrap; }
.site-top .profile { position: relative; }
.site-top .avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #273142; background: #1c2430;
  color: #f5c542; font-weight: 700; cursor: pointer; font-size: 14px; font-family: inherit; }
.site-top .avatar:hover { border-color: #8b98a9; }
.site-top .pmenu { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: #151b24;
  border: 1px solid #273142; border-radius: 10px; padding: 6px; z-index: 40; box-shadow: 0 14px 34px rgba(0,0,0,.5); }
.site-top .profile.open .pmenu { display: grid; }
.site-top .pmenu a, .site-top .pmenu button { text-align: left; padding: 9px 10px; border-radius: 7px; background: none; border: 0;
  color: #e6edf3; text-decoration: none; cursor: pointer; font: inherit; font-size: 14px; }
.site-top .pmenu a:hover, .site-top .pmenu button:hover { background: #1c2430; }
.site-top .pmenu .pname { padding: 8px 10px 10px; font-weight: 700; border-bottom: 1px solid #273142; margin-bottom: 4px; }
.site-top .menubtn { display: none; background: none; border: 0; color: #e6edf3; padding: 4px; margin-left: auto; cursor: pointer; }
.site-top .menubtn svg { width: 26px; height: 26px; display: block; }
.site-top-bg { display: none; }
.site-top [hidden] { display: none !important; }

/* Stessa barra di scorrimento della pagina dell'app (sottile), così tutto è allineato. */
html { scrollbar-gutter: stable; }
html::-webkit-scrollbar { width: 8px; } html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: #273142; border-radius: 4px; }
@supports (-moz-appearance: none) { html { scrollbar-width: thin; scrollbar-color: #273142 transparent; } }

/* Telefono: solo logo e icona del menu; il resto in un menu laterale (come nell'app). */
@media (max-width: 759px) {
  /* Sopra lo sfondo scuro del menu laterale (il menu sta dentro la barra), come nell'app. */
  .site-top { padding: 0 8px; min-height: 51px; gap: 6px 10px; z-index: 33; }
  .site-top .logo { font-size: 17px; }
  .site-top .menubtn { display: block; }
  .site-top .items { display: flex; flex-direction: column; align-items: stretch; gap: 10px; position: fixed; top: 0; right: 0;
    bottom: 0; width: min(300px, 84vw); background: #151b24; border-left: 1px solid #273142; z-index: 32;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; transform: translateX(100%);
    transition: transform .2s ease; box-shadow: -12px 0 30px rgba(0,0,0,.45); }
  body.site-drawer-open .site-top .items { transform: none; }
  body.site-drawer-open .site-top-bg { display: block; position: fixed; inset: 0; background: rgba(5,8,12,.6); z-index: 31; }
  .site-top .spacer { display: none; }
  .site-top .topnav { order: -1; flex-direction: column; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid #273142; }
  .site-top .topnav a { font-size: 15px; padding: 11px 12px; }
  .site-top .badge { order: -2; align-self: flex-start; }
  .site-top .signin { text-align: center; padding: 11px 12px; font-size: 15px; }
  .site-top .profile .avatar { display: none; }
  .site-top .pmenu { display: grid; position: static; border: 0; box-shadow: none; padding: 0; min-width: 0; background: none; }
  .site-top .pmenu a, .site-top .pmenu button { font-size: 15px; padding: 10px 12px; }
}

/* --- Parti della barra uguali in app e pagine (classe .tbar su entrambe le barre) --- */
.tbar .topnav { align-items: center; }
.tbar .tdrop { position: relative; }
.tbar .tdlabel { display: inline-flex; align-items: center; gap: 4px; color: #e6edf3; font-weight: 600; font-size: 14px;
  padding: 7px 11px; border-radius: 7px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.tbar .tdrop:hover .tdlabel, .tbar .tdlabel.on { color: #f5c542; }
.tbar .tdrop:hover .tdlabel { background: #1c2430; }
.tbar .caret { width: 14px; height: 14px; opacity: .7; }
.tbar .tdmenu { display: none; position: absolute; left: 0; top: 100%; min-width: 230px; padding: 6px; background: #151b24;
  border: 1px solid #273142; border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.5); z-index: 40; }
.tbar .tdrop:hover:not(.shut) .tdmenu, .tbar .tdrop.open .tdmenu { display: grid; }
.tbar .tdmenu a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 9px 10px;
  border-radius: 7px; color: #e6edf3; text-decoration: none; font-weight: 500; font-size: 14px; background: none; }
.tbar .tdmenu a:hover { background: #1c2430; color: #f5c542; }
.tbar .tdmenu .muted { padding: 9px 10px; color: #8b98a9; font-size: 13px; }
.tbar .tk { color: #8b98a9; font-size: 12px; font-weight: 700; letter-spacing: .4px; }
.tbar .iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #8b98a9;
  background: none; border: 0; cursor: pointer; position: relative; text-decoration: none; font: inherit; }
.tbar .iconbtn:hover, .tbar .bell.open .iconbtn { color: #e6edf3; background: #1c2430; }
.tbar .iconbtn svg { width: 19px; height: 19px; }
.tbar .iconbtn .lbl { display: none; }
.tbar .bell { position: relative; }
.tbar .bcount { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #f5c542; color: #111; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.tbar .bcount.crit { background: #f04b4b; color: #fff; }
.tbar .bmenu { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: 420px; overflow-y: auto;
  padding: 6px; background: #151b24; border: 1px solid #273142; border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.5); z-index: 40; }
.tbar .bell.open .bmenu { display: block; }
.tbar .bhead { padding: 8px 10px 10px; font-weight: 700; color: #e6edf3; border-bottom: 1px solid #273142; margin-bottom: 4px; }
.tbar .bitem { padding: 9px 10px; border-radius: 7px; color: #c9d1d9; font-size: 13px; line-height: 1.4; border-left: 3px solid transparent; }
.tbar .bitem.new { background: #1c2430; color: #e6edf3; }
.tbar .bitem.critical { border-left-color: #f04b4b; } .tbar .bitem.warning { border-left-color: #f5c542; }
.tbar .bitem .when { color: #8b98a9; font-size: 11px; margin-top: 3px; }
.tbar .bempty { padding: 12px 10px; color: #8b98a9; font-size: 13px; line-height: 1.5; }
.tbar .balert { display: block; padding: 9px 10px; margin-bottom: 4px; border-radius: 7px; background: #2a2412; color: #f5c542;
  text-decoration: none; font-size: 13px; font-weight: 600; }
.tbar .balert.crit { background: #2c1518; color: #f04b4b; }
.tbar .pequity { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px 11px; color: #8b98a9; font-size: 13px;
  border-bottom: 1px solid #273142; margin-bottom: 4px; }
.tbar .pequity b { color: #e6edf3; }
.tbar .pmenu { min-width: 230px; }
.tbar .pmenu .pname { display: grid; gap: 2px; }
.tbar .pmenu .psub { font-size: 11px; font-weight: 500; color: #8b98a9; }
.tbar .pmenu a, .tbar .pmenu button { display: flex; align-items: center; gap: 10px; }
.tbar .pmenu a svg, .tbar .pmenu button svg { width: 16px; height: 16px; flex: none; color: #8b98a9; }
.tbar .pmenu .psep { height: 1px; background: #273142; margin: 4px 2px; }

/* Telefono: nel menu laterale i menu a tendina sono già aperti, le icone hanno la loro scritta. */
@media (max-width: 759px) {
  .tbar .topnav { align-items: stretch; }
  .tbar .tdrop { display: block; }
  .tbar .tdlabel { font-size: 15px; padding: 11px 12px; width: 100%; }
  .tbar .tdrop:hover .tdlabel { background: none; }
  .tbar .caret { display: none; }
  .tbar .tdmenu, .tbar .tdrop:hover:not(.shut) .tdmenu { display: grid; position: static; border: 0; box-shadow: none;
    background: none; padding: 0 0 4px 12px; min-width: 0; }
  .tbar .tdmenu a { font-size: 14px; padding: 8px 12px; color: #8b98a9; }
  .tbar .iconbtn { display: flex; align-items: center; gap: 10px; width: auto; height: auto; padding: 10px 12px; color: #e6edf3; font-size: 15px; }
  .tbar .iconbtn .lbl { display: inline; }
  .tbar .bcount { position: static; margin-left: auto; }
  .tbar .bmenu { position: static; width: auto; max-height: none; border: 0; box-shadow: none; background: none; padding: 0; }
}

/* Demo / Live: il pulsante DEMO apre un piccolo selettore. Con soldi veri: LIVE verde e una linea verde in alto. */
.tbar .mode { position: relative; }
.tbar #moneyBadge { display: inline-flex; align-items: center; gap: 3px; font: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: .5px; cursor: default; }
.tbar #moneyBadge.pick { cursor: pointer; }
.tbar #moneyBadge.pick:hover { filter: brightness(1.2); }
.tbar #moneyBadge:disabled { opacity: 1; }
.tbar #moneyBadge .caret { width: 12px; height: 12px; }
.tbar #moneyBadge.live, .site-top .badge.live { color: #3fd68b; border-color: #1d5a3a; background: #11261b; }
.tbar .modemenu { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 270px; padding: 6px; background: #151b24;
  border: 1px solid #273142; border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.5); z-index: 41; }
.tbar .mode.open .modemenu { display: grid; gap: 2px; }
.tbar .modemenu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; background: none;
  border: 1px solid transparent; color: #e6edf3; text-align: left; cursor: pointer; font: inherit; }
.tbar .modemenu button:hover { background: #1c2430; }
.tbar .modemenu button.on { border-color: #273142; background: #1c2430; }
.tbar .modemenu b { display: block; font-size: 14px; }
.tbar .modemenu small { display: block; color: #8b98a9; font-size: 12px; margin-top: 1px; }
.tbar .mdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tbar .mdot.demo { background: #f5c542; } .tbar .mdot.live { background: #3fd68b; }
.tbar .balert[data-other] { width: 100%; border: 0; text-align: left; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
html.is-live .site-top, html.is-live body > header { border-top: 3px solid #26a269; }
@media (max-width: 759px) {
  .tbar .modemenu { position: static; width: auto; box-shadow: none; margin-top: 6px; }
}
