/* Chat: presentazione, thread e indice flottante (port da Arca) */
.chat-presentation{
  max-width:820px;margin:0 0 1.6rem;padding:1.2rem 1.3rem;
  background:#101010;border:1px solid #272727;border-radius:12px;
}
.chat-presentation-title{
  font-family:'Rokkitt',Georgia,serif;color:var(--color-text-accent,#c9a87b);
  font-size:1.15rem;letter-spacing:.04em;text-transform:uppercase;margin:0 0 .6rem;
}
.chat-presentation-body{color:#d8d8d8;max-width:76ch;font-size:.98rem}
.chat-presentation-body>:first-child{margin-top:0}
.chat-presentation-body>:last-child{margin-bottom:0}
.chat-stage{max-width:820px;margin:0 auto;padding:0 0 2.4rem}
.chat-stage .chat-thread{margin:0}
.chat-backline{margin-top:1.3rem;font-size:.82rem}
.chat-toc-float{margin:0 0 1.2rem}
.chat-toc-list{list-style:none;margin:0;padding:0}
.chat-toc-list li:last-child a{border-bottom:0}
.chat-toc-toggle{display:none}
.chat-toc-dash{display:none}
.chat-toc-panel{display:contents}
.chat-toc-float.chat-toc-ready{
  margin:0;position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:90;
  display:flex;align-items:stretch;max-height:70vh;overflow:hidden;
  background:#0d0d0d;color:#fff;border-radius:14px 0 0 14px;
  box-shadow:0 18px 40px rgba(0,0,0,.35);
}
.chat-toc-float.chat-toc-ready .chat-toc-panel{
  display:block;position:static;width:0;max-height:none;overflow:hidden;
  opacity:0;visibility:hidden;pointer-events:none;margin:0;transform:none;
  transition:width .22s ease,opacity .18s ease;
}
.chat-toc-float.chat-toc-ready .chat-toc{
  width:300px;max-height:70vh;overflow-y:auto;background:transparent;border:0;
  border-radius:0;box-shadow:none;padding:1rem 1rem 1rem 1.2rem;color:#fff;
}
.chat-toc-float.chat-toc-ready .chat-toc .toc-title{color:rgba(255,255,255,.72);display:block;margin-bottom:.5rem;font-size:.72rem;letter-spacing:.1em;text-transform:uppercase}
.chat-toc-float.chat-toc-ready .chat-toc a{color:#fff;border-bottom:1px dashed rgba(255,255,255,.18);text-decoration:none;display:block;padding:.35rem 0}
.chat-toc-float.chat-toc-ready .chat-toc a:hover{color:#ffe483}
.chat-toc-float.chat-toc-ready .chat-toc-toggle{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.3rem;
  padding:1rem .55rem;border:0;background:transparent;color:#fff;cursor:pointer;flex:0 0 auto;
}
.chat-toc-float.chat-toc-ready .chat-toc-toggle:hover{background:rgba(255,255,255,.08)}
.chat-toc-float.chat-toc-ready .chat-toc-dash{display:block;width:18px;height:2px;border-radius:2px;background:#fff;opacity:.85}
.chat-toc-float.chat-toc-ready .chat-toc-toggle:hover .chat-toc-dash{opacity:1}
.chat-toc-float.chat-toc-ready.is-open .chat-toc-panel{width:300px;opacity:1;visibility:visible;pointer-events:auto}
@media (hover:hover) and (min-width:821px){
  .chat-toc-float.chat-toc-ready:hover .chat-toc-panel{width:300px;opacity:1;visibility:visible;pointer-events:auto}
}
.chat-chapter{
  position:relative;margin:2.2rem 0 1.1rem;padding-top:1.2rem;
  border-top:1px solid rgba(201,168,123,.28);
  font-family:'Rokkitt',Georgia,serif;font-size:1.18rem;line-height:1.3;
  color:#e8cfa5;scroll-margin-top:110px;
}
.chat-chapter:first-of-type{margin-top:.4rem;border-top:0;padding-top:0}
.chat-message{scroll-margin-top:110px}
@media(max-width:820px){
  .chat-toc-float.chat-toc-ready{
    top:auto;bottom:env(safe-area-inset-bottom,0px);right:0;transform:none;
    align-items:flex-end;border-radius:14px 14px 0 0;max-height:80vh;background:transparent;
    box-shadow:none;transition:background .2s ease,box-shadow .2s ease;
  }
  .chat-toc-float.chat-toc-ready.is-open{background:#0d0d0d;box-shadow:0 -14px 34px rgba(0,0,0,.35)}
  .chat-toc-float.chat-toc-ready .chat-toc{width:min(78vw,300px);max-height:70vh}
  .chat-toc-float.chat-toc-ready .chat-toc-panel{height:0}
  .chat-toc-float.chat-toc-ready .chat-toc-toggle{padding:1rem .8rem}
  .chat-toc-float.chat-toc-ready.is-open .chat-toc-panel{width:min(78vw,300px);height:auto}
  .chat-stage{padding:0}
}

.fake-heading{scroll-margin-top:110px}
