/* A scene beside you: a sheet held at the side of a wide screen, or along the bottom of a narrow one, with the
   scene's lines typed small and read-only. */
.beside {
  position: fixed;
  z-index: 20;
  right: 1rem;
  top: 5rem;
  bottom: 1rem;
  width: min(22rem, calc((100vw - 51rem) / 2 - 2rem));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--sheet-line);
  border-radius: 6px;
  background: var(--page);
  color: var(--page-ink);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.35);
  overflow: hidden;
}
.beside[hidden] { display: none; }

.beside__header { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.4rem 0 0.9rem; }
.beside__label { font: 600 0.72rem var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--pencil); }
.beside__close { width: 1.9rem; height: 1.9rem; border: 0; border-radius: 999px; background: transparent; color: var(--pencil); cursor: pointer; }
.beside__close:hover, .beside__close:focus-visible { background: var(--sheet-tint); color: var(--sheet-ink); }

.beside__heading {
  margin: 0.2rem 0.9rem 0.6rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 700 0.8rem/1.4 var(--font-typed);
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}
.beside__heading:hover { text-decoration: underline; }

.beside__lines { flex: 1; overflow-y: auto; padding: 0 0.9rem 1rem; font: 0.78rem/1.35 var(--font-typed); }
.beside__lines .element { margin-top: 0; margin-bottom: 0.8em; white-space: pre-wrap; overflow-wrap: break-word; }
.beside__lines .element:is([data-kind="parenthetical"], [data-kind="dialogue"]) { margin-top: -0.8em; }

/* No room at the side: along the bottom, a third of the screen. */
@media (max-width: 1340px) {
  .beside { left: 1rem; right: 1rem; top: auto; bottom: 0.75rem; width: auto; height: 34vh; }
  body.has-beside .desk { padding-bottom: calc(34vh + 2rem); }
}
