/* Pagina del copione: indice delle scene a sinistra (fisso), testo a destra in colonna di lettura. */
.script-layout { max-width: 1180px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 56px; }

.toc { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 28px 4px 40px 0; scrollbar-width: thin; }
.toc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.toc-title { font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--bronze); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { font: 500 12px var(--sans); padding: 4px 9px; border: 0; background: #fffaf1; color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.toc h2 { font: 600 13px/1.3 var(--serif); color: var(--ink); margin: 18px 0 6px; }
.toc h2 .n { color: var(--bronze); margin-right: 4px; }
.toc h2 a { color: inherit; text-decoration: none; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.toc li a { display: grid; grid-template-columns: 26px 1fr; gap: 4px; padding: 4px 6px; border-radius: 5px; font-size: 13px; line-height: 1.35; color: var(--ink-2); text-decoration: none; }
.toc li a:hover { background: var(--paper-2); color: var(--ink); }
.toc li a .n { font: 11px/1.6 var(--mono); color: #a1957f; }
.toc li a[aria-current="true"] { background: var(--bronze-soft); color: var(--ink); }
.toc li a[aria-current="true"] .n { color: var(--bronze); }

.script { padding: 40px 0 70vh; max-width: 680px; }
.script-head h1 { font: 600 40px/1.1 var(--serif); margin: 0 0 14px; }
.script-head .lede { font: 18px/1.55 var(--serif); color: var(--ink-2); margin: 0 0 8px; }

.act { margin-top: 64px; }
.act > h2 { font: 600 13px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--bronze); margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.act > h2 span { color: var(--ink); letter-spacing: .04em; text-transform: none; font: 600 22px/1.2 var(--serif); display: block; margin-top: 8px; }

.scene { margin-top: 44px; scroll-margin-top: 20px; }
.scene-head { margin-bottom: 14px; }
.scene-head h3 { font: 600 21px/1.25 var(--serif); margin: 0 0 4px; text-wrap: balance; }
.scene-head h3 a { color: inherit; text-decoration: none; }
.scene-head h3 a:hover { color: var(--bronze); }
.scene-head .where { font: 12px/1.4 var(--sans); color: var(--ink-2); letter-spacing: .02em; }
.scene-head .where .tc { font-family: var(--mono); color: #a1957f; margin-left: 8px; }

.scene-body { font: 18px/1.7 var(--serif); color: var(--ink); }
.scene-body .line { margin: 0 0 .55em; text-wrap: pretty; }
.scene-body .beat { height: .9em; }
.scene-body .seg-sub { color: inherit; text-decoration: none; border-radius: 3px; transition: background .15s; }
.scene-body .seg-sub:hover { background: var(--bronze-soft); }
.scene-body .seg-sub.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: #f4d9a6; } to { background: transparent; } }

/* Modalita' prosa: le battute scorrono in paragrafi, separati solo dalle pause lunghe */
.prose .scene-body .line { display: inline; margin: 0; }
.prose .scene-body .line::after { content: " "; }
.prose .scene-body .beat { display: block; height: .8em; }

@media (max-width: 900px) {
  .script-layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .toc nav { max-height: 40vh; overflow-y: auto; }
}

/* battute: nome del personaggio nel suo colore a sinistra, testo continuo a destra */
.scene-body .turn { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 16px; margin: 0 0 .7em; }
.scene-body .turn .who { font: 700 11.5px/2.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--sp); text-align: right; overflow-wrap: anywhere; }
.scene-body .turn .line { margin: 0; padding-left: 14px; border-left: 3px solid var(--sp); }
.scene-body .turn.minor .who { font-weight: 600; }
.scene-body .turn.minor .line { border-left-style: dotted; }
.prose .scene-body .turn { display: inline; margin: 0; }
.prose .scene-body .turn .who { display: inline; text-align: left; line-height: 1; margin-right: 6px; font-size: 11px; }
.prose .scene-body .turn .line { display: inline; padding: 0; border: 0; }
.prose .scene-body .turn .line::after { content: " "; }
@media (max-width: 600px) {
  .scene-body .turn { grid-template-columns: 1fr; gap: 0; }
  .scene-body .turn .who { text-align: left; line-height: 1.8; }
}
