:root {
  --module-header-height: 68px;
  --module-inline-gutter: clamp(22px, 3vw, 48px);
  --module-stage-gap: clamp(12px, 1.8vh, 22px);
  --module-safe-bottom: clamp(16px, 2.2vh, 28px);
}

.module-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.module-page {
  min-height: 100dvh;
}

.module-page .module-header {
  position: relative;
  inset: auto;
  z-index: 30;
  width: 100%;
  height: var(--module-header-height);
  min-height: var(--module-header-height);
  margin: 0;
  padding: 0 var(--module-inline-gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.module-page .module-header__back { justify-self: start; }
.module-page .module-header__signature { justify-self: center; }
.module-page .module-header__name { justify-self: end; }

.module-page .module-header__back,
.module-page .module-header__name {
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .18em;
  line-height: 1;
  text-transform: uppercase;
}

.module-page .module-header__signature {
  font-size: 1.5rem;
  line-height: 1;
}

.module-page .module-stage {
  height: calc(100dvh - var(--module-header-height));
  min-height: 0;
  padding: var(--module-stage-gap) var(--module-inline-gutter) var(--module-safe-bottom);
}

.module-page > .layout {
  height: calc(100dvh - var(--module-header-height));
  min-height: 0;
}

.module-page .journal-stage,
.module-page .studio-shell,
.module-page .room-shell {
  width: 100%;
  margin: 0;
}

.module-page .studio-stage {
  width: min(
    calc(100vw - (2 * var(--module-inline-gutter))),
    calc((100dvh - var(--module-header-height) - var(--module-stage-gap) - var(--module-safe-bottom)) * 16 / 9)
  );
  max-height: calc(100dvh - var(--module-header-height) - var(--module-stage-gap) - var(--module-safe-bottom));
}

.module-page .note-page {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.module-page .note-page .page-head {
  width: 100%;
  padding-top: 0;
}

.module-page .note-page .nav-row {
  margin-bottom: 0;
}

.module-page .note-page .title-block {
  width: min(1500px, calc(100% - (2 * var(--module-inline-gutter))));
  min-height: 58px;
  margin-inline: auto;
}

.module-page .note-page .board-frame {
  width: min(1500px, calc(100% - (2 * var(--module-inline-gutter))));
  height: calc(100dvh - var(--module-header-height) - 58px);
  padding-top: 4px;
}

.module-page .note-page .board {
  height: 100%;
  min-height: 0;
}

@media (min-width: 900px) and (max-height: 760px) {
  :root {
    --module-header-height: 60px;
    --module-stage-gap: 8px;
    --module-safe-bottom: 14px;
  }

  .module-page .module-header__signature { font-size: 1.35rem; }

  .module-page .note-page .title-block {
    min-height: 46px;
  }

  .module-page .note-page .board-frame {
    height: calc(100dvh - var(--module-header-height) - 46px);
  }
}

@media (max-width: 720px) {
  :root {
    --module-header-height: 62px;
    --module-inline-gutter: 18px;
  }
}
