@property --mp-hue {
  syntax: "<number>";
  inherits: true;
  initial-value: 288;
}

@property --mp-sat {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 42%;
}

:root {
  --mp-hue: 288;
  --mp-sat: 42%;
  --mp-accent: hsl(var(--mp-hue) var(--mp-sat) 65%);
  --mp-accent-soft: hsl(var(--mp-hue) 80% 86%);
  --mp-accent-muted: hsl(var(--mp-hue) 26% 30%);
  --mp-caret: var(--mp-accent);
  --mp-bg: hsl(var(--mp-hue) 45% 3.6%);
  --mp-bg-hue: var(--mp-bg);
  --mp-surface: hsl(var(--mp-hue) 18% 8.4%);
  --mp-surface-raised: hsl(var(--mp-hue) 35% 7.2%);
  --mp-surface-deep: hsl(var(--mp-hue) 40% 5.2%);
  --mp-icon: hsl(var(--mp-hue) 12% 14%);
  --mp-text: #fff;
  --mp-text-muted: #ffffffb3;
  --mp-text-dim: #fff6;
  --mp-text-soft: #ffffffcc;
  --mp-text-faint: #ffffff40;
  --mp-on-accent: #fff;
  --mp-fill-subtle: #ffffff05;
  --mp-fill-hover: #ffffff08;
  --mp-fill-active: #ffffff0d;
  --mp-fill-strong: #ffffff1a;
  --mp-fill-mid: #fff3;
  --mp-fill-loud: #ffffff4d;
  --mp-shadow: 0 12px 32px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --mp-danger: #ff453a;
  --mp-on-danger: #fff;
  --border: #ffffff0d;
  --callout: var(--mp-accent);
  --background: var(--mp-bg);
}

html[data-theme="light"] {
  color-scheme: light;
  --mp-accent: hsl(var(--mp-hue) var(--mp-sat) 46%);
  --mp-accent-soft: hsl(var(--mp-hue) 42% 36%);
  --mp-accent-muted: hsl(var(--mp-hue) 20% 78%);
  --mp-bg: color-mix(in srgb, hsl(38 38% 96.6%) 58%, hsl(var(--mp-hue) 20% 96.2%) 42%);
  --mp-bg-hue: var(--mp-bg);
  --mp-surface: color-mix(in srgb, hsl(36 28% 93.2%) 55%, hsl(var(--mp-hue) 18% 92.8%) 45%);
  --mp-surface-raised: color-mix(in srgb, hsl(34 26% 90.6%) 55%, hsl(var(--mp-hue) 16% 90.2%) 45%);
  --mp-surface-deep: color-mix(in srgb, hsl(34 24% 88.8%) 55%, hsl(var(--mp-hue) 16% 88.4%) 45%);
  --mp-icon: hsl(28 10% 42%);
  --mp-text: hsl(28 16% 16%);
  --mp-text-muted: hsl(28 10% 34%);
  --mp-text-dim: hsl(28 8% 44%);
  --mp-text-soft: hsl(28 12% 24%);
  --mp-text-faint: hsl(28 8% 56%);
  --mp-on-accent: #fffaf4;
  --mp-fill-subtle: hsl(28 18% 16% / 0.04);
  --mp-fill-hover: hsl(28 16% 16% / 0.06);
  --mp-fill-active: hsl(28 14% 16% / 0.09);
  --mp-fill-strong: hsl(28 14% 16% / 0.12);
  --mp-fill-mid: hsl(28 14% 16% / 0.16);
  --mp-fill-loud: hsl(28 14% 16% / 0.22);
  --mp-shadow: 0 12px 32px rgba(48, 32, 18, 0.12), 0 0 0 1px hsl(28 16% 16% / 0.08);
  --mp-danger: #e11d48;
  --mp-on-danger: #fff;
  --border: hsl(28 14% 16% / 0.12);
}

html {
  color-scheme: dark;
  transition: --mp-hue 280ms ease, --mp-sat 280ms ease;
}

html[data-theme="light"] .pagedrawer,
html[data-theme="light"] .chatdrawer {
  background-color: var(--mp-surface);
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  color: var(--mp-text);
  background-color: var(--mp-bg);
  caret-color: var(--mp-caret);
  font-family: Figtree, sans-serif;
  font-size: 14.6px;
  line-height: 1.5em;
}

p {
  margin-bottom: 10px;
}

a {
  text-decoration: underline;
  transition: all .21s;
}

.pagewrapper {
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.pagedrawer {
  z-index: 3;
  flex: none;
  flex-flow: column;
  align-self: stretch;
  width: 321px;
  height: 100vh;
  display: flex;
  position: sticky;
  top: 0;
  overflow: hidden;
  transition: width 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pagedrawer.closed {
  width: 0;
  overflow: hidden;
}

.pagedrawer.sneak {
  width: 50px;
  overflow: hidden;
}

.pagedrawer .drawermenu .alignrow,
.pagedrawer .tabs,
.pagedrawer .pagesblock {
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 360ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear;
}

.pagedrawer.sneak .drawermenu {
  justify-content: center;
  align-items: center;
  gap: 0;
  padding-left: 10px;
  padding-right: 10px;
  border-bottom-color: transparent;
}

.pagedrawer.sneak .drawermenu > .alignrow {
  position: absolute;
}

.pagedrawer.sneak .drawermenu .alignrow,
.pagedrawer.sneak .tabs,
.pagedrawer.sneak .pagesblock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  width: 0;
  min-width: 0;
  overflow: hidden;
  transform: translateX(-24px);
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 360ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 280ms;
}

.pagedrawer .drawermenu > .drawericon svg,
.pagedrawer .drawericon.preview svg,
.drawericon.chatfloat svg {
  display: block;
  flex: none;
  transform-origin: center;
  transform-box: border-box;
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pagedrawer.sneak .drawermenu > .drawericon svg {
  transform: scaleX(-1);
  transform-origin: center;
}

.contentblock {
  border-right: 1.5px solid var(--border);
  border-left: 1.5px solid var(--border);
  flex-flow: column;
  flex: 1;
  min-height: 0;
  width: 300px;
  padding-top: 89px;
  display: flex;
}

.contentblock.pages, .contentblock.summary, .contentblock.characters, .contentblock.beatsheet {
  display: flex;
  flex: 1;
  align-self: stretch;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.contentblock.pages,
.contentblock:has(> .contentcontainer) {
  padding-top: 0;
}

.contentblock.pages::-webkit-scrollbar,
.contentblock.summary::-webkit-scrollbar,
.contentblock.characters::-webkit-scrollbar,
.contentblock.beatsheet::-webkit-scrollbar {
  display: none;
}

.chatdrawer {
  z-index: 3;
  flex-flow: column;
  flex: none;
  align-self: stretch;
  width: 460px;
  height: 100vh;
  padding: 15px;
  display: flex;
  position: sticky;
  top: 0;
  overflow: hidden;
  transition: width 360ms cubic-bezier(0.22, 1, 0.36, 1), padding 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chatdrawer.closed {
  width: 53px;
  padding-left: 10px;
  padding-right: 10px;
}

.chatdrawer.closed .chatwrapper {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(32px);
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 360ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 280ms;
}

.chatdrawer.closed .drawericon.chatfloat {
  top: 25px;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  border-radius: 10px;
}

.chatdrawer.closed .drawericon.chatfloat svg {
  transform: scaleX(-1);
  transform-origin: center;
}

.contentrow {
  display: flex;
}

.drawermenu {
  grid-column-gap: 12.34px;
  grid-row-gap: 12.34px;
  border-bottom: 1.5px solid var(--border);
  flex: none;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  padding: 15px;
  font-size: 17px;
  line-height: 1em;
  display: flex;
}

.drawermenu.hide {
  opacity: 0;
  display: none;
}

.drawerblock {
  flex-flow: column;
  height: 100%;
  padding: 10px 0;
  display: flex;
}

.pagelink {
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  opacity: .7;
  color: var(--mp-text-muted);
  justify-content: flex-start;
  align-items: center;
  padding: 10px;
  text-decoration: none;
  display: flex;
  position: relative;
  -webkit-user-drag: none;
  user-select: none;
}

.pagelink:hover {
  opacity: 1;
  color: var(--mp-text);
  background-color: var(--mp-fill-subtle);
}

.pagelink.active {
  opacity: 1;
  color: var(--mp-text);
  background-color: var(--mp-fill-active);
  border-right-color: var(--mp-text);
}

.pagelink._5 {
  justify-content: center;
  align-items: center;
  padding-top: 2.5px;
  padding-bottom: 5px;
}

.pagethumb {
  letter-spacing: 0;
  background-color: #fff0;
  border: none;
  box-shadow: none;
  outline: none;
  border-radius: 10px;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 25px;
  height: 25px;
  padding-top: 1px;
  padding-bottom: 0;
  padding-left: 0;
  font-family: Figtree, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1em;
  display: flex;
  position: relative;
  overflow: hidden;
}

.pagethumb.active {
  color: var(--mp-text);
  background-color: color-mix(in srgb, var(--mp-accent) 20%, transparent);
  font-weight: 600;
}

.pagethumb .pagenum {
  transition: opacity 150ms ease;
}

.pagethumb .pagegrabber {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: currentColor;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  z-index: 1;
  transition: opacity 150ms ease;
}

.pagethumb .pagegrabber svg {
  display: block;
}

.pagelink:hover .pagethumb .pagenum,
.pagelink.is-dragging .pagethumb .pagenum {
  opacity: 0;
}

.pagelink:hover .pagethumb .pagegrabber,
.pagelink.is-dragging .pagethumb .pagegrabber {
  opacity: 1;
}

.pagelink.is-dragging {
  opacity: 0.96;
  color: var(--mp-text);
  background-color: var(--mp-surface-raised);
  box-shadow: var(--mp-shadow);
  cursor: grabbing;
  transition: box-shadow 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

.pagelink.is-dragging .pagegrabber {
  cursor: grabbing;
}

.pagelink-placeholder {
  flex: none;
  pointer-events: none;
}

.pagelink.has-swipe {
  overflow: hidden;
  padding: 0;
  touch-action: pan-y;
  background-color: transparent;
}

.pagelink.has-swipe:hover,
.pagelink.has-swipe.active,
.pagelink.has-swipe.w--current {
  background-color: transparent;
}

.pagelink-delete {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--pagelink-delete-width, 76px);
  padding: 0 10px;
  border: 0;
  background-color: var(--mp-danger);
  color: var(--mp-on-danger);
  font-family: Figtree, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.pagelink-slide {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  background-color: var(--mp-bg);
  will-change: transform;
}

.pagelink.has-swipe:hover .pagelink-slide {
  background-image: linear-gradient(var(--mp-fill-subtle), var(--mp-fill-subtle));
}

.pagelink.has-swipe.active .pagelink-slide,
.pagelink.has-swipe.w--current .pagelink-slide {
  background-image: linear-gradient(var(--mp-fill-active), var(--mp-fill-active));
}

.pagelink.has-swipe.is-dragging {
  background-color: var(--mp-surface-raised);
}

.pagelink.has-swipe.is-dragging .pagelink-delete,
body.is-chapter-reordering .pagelink-delete,
body.is-summary-reordering .pagelink-delete {
  visibility: hidden;
  pointer-events: none;
}

.pagelink.has-swipe.is-dragging .pagelink-slide,
body.is-chapter-reordering .pagelink.is-dragging .pagelink-slide,
body.is-summary-reordering .pagelink.is-dragging .pagelink-slide {
  transform: none !important;
  transition: none !important;
  background-color: var(--mp-surface-raised);
  background-image: none;
}

.pagelink.has-swipe.is-swiping {
  touch-action: none;
}

.pagelink.has-swipe.is-swiping .pagelink-slide {
  transition: none;
}

.pagelink.has-swipe .activearrow {
  right: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .pagelink-slide {
    transition: none;
  }
}

.pagesblock.is-reordering {
  user-select: none;
}

body.is-chapter-reordering,
body.is-chapter-reordering *,
body.is-summary-reordering,
body.is-summary-reordering * {
  cursor: grabbing !important;
}

.sidechapter {
  font-size: 14px;
  font-weight: 500;
  line-height: 1em;
}

.sidesub {
  grid-column-gap: 3px;
  grid-row-gap: 3px;
  opacity: .39;
  justify-content: flex-start;
  align-items: center;
  font-family: Figtree, sans-serif;
  font-size: 13px;
  line-height: 1em;
  display: flex;
}

.sidelink-content {
  grid-column-gap: 6px;
  grid-row-gap: 6px;
  flex-flow: column;
  padding-top: 1.5px;
  display: flex;
}

.sidelink-content.hide {
  display: none;
}

.fullimage {
  object-fit: cover;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0%;
}

.chatbackground {
  background-color: var(--callout);
  position: absolute;
  inset: 0%;
  /* No z-index here: a stacking context would trap the .chatfloat toggle (z-index 99)
     beneath .chatwrapper (z-index 9). With auto, the image stays behind the chat and
     the toggle paints above it. */
  z-index: auto;
  pointer-events: none;
}

.chatbackground .fullimage,
.chatbackground .sideoverlay {
  pointer-events: none;
}

.tabsmenu {
  grid-column-gap: 5px;
  grid-row-gap: 5px;
  border-bottom: 1.5px solid var(--border);
  height: 48px;
  padding: 5px;
  display: flex;
}

.tabsmenu.padding {
  justify-content: space-around;
  align-items: stretch;
  height: 70px;
  padding: 10px;
}

.tabslink {
  aspect-ratio: 1;
  color: var(--mp-text-faint);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  background-color: #fff0;
  border-radius: 5px;
  flex: 1;
  justify-content: center;
  align-items: center;
  padding: 1px 0 0;
  font-family: Figtree, sans-serif;
  font-size: 10.1px;
  font-weight: 600;
  line-height: 1em;
  display: flex;
}

.tabslink:hover {
  color: var(--mp-text);
  background-color: var(--mp-fill-hover);
}

.tabslink.current {
  color: var(--mp-text);
  background-color: var(--mp-fill-active);
}

.tabs {
  z-index: 3;
  flex-flow: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  position: relative;
}

.tabpane {
  flex: 1;
  flex-flow: column;
  min-height: 0;
  display: flex;
  position: relative;
}

.tabscontent {
  flex-flow: column;
  flex: 1;
  min-height: 0;
  display: flex;
}

.pagesblock {
  flex-flow: column;
  flex: 1;
  min-height: 0;
  padding-top: 10px;
  padding-left: 0;
  padding-right: 0;
  display: flex;
  position: relative;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pagesblock::-webkit-scrollbar {
  display: none;
}

.pagesblock.hide {
  opacity: 0;
  display: none;
}

.activearrow {
  opacity: 0;
  width: 20px;
  height: 20px;
  color: var(--callout);
  position: absolute;
  inset: auto 10px auto auto;
  transform: translateX(-3px);
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1), transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pagelink.active .activearrow,
.pagelink.w--current .activearrow {
  opacity: 1;
  transform: translateX(0);
}

.ikonik-6xkoh, .ikonik-vug8h, .ikonik-gt4zj {
  color: var(--mp-text);
}

.tabicon {
  width: 17px;
  height: 17px;
}

.ikonik-wscp2, .ikonik-upv8j {
  color: var(--mp-text);
}

.chatwrapper {
  z-index: 9;
  border: 1.5px solid var(--border);
  background-color: var(--background);
  border-radius: 10px;
  flex-flow: column;
  flex: 1 0 420px;
  min-width: 420px;
  min-height: 0;
  overflow: hidden;
  display: flex;
  position: relative;
  pointer-events: auto;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 360ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear;
}

.tabblock {
  flex-flow: column;
  height: 100%;
  padding: 10px;
  display: flex;
}

.contentcontainer {
  width: 640px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.contentblock.pages .contentcontainer,
.contentblock > .contentcontainer {
  flex: none;
  min-height: min-content;
  width: 640px;
  padding-top: 89px;
  padding-bottom: 80px;
}

/* Write page: the fixed Next pill (bottom 82px + 55px tall) and the audio bar sit over
   the end of the manuscript, so leave room for the last lines to scroll clear of them. */
.contentblock.pages .contentcontainer {
  padding-bottom: 184px;
}

.contentcontainer[hidden] {
  display: none;
}

.richtext {
  margin-bottom: 20px;
  padding-right: 20px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.8em;
}

.richtext p {
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.8em;
}

.richtext.alt {
  margin-bottom: 0;
}

.chaptertitle {
  margin-top: 40px;
  margin-bottom: 40px;
  font-family: Figtree, sans-serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.4em;
}

.chaptertitle.lessspace {
  margin-top: 0;
  margin-bottom: 10px;
}

.chapterlabel {
  color: var(--callout);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: Figtree, sans-serif;
  font-size: 15px;
}

.contentblock.characters .characterlabel {
  color: var(--callout);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: Figtree, sans-serif;
  font-size: 11.25px;
  line-height: 1.2;
}

.charactername {
  background-color: color-mix(in srgb, var(--mp-accent) 15%, transparent);
  border-radius: 2px;
  padding-right: 1px;
  font-style: normal;
  display: inline-flex;
}

.charactername.blue {
  background-color: #819ccd26;
}

.charactername.green {
  background-color: #81cd8b26;
}

.div-block {
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  flex-flow: row;
  display: flex;
}

.highlighttext {
  background-color: color-mix(in srgb, var(--mp-accent) 18%, transparent);
  position: relative;
}

.highlighttooltip {
  border: 1.5px solid var(--callout);
  background-color: var(--mp-bg);
  border-radius: 10px;
  width: 460px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  display: flex;
  position: absolute;
  inset: -60px 0% auto;
  box-shadow: 0 0 10px color-mix(in srgb, var(--mp-accent) 10%, transparent);
}

.highlighttooltip.chapter {
  top: -40px;
}

.tooltiplink {
  grid-column-gap: 5px;
  grid-row-gap: 5px;
  color: var(--mp-text-muted);
  border-radius: 2px 6px 6px 2px;
  flex: 1;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 14px;
  line-height: 1em;
  text-decoration: none;
  display: flex;
}

.tooltiplink:hover {
  color: var(--mp-text);
  background-color: var(--mp-fill-active);
}

.tooltipblock {
  border-right: 1.5px solid var(--border);
  flex: 1;
  justify-content: flex-start;
  align-items: flex-start;
  margin-right: -1.5px;
  padding: 5px 10px 5px 5px;
  display: flex;
}

.tooltipblock.last {
  border-right-style: none;
  margin-right: 0;
  padding-left: 6px;
  padding-right: 5px;
}

.tooltipfield {
  color: var(--mp-text);
  background-color: #fff0;
  caret-color: var(--mp-caret);
  border: 1px #000;
  width: 300px;
  min-height: 40px;
  margin-bottom: 0;
  padding: 0 0 0 5px;
  font-size: 14px;
}

.tooltipfield.long {
  width: 410px;
}

.form-block {
  margin-bottom: 0;
}

.tooltipsubmit {
  background-color: var(--callout);
  opacity: .7;
  border-radius: 100px;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 27px;
  height: 27px;
  margin-top: 7px;
  margin-left: 5px;
  display: flex;
}

.tooltipsubmit:hover {
  opacity: 1;
}

.arrowicon {
  color: var(--mp-on-accent);
  width: 15px;
  height: 15px;
}

.buttonicon {
  width: 15px;
  height: 15px;
}

.sideoverlay {
  z-index: 3;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background-color: color-mix(in srgb, var(--mp-bg) 33%, transparent);
  display: flex;
  position: absolute;
  inset: 0%;
  pointer-events: none;
}

.circledivider {
  opacity: .4;
  padding-top: 1px;
  padding-left: 3px;
  padding-right: 3px;
  font-size: 5px;
}

.dim {
  opacity: .7;
}

.textwriting {
  flex: none;
  flex-shrink: 0;
  padding: 10px;
}

.texthistory {
  grid-column-gap: 33px;
  grid-row-gap: 33px;
  flex-flow: column;
  flex: 1;
  justify-content: flex-start;
  padding: 23px 23px 13px;
  display: flex;
  position: relative;
}

.chatbubble {
  border: 1.5px solid var(--border);
  background-color: var(--mp-fill-hover);
  border-radius: 10px;
  flex-flow: column;
  max-width: 96%;
  padding: 12px 13px 0;
  font-size: 15px;
  line-height: 1.6em;
  display: flex;
}

.sentchats {
  grid-column-gap: 5px;
  grid-row-gap: 5px;
  flex-flow: column;
  justify-content: flex-start;
  align-items: flex-end;
  display: flex;
}

.aichats {
  flex-flow: column;
  display: flex;
}

.chattext {
  font-size: 15.55px;
  line-height: 1.8em;
  text-wrap: wrap;
  text-wrap: pretty;
}

.chattext p {
  margin-bottom: 12px;
  font-weight: 300;
  text-wrap: wrap;
  text-wrap: pretty;
}

.chatlabel {
  opacity: .33;
  font-size: 12.34px;
}

.chatlabel-row {
  grid-column-gap: 4px;
  grid-row-gap: 4px;
  justify-content: flex-start;
  align-items: center;
  margin-top: -5px;
  display: flex;
}

.glancechat-field {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  justify-content: flex-start;
  align-items: center;
  min-height: 60px;
  height: auto;
  padding-left: 12px;
  padding-right: 50px;
  display: flex;
  position: relative;
}

.glancechat-field.active {
  border-color: var(--callout);
  color: var(--mp-text);
}

.chatsend {
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  border: 1.5px solid var(--border);
  background-color: var(--callout);
  opacity: .7;
  border-radius: 100px;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 33px;
  height: 33px;
  padding: 0;
  display: flex;
}

.chatsend:hover {
  opacity: 1;
}

.chatsend.mic {
  background-color: var(--border);
  display: none;
}

.sendicon {
  width: 20px;
}

.glancechat-placeholder {
  opacity: .4;
}

.formattingbar {
  border: 1.5px solid var(--border);
  background-color: var(--background);
  border-radius: 100px;
  width: 400px;
  height: 55px;
  margin-left: auto;
  margin-right: auto;
  padding: 5px;
  display: flex;
  position: sticky;
  bottom: 10px;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--mp-accent) 10%, transparent);
}

.sidebook-title {
  border-bottom: 1.5px solid var(--border);
  background-color: var(--mp-fill-hover);
  justify-content: flex-start;
  align-items: center;
  height: 55px;
  margin-bottom: 10px;
  padding-top: 1px;
  padding-left: 18px;
  font-size: 15.55px;
  line-height: 1em;
  display: flex;
}

.chapterdetails {
  margin-top: 10px;
  margin-bottom: 30px;
}

.pagedetails {
  grid-column-gap: 5px;
  grid-row-gap: 5px;
  opacity: .5;
  color: var(--callout);
  justify-content: flex-start;
  align-items: center;
  font-family: Figtree, sans-serif;
  font-size: 15px;
  line-height: 1em;
  display: flex;
}

.pagedetails.full-opacity {
  opacity: 1;
}

.chapterstats {
  justify-content: space-between;
  align-items: center;
  display: flex;
}

.stickypage {
  z-index: 99;
  box-sizing: border-box;
  border-bottom: 1.5px solid var(--border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background-color: color-mix(in srgb, var(--mp-bg) 80%, transparent);
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  flex: 0 0 80px;
  flex-shrink: 0;
  width: 100%;
  height: 80px;
  min-height: 80px;
  margin-bottom: -80px;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-left: 30px;
  padding-right: 30px;
  display: flex;
  position: sticky;
  top: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 300ms cubic-bezier(0.22, 1, 0.36, 1), transform 300ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 300ms;
}

.stickypage.is-stuck {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1), transform 520ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear;
}

.alignrow {
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  justify-content: flex-start;
  align-items: center;
  display: flex;
}

.stickyheading {
  font-size: 17.3px;
  line-height: 1em;
}

.stickychapter {
  color: var(--callout);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1em;
}

.logo {
  background-color: var(--mp-fill-active);
  border-radius: 5px;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 60px;
  display: flex;
  position: relative;
  overflow: hidden;
}

.drawermenu .logo {
  color: #fff;
  text-decoration: none;
  flex: none;
}

.drawermenu .logo .logo-back {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.drawermenu .logo:hover .logo-back,
.drawermenu .logo:focus-visible .logo-back {
  opacity: 1;
}

.drawermenu .logo:focus-visible {
  outline: 2px solid var(--callout);
  outline-offset: 2px;
}

.drawermenu .logo .logo-back-icon {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
}

.pagedrawer.sneak .drawermenu .logo .logo-back-icon,
.pagedrawer.closed .drawermenu .logo .logo-back-icon {
  width: 14px;
  height: 14px;
}

.logoicon {
  width: 23px;
}

.text-block {
  padding-top: 1px;
}

.newpage {
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  border-top: 1.5px solid var(--border);
  background-color: var(--background);
  color: var(--mp-text-muted);
  flex: none;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  height: 60px;
  font-size: 14px;
  text-decoration: none;
  display: flex;
}

.newpage:hover {
  color: var(--mp-text);
  background-color: var(--mp-surface-deep);
}

.newicon {
  background-color: var(--mp-fill-active);
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  width: 27px;
  height: 27px;
  display: flex;
}

.plusicon {
  width: 16px;
  height: 16px;
}

.ikonik-w74hm {
  color: var(--mp-text);
}

.chapterslabel {
  z-index: 99;
  color: var(--mp-text-dim);
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  background-color: var(--mp-surface);
  flex: none;
  justify-content: flex-start;
  align-items: center;
  height: 33px;
  margin-bottom: 10px;
  padding-top: 1px;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1em;
  display: flex;
  position: sticky;
  top: 0;
}

.sectiondivider {
  z-index: 2;
  color: var(--mp-text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  background-color: var(--mp-surface);
  flex: none;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  height: 33px;
  padding-top: 1px;
  padding-left: 10px;
  padding-right: 10px;
  font-family: Figtree, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1em;
  display: flex;
  box-sizing: border-box;
  position: relative;
}

.pagesblock.summarynav .sectiondivider {
  background-color: color-mix(in srgb, var(--mp-surface) 55%, transparent);
  cursor: grab;
  touch-action: none;
}

.sectiondivider.is-dragging {
  opacity: 0.96;
  color: var(--mp-text);
  background-color: var(--mp-surface-raised);
  box-shadow: var(--mp-shadow);
  cursor: grabbing;
  z-index: 40;
}

.sectiondivider-label {
  flex: 1;
  min-width: 0;
  outline: none;
  caret-color: var(--mp-caret);
  cursor: text;
}

.sectiondivider-remove {
  appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin-left: 6px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  opacity: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: opacity .15s;
}

.sectiondivider:hover .sectiondivider-remove,
.sectiondivider:focus-within .sectiondivider-remove {
  opacity: .42;
}

.sectiondivider-remove:hover,
.sectiondivider-remove:focus-visible {
  opacity: .85;
}

.sendicon-arrow {
  color: var(--mp-on-accent);
  width: 18px;
  height: 18px;
}

a.drawericon,
.drawericon {
  z-index: 3;
  opacity: 1;
  color: var(--mp-icon);
  background-color: var(--mp-fill-subtle);
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  display: flex;
  flex: none;
  position: relative;
}

.drawericon:hover {
  color: var(--mp-text);
  background-color: var(--mp-fill-strong);
}

.drawermenu > .drawericon {
  border: 1.5px solid var(--border);
  background-color: var(--background);
  color: var(--mp-accent-muted);
}

.drawermenu > .drawericon:hover {
  color: var(--mp-accent-soft);
  background-color: var(--background);
}

.drawericon.preview {
  border-bottom: 1.5px solid var(--border);
  border-radius: 0;
  flex: none;
  width: 70px;
  height: 70px;
  display: none;
}

.drawericon.preview:hover {
  color: var(--mp-text);
  background-color: var(--mp-fill-active);
}

.drawericon.chatfloat {
  z-index: 99;
  border: 1.5px solid var(--border);
  background-color: var(--background);
  color: var(--mp-accent-muted);
  border-radius: 0 0 7px;
  justify-content: center;
  align-items: center;
  width: 33px;
  height: 33px;
  padding: 0;
  display: flex;
  position: absolute;
  inset: -1.5px auto auto -1.5px;
  pointer-events: auto;
}

.drawericon.chatfloat:hover {
  color: var(--mp-accent-soft);
}

.drawerico {
  display: block;
  width: 18px;
  height: 18px;
}

.drawerico.large {
  width: 20px;
  height: 20px;
}

.ikonik-soflx, .ikonik-u6s8q {
  color: var(--mp-text);
}

.audiocontrols {
  z-index: 20;
  grid-column-gap: 5px;
  grid-row-gap: 5px;
  border: 1.5px solid var(--border);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background-color: color-mix(in srgb, var(--mp-bg) 80%, transparent);
  border-radius: 100px;
  justify-content: center;
  align-items: center;
  /* Shrink-wrap the six buttons; with left/right both set, the auto margins
     centre the pill inside the content column (fixed-pos centring rule). */
  width: fit-content;
  min-width: 0;
  height: 55px;
  padding: 0 8px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  position: fixed;
  bottom: 10px;
  left: 321px;
  right: 460px;
  box-shadow: 0 0 10px color-mix(in srgb, var(--mp-accent) 10%, transparent);
  transition: left 360ms cubic-bezier(0.22, 1, 0.36, 1), right 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pagewrapper:has(.pagedrawer.closed) .audiocontrols {
  left: 0;
}

.pagewrapper:has(.pagedrawer.sneak) .audiocontrols {
  left: 50px;
}

.pagewrapper:has(.chatdrawer.closed) .audiocontrols {
  right: 53px;
}

.audioplay {
  border: 1.5px solid var(--border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--mp-text);
  background-color: var(--mp-fill-mid);
  border-radius: 100px;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  padding-left: 2px;
  display: flex;
  position: relative;
  bottom: 10px;
}

.audioplay:hover {
  background-color: var(--mp-fill-loud);
}

.audioplay.playing {
  color: var(--background);
  background-color: var(--mp-text);
}

.audioplay.is-busy {
  opacity: 0.7;
}

.audiocontrols.is-playing .audiowave .audioicons,
.audiocontrols.is-loading .audiowave .audioicons {
  transform-origin: center;
  animation: audiowave 900ms ease-in-out infinite;
}

@keyframes audiowave {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleY(0.86);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.08);
  }
}

.audiostatus {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  max-width: min(360px, 80vw);
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background-color: color-mix(in srgb, var(--mp-bg) 88%, transparent);
  color: var(--mp-text);
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.audiostatus[hidden] {
  display: none;
}

.contentblock.pages .is-speaking,
.contentblock.pages .richtext .is-speaking,
.contentblock.pages .chapter-prose p.is-speaking,
.contentblock.pages .fountain-prose p.is-speaking,
.contentblock.pages .fountain-prose .fountain-line.is-speaking {
  background-color: color-mix(in srgb, var(--mp-accent) 34%, transparent);
  box-shadow:
    inset 3px 0 0 0 var(--mp-accent),
    inset 0 0 0 1.5px color-mix(in srgb, var(--callout) 75%, transparent);
  border-radius: 4px;
  outline: 2px solid color-mix(in srgb, var(--callout) 60%, transparent);
  outline-offset: 2px;
}

html[data-theme="light"] .contentblock.pages .is-speaking,
html[data-theme="light"] .contentblock.pages .richtext .is-speaking,
html[data-theme="light"] .contentblock.pages .fountain-prose .fountain-line.is-speaking {
  background-color: color-mix(in srgb, var(--mp-accent) 20%, transparent);
  box-shadow:
    inset 3px 0 0 0 var(--mp-accent),
    inset 0 0 0 1.5px color-mix(in srgb, var(--callout) 55%, transparent);
  outline-color: color-mix(in srgb, var(--callout) 50%, transparent);
}

.audiocontrol {
  border: 1.5px solid var(--border);
  background-color: var(--border);
  border-radius: 100px;
  justify-content: center;
  align-items: center;
  width: 39px;
  height: 39px;
  display: flex;
}

.audiocontrol:hover,
.audiocontrol.is-open {
  background-color: var(--mp-fill-strong);
  border-color: var(--mp-fill-strong);
}

.audiocontrol.audiowalkie.is-recording,
.audiocontrols.is-recording .audiowalkie {
  color: #fff;
  background-color: #c23b3b;
  border-color: #c23b3b;
  animation: walkie-pulse 900ms ease-in-out infinite;
}

@keyframes walkie-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, #c23b3b 45%, transparent);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 6px color-mix(in srgb, #c23b3b 0%, transparent);
  }
}

.audiovoice-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: min(228px, 72vw);
  max-height: 268px;
  overflow: auto;
  padding: 6px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background-color: color-mix(in srgb, var(--mp-bg) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--mp-shadow);
  color: var(--mp-text);
}

.audiovoice-menu[hidden] {
  display: none;
}

.audiovoice-option {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--mp-text);
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.audiovoice-option:hover,
.audiovoice-option:focus-visible {
  background-color: var(--mp-fill-strong);
}

.audiovoice-option.is-selected {
  background-color: color-mix(in srgb, var(--mp-accent) 18%, transparent);
}

.audiovoice-name {
  display: block;
  font-weight: 560;
}

.audiovoice-note {
  display: block;
  margin-top: 1px;
  color: var(--mp-text-dim);
  font-size: 11px;
}

.ikonik-q4fv6 {
  color: var(--mp-text);
}

.audioicons {
  color: var(--mp-text);
  width: 18px;
  height: 18px;
}

.ikonik-g4zgp, .ikonik-jvx5t, .ikonik-xnbnqj {
  color: var(--mp-text);
}

.playicon {
  width: 25px;
  height: 25px;
}

.ikonik-gaqmq {
  color: var(--mp-text);
}

.chatattatchment {
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  background-color: var(--background);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--mp-text-muted);
  border: 1.5px solid color-mix(in srgb, var(--mp-accent) 15%, transparent);
  border-radius: 10px;
  justify-content: flex-start;
  align-items: center;
  max-width: 80%;
  margin-bottom: -15px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.4em;
  display: flex;
  position: relative;
  right: 5px;
}

/* Highlighted-passage attachment: collapsed to 3 lines by default, click to toggle.
   The clamp lives on the text child so the icon keeps its own column. */
.chatattatchment > div {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  min-width: 0;
}

.chatattatchment.is-clampable {
  cursor: pointer;
  align-items: flex-start;
}

.chatattatchment.is-clampable .attachmenticon {
  margin-top: 0.1em;
}

.chatattatchment.is-expanded > div {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: none;
  overflow: visible;
}

.attachmenticon {
  color: var(--mp-text);
  flex: none;
  width: 18px;
  height: 18px;
}

.chatlabel-icon {
  opacity: .33;
  width: 14px;
  height: 14px;
}

.aichats.is-thinking .chattext p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 1.8em;
}

.aichats.is-thinking .thinking-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--callout);
  opacity: 0.2;
  animation: mp-think-dot 1.35s ease-in-out infinite;
}

.aichats.is-thinking .thinking-dot:nth-child(2) {
  animation-delay: 0.18s;
}

.aichats.is-thinking .thinking-dot:nth-child(3) {
  animation-delay: 0.36s;
}

.aichats.is-thinking .chatlabel-icon {
  animation: mp-think-sparkle 1.8s ease-in-out infinite;
}

@keyframes mp-think-dot {
  0%, 80%, 100% { opacity: 0.18; }
  40% { opacity: 0.92; }
}

@keyframes mp-think-sparkle {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.68; }
}

.aichats.is-writing .chattext p.writing-row {
  width: 4.5rem;
  height: 7px;
  margin-bottom: 8px;
  border-radius: 99px;
  background-color: color-mix(in srgb, var(--callout) 28%, transparent);
  animation: mp-page-label 1.5s ease-in-out infinite;
}

.aichats.is-writing .chatlabel-icon {
  animation: mp-think-sparkle 1.8s ease-in-out infinite;
}

@keyframes mp-page-label {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes mp-page-shimmer {
  0% { transform: translateX(-35%); opacity: 0.15; }
  50% { transform: translateX(0); opacity: 0.9; }
  100% { transform: translateX(35%); opacity: 0.15; }
}

@media (prefers-reduced-motion: reduce) {
  .aichats.is-thinking .thinking-dot,
  .aichats.is-thinking .chatlabel-icon {
    animation: none;
  }

  .aichats.is-thinking .thinking-dot {
    opacity: 0.45;
  }

  .aichats.is-writing .chattext p.writing-row,
  .aichats.is-writing .chatlabel-icon {
    animation: none;
  }

  .audiocontrol.audiowalkie.is-recording,
  .audiocontrols.is-recording .audiowalkie {
    animation: none;
  }
}

.chatdraft {
  border-left: 1.5px solid var(--callout);
  margin: 2px 0 10px;
  padding: 0 0 0 12px;
}

.chatdraft .chattext p:last-child {
  margin-bottom: 8px;
}

.chatplan {
  align-self: stretch;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--mp-surface) 70%, transparent);
}

.chatplan-list {
  margin: 0 0 8px;
  padding: 0 0 0 1.1em;
  font-size: 13px;
  line-height: 1.4em;
}

.chatplan-item.is-delete {
  color: var(--mp-accent-soft, var(--callout));
}

.chatplan-dump {
  display: block;
  margin-top: 2px;
  opacity: 0.6;
  font-size: 12px;
}

.chatplan-warn {
  margin: 0 0 8px;
  font-size: 12px;
  opacity: 0.7;
}

.chatlog {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--mp-surface) 70%, transparent);
  font-size: 13px;
  line-height: 1.3em;
}

.chatlog-text {
  flex: 1 1 160px;
}

.chatlog-actions {
  display: inline-flex;
  gap: 12px;
}

.chatlog-dismiss {
  opacity: 0.65;
}

.chataction {
  color: var(--callout);
  align-self: flex-start;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.2em;
  text-decoration: none;
  display: inline-flex;
}

.chataction:hover {
  color: var(--mp-text);
}

/* "Have a look." inside a done message (a regular Co-Author message): the accent
   underline link that jumps to the last change on the page. */
.chatdone-jump {
  color: var(--mp-accent-soft, var(--callout));
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.chatdone-jump:hover {
  color: var(--mp-text);
}

/* Live "Writing…" placeholder in the slot the done message will take once the
   manuscript is applied. A status, not a message: small, dim shimmer, no signature. */
.chatwriting {
  color: var(--callout);
  font-size: 13px;
  line-height: 1.5em;
}

.chatwriting .chattext {
  font-size: inherit;
  line-height: inherit;
}

.chatwriting .chattext p {
  display: inline-block;
  position: relative;
  margin-bottom: 0;
  animation: mp-page-label 1.5s ease-in-out infinite;
}

.chatwriting .chattext p::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1.5px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--callout), transparent);
  transform-origin: center;
  animation: mp-page-shimmer 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .chatwriting .chattext p,
  .chatwriting .chattext p::after {
    animation: none;
  }

  .chatwriting {
    opacity: 0.75;
  }
}

/* Highlight attachments keep their paragraph breaks (still clamped to 3 lines). */
.chatattatchment > div p {
  margin: 0 0 0.4em;
}

.chatattatchment > div p:last-child {
  margin-bottom: 0;
}

.chatsend-wrapper {
  grid-column-gap: 5px;
  grid-row-gap: 5px;
  justify-content: center;
  align-items: center;
  padding: 0;
  display: flex;
  position: absolute;
  inset: auto 10px 13px auto;
}

.ikonik-b41qe {
  color: var(--mp-text);
}

.summarycontainer {
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  flex-flow: wrap;
  width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 40px;
  display: flex;
  position: relative;
}

.contentblock.summary .summarycontainer.contentcontainer,
.contentblock.beatsheet .summarycontainer.contentcontainer,
.contentblock.characters .summarycontainer.contentcontainer,
.contentblock.summary .settingscontainer.contentcontainer {
  width: 640px;
}

.summarycard {
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  border-radius: 10px;
  flex-flow: column;
  flex: 1 1 100%;
  width: 100%;
  padding: 20px 60px 20px 20px;
  transition: all .21s;
  display: flex;
  position: relative;
}

.summarycard:hover {
  background-color: var(--border);
}

.summarycard.select {
  border-color: var(--mp-accent);
  z-index: 2;
}

.summarycard > .highlighttooltip {
  display: none;
}

.summarycard.select > .highlighttooltip.chapter {
  display: flex;
  inset: auto 0 calc(100% + 10px - 40px);
  z-index: 3;
}

.chaptersummary-title {
  font-size: 22px;
  line-height: 1.6em;
}

.chaptersummary p {
  opacity: .89;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6em;
}

.headerwrapper {
  flex: 1;
  margin-bottom: 30px;
}

.contentblock.summary .summarylist {
  flex: 1 1 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.contentblock.summary .summarylist > .summarycard {
  flex: 0 0 auto;
  width: 100%;
  margin-bottom: 10px;
}

.contentblock.summary .summary-section {
  flex: 0 0 auto;
  width: 100%;
  position: relative;
  box-sizing: border-box;
  margin: 8px 0 10px;
  padding-right: 36px;
  font-family: Figtree, sans-serif;
  font-weight: 500;
  color: var(--mp-accent-soft, var(--callout));
  caret-color: var(--mp-caret);
}

.contentblock.summary .summary-section.is-act {
  margin-top: 18px;
  padding-bottom: 0.4em;
  border: none;
  border-bottom: 1.5px solid var(--mp-accent-muted);
  font-size: 20px;
  line-height: 1.35em;
}

.contentblock.summary .summary-section.is-sub {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.4em;
}

.contentblock.summary .summary-add.is-first + .summary-section {
  margin-top: 2px;
}

.contentblock.summary .summary-section-title {
  outline: none;
  min-height: 1em;
  cursor: text;
}

.contentblock.summary .summary-section-remove {
  appearance: none;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  opacity: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: opacity .15s;
}

.contentblock.summary .summary-section:hover .summary-section-remove,
.contentblock.summary .summary-section:focus-within .summary-section-remove {
  opacity: .42;
}

.contentblock.summary .summary-section-remove:hover,
.contentblock.summary .summary-section-remove:focus-visible {
  opacity: .85;
}

.contentblock.summary .summary-add {
  flex: 0 0 0;
  height: 0;
  width: 100%;
  position: relative;
  z-index: 2;
  overflow: visible;
}

.contentblock.summary .summary-add-btn {
  appearance: none;
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translateX(-50%);
  height: 20px;
  padding: 0 10px;
  border: none;
  background: none;
  color: var(--mp-accent-soft, var(--callout));
  font-family: Figtree, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  transition: opacity .16s ease;
}

.contentblock.summary .summary-add.is-first .summary-add-btn {
  top: -18px;
  height: 22px;
  line-height: 22px;
  opacity: .34;
}

.contentblock.summary .summary-add:hover .summary-add-btn,
.contentblock.summary .summary-add:focus-within .summary-add-btn,
.contentblock.summary .summary-add-btn:focus-visible {
  opacity: .72;
}

@media (hover: none) {
  .contentblock.summary .summary-add-btn {
    opacity: .4;
  }
}

.pagesblock.summarynav {
  padding: 0 0 16px;
  box-sizing: border-box;
}

.pagesblock.summarynav .summarynav-empty {
  color: var(--mp-text-dim);
  text-align: center;
  margin: auto 8px;
  padding: 28px 12px;
  font-size: 14px;
  line-height: 1.5em;
}

.pagesblock.summarynav .pagelink {
  flex: none;
  min-width: 0;
  overflow: hidden;
}

.pagesblock.summarynav .sidelink-content {
  min-width: 0;
  overflow: hidden;
}

.pagesblock.summarynav .sidesub {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(to right, #000 70%, transparent 100%);
  mask-image: linear-gradient(to right, #000 70%, transparent 100%);
}

.contentblock.summary .summary-scene {
  flex: 1 1 100%;
  width: 100%;
  position: relative;
  min-height: 40vh;
}

.contentblock.summary .summary-scene[hidden] {
  display: none;
}

.contentblock.summary .summary-scene > .highlighttooltip {
  display: none;
}

.contentblock.summary .summary-scene.select > .highlighttooltip.chapter {
  display: flex;
  top: auto;
  bottom: calc(100% + 8px);
  inset: auto 0 auto 0;
  z-index: 3;
}

.contentblock.summary .summary-scene-chrome {
  cursor: pointer;
  padding-bottom: 8px;
}

.contentblock.summary .summary-scene-chrome .chaptertitle {
  margin-top: 16px;
  margin-bottom: 24px;
}

.contentblock.summary .summary-dump,
.contentblock.summary .summary-dump .ProseMirror,
.contentblock.summary .summary-prose {
  min-height: 40vh;
  font-family: Figtree, sans-serif;
  caret-color: var(--mp-caret);
}

/* Read-only AI summary above the brainstorm dump. Metadata, not manuscript. */
.contentblock.summary .chapter-summary {
  margin: 0 0 28px;
  font-family: Figtree, sans-serif;
  cursor: default;
}

.contentblock.summary .chapter-summary[hidden] {
  display: none;
}

.contentblock.summary .chapter-summary .fieldlabel,
.contentblock.summary .summary-dump-label .fieldlabel {
  font-size: 12px;
  opacity: 0.7;
}

/* "Chapter/Scene Description" field label sitting tight above the dump editor. */
.contentblock.summary .summary-dump-label {
  margin: 0 0 12px;
  font-family: Figtree, sans-serif;
  cursor: default;
}

.contentblock.summary .summary-dump-label[hidden] {
  display: none;
}

.contentblock.summary .chapter-summary-refresh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: inherit;
  opacity: 0.55;
  text-decoration: none;
  transition: opacity 160ms ease;
}

.contentblock.summary .chapter-summary-refresh:hover,
.contentblock.summary .chapter-summary-refresh:focus-visible {
  opacity: 1;
  color: var(--callout);
}

.contentblock.summary .chapter-summary.is-writing .chapter-summary-refresh {
  pointer-events: none;
  opacity: 0.3;
}

.contentblock.summary .chapter-summary-text {
  position: relative;
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.55;
  opacity: 0.7;
  user-select: text;
}

.contentblock.summary .chapter-summary.is-empty .chapter-summary-text,
.contentblock.summary .chapter-summary.is-error .chapter-summary-text {
  font-style: italic;
  opacity: 0.5;
}

.contentblock.summary .chapter-summary.is-error .chapter-summary-text {
  color: #c0554a;
  opacity: 0.85;
}

/* "Summarizing…" reuses the Co-Author is-writing pulse + shimmer bar. */
.contentblock.summary .chapter-summary.is-writing .chapter-summary-text {
  color: var(--callout);
  opacity: 1;
  padding-bottom: 12px;
  animation: mp-page-label 1.5s ease-in-out infinite;
}

.contentblock.summary .chapter-summary.is-writing .chapter-summary-text::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 7rem;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--callout), transparent);
  transform-origin: center;
  animation: mp-page-shimmer 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .contentblock.summary .chapter-summary.is-writing .chapter-summary-text,
  .contentblock.summary .chapter-summary.is-writing .chapter-summary-text::after {
    animation: none;
  }
}

.contentblock.beatsheet .beatsheet-body {
  flex: 1 1 100%;
  width: 100%;
  min-height: 60vh;
  font-family: Figtree, sans-serif;
  caret-color: var(--mp-caret);
}

.contentblock.beatsheet .beatsheet-prose {
  outline: none;
  min-height: 50vh;
  caret-color: var(--mp-caret);
}

.contentblock.beatsheet .beatsheet-prose p {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7em;
}

.contentblock.beatsheet .beatsheet-prose h2 {
  font-family: Figtree, sans-serif;
  font-weight: 500;
  margin: 1.4em 0 0.55em;
  padding-bottom: 0.4em;
  border-bottom: 1.5px solid var(--mp-accent-muted);
  font-size: 20px;
  line-height: 1.35em;
  color: var(--mp-accent-soft, var(--callout));
}

.contentblock.beatsheet .beatsheet-prose h3 {
  font-family: Figtree, sans-serif;
  font-weight: 500;
  margin: 1.1em 0 0.35em;
  font-size: 16px;
  line-height: 1.4em;
  color: var(--mp-accent-soft, var(--callout));
}

.contentblock.beatsheet .beatsheet-prose h2:first-child,
.contentblock.beatsheet .beatsheet-prose h3:first-child {
  margin-top: 0;
}

.contentblock.beatsheet .beatsheet-prose .beatsheet-hash {
  opacity: 0.3;
  font-weight: 400;
}

.contentblock.beatsheet .beatsheet-prose .beatsheet-hash.is-hidden {
  opacity: 0;
  font-size: 0;
  width: 0;
  display: inline-block;
  overflow: hidden;
  pointer-events: none;
}

.contentblock.beatsheet .beatsheet-prose ul,
.contentblock.beatsheet .beatsheet-prose ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.contentblock.beatsheet .beatsheet-prose li {
  margin-bottom: 0.3em;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7em;
}

.contentblock.beatsheet .beatsheet-prose blockquote {
  border-left: 2px solid var(--mp-accent);
  margin: 0 0 16px;
  padding: 0 0 0 16px;
  color: var(--mp-text-soft);
}

.contentblock.beatsheet .beatsheet-prose strong {
  font-weight: 600;
}

.contentblock.beatsheet .beatsheet-prose em {
  font-style: italic;
}

.contentblock.beatsheet .beatsheet-prose ::selection {
  background: color-mix(in srgb, var(--mp-accent) 35%, transparent);
}

.contentblock.beatsheet .beatsheet-prose .highlighttext.is-attachment {
  background-color: color-mix(in srgb, var(--mp-accent) 35%, transparent);
}

.bookdetails {
  grid-column-gap: 5px;
  grid-row-gap: 5px;
  opacity: 1;
  color: var(--callout);
  justify-content: flex-start;
  align-items: center;
  font-family: Figtree, sans-serif;
  font-size: 15px;
  line-height: 1em;
  display: flex;
}

.bookdetails.full-opacity {
  opacity: 1;
}

.bookdeets {
  grid-column-gap: 5px;
  grid-row-gap: 5px;
  opacity: .7;
  color: var(--callout);
  justify-content: flex-start;
  align-items: center;
  font-family: Figtree, sans-serif;
  font-size: 12.34px;
  line-height: 1em;
  display: flex;
}

.bookdeets.full-opacity {
  opacity: 1;
}

.bookdetails-block {
  grid-column-gap: 6px;
  grid-row-gap: 6px;
  flex-flow: column;
  padding-top: 3px;
  display: flex;
}

.gotochapter {
  grid-column-gap: 9px;
  grid-row-gap: 9px;
  border-bottom: 1.5px solid var(--border);
  border-left: 1.5px solid var(--border);
  color: var(--mp-text);
  border-bottom-left-radius: 10px;
  justify-content: flex-start;
  align-items: center;
  padding: 15px 15px 13px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  position: absolute;
  inset: 0% 0% auto auto;
}

.gotochapter:hover {
  background-color: var(--border);
}

.chapterarrow-icon {
  color: var(--mp-text);
  flex: none;
  width: 14px;
  height: 14px;
}

.ikonik-55w33, .ikonik-d56lo, .ikonik-zch3a, .ikonik-u20yr, .ikonik-t51lm, .ikonik-wodk4, .ikonik-rgcxok, .ikonik-7v8gc, .ikonik-iq61q, .ikonik-qp91b, .ikonik-1zuqw, .ikonik-s9vswi {
  color: var(--mp-text);
}

.centertab {
  grid-column-gap: 20px;
  grid-row-gap: 20px;
  color: var(--mp-text-dim);
  text-align: center;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  padding: 30px 50px 70px;
  font-size: 16px;
  line-height: 1.6em;
  display: flex;
  position: absolute;
  inset: 0% 0% 0% auto;
}

.pageicon {
  width: 50px;
  height: 50px;
}

.chapterpills {
  grid-column-gap: 5px;
  grid-row-gap: 5px;
  flex-flow: wrap;
  display: flex;
}

.chapterpill {
  border: 1.5px solid var(--border);
  color: var(--mp-text);
  border-radius: 10px;
  padding: 4px 8px 3px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  display: flex;
}

.chapterpill:hover {
  border-color: var(--callout);
}

.settingsblock {
  grid-column-gap: 15px;
  grid-row-gap: 15px;
  flex-flow: column;
  display: flex;
}

.settingscontainer {
  grid-column-gap: 30px;
  grid-row-gap: 30px;
  flex-flow: column;
  width: 770px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  position: relative;
}

.labelrow {
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  justify-content: flex-start;
  align-items: center;
  display: flex;
}

.fieldlabel {
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 500;
}

.fieldlabel-divider {
  background-color: var(--border);
  flex: 1;
  height: 1.5px;
  display: flex;
}

.textfield {
  border: 1.5px solid var(--border);
  background-color: var(--border);
  color: var(--mp-text);
  caret-color: var(--mp-caret);
  border-radius: 10px;
  min-height: 330px;
  padding: 18px;
  font-size: 15.55px;
  font-weight: 300;
  line-height: 1.8em;
}

.textfield:focus {
  border-color: var(--callout);
}

.textfield.single {
  min-height: 0;
  height: 52px;
  margin-bottom: 0;
  line-height: 1.4em;
  padding: 12px 18px;
}

textarea.textfield {
  display: block;
  width: 100%;
  resize: vertical;
  font-family: inherit;
}

.generatebutton.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.bookcard {
  grid-column-gap: 23px;
  grid-row-gap: 23px;
  border: 1.5px solid var(--border);
  color: var(--mp-text);
  cursor: pointer;
  border-radius: 10px;
  flex-flow: row;
  flex: 0 auto;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 60px 10px 10px;
  text-decoration: none;
  transition: all .21s;
  display: flex;
  position: relative;
}

.bookcard:hover {
  background-color: var(--border);
}

.bookcard.select {
  border-color: var(--callout);
}

.bookthumb {
  aspect-ratio: 2 / 3;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  flex: none;
  width: 280px;
  position: relative;
  overflow: hidden;
}

.booksettings {
  grid-column-gap: 20px;
  grid-row-gap: 20px;
  flex-flow: column;
  display: flex;
}

.booktitle-card {
  margin-bottom: 5px;
  font-size: 30px;
  line-height: 1.6em;
}

.newbook {
  border: 1.5px solid var(--border);
  color: var(--mp-text);
  border-radius: 10px;
  flex: 1;
  justify-content: center;
  align-items: center;
  height: 70px;
  font-size: 16px;
  text-decoration: none;
  display: flex;
}

.newbook:hover {
  border-color: var(--callout);
  background-color: var(--border);
}

.booksummary {
  opacity: .89;
  font-size: 15.55px;
  font-weight: 300;
  line-height: 1.7em;
}

.texthistory {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.texthistory::-webkit-scrollbar {
  display: none;
}

.texthistory > * {
  flex-shrink: 0;
}

.texthistory > :first-child {
  margin-top: auto;
}

.glancechat-input {
  background-color: #0000;
  border: 0;
  color: var(--mp-text);
  caret-color: var(--mp-caret);
  outline: none;
  flex: 1;
  min-width: 0;
  min-height: 22px;
  max-height: 230px;
  height: auto;
  padding: 0;
  font-family: inherit;
  font-size: 15.55px;
  line-height: 1.4em;
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
  box-sizing: border-box;
  display: block;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.glancechat-input::placeholder {
  color: var(--mp-text);
  opacity: .4;
}

.chaptertitle[contenteditable="true"] {
  outline: none;
  caret-color: var(--mp-caret);
  min-height: 1.4em;
}

.chaptertitle[contenteditable="true"]:empty::before {
  content: "Untitled";
  color: var(--mp-text-faint);
}

.chapter-highlight-demo,
.div-block:has(.highlighttooltip) {
  display: none !important;
}

.richtext.chapter-body,
.richtext[data-chapter-body] {
  font-family: Literata, Georgia, serif;
  caret-color: var(--mp-caret);
}

.richtext .ProseMirror,
.richtext .chapter-prose {
  outline: none;
  min-height: 40vh;
  white-space: pre-wrap;
  word-wrap: break-word;
  caret-color: var(--mp-caret);
}

.richtext .ProseMirror p,
.richtext .chapter-prose p {
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.8em;
}

.richtext .ProseMirror h1,
.richtext .ProseMirror h2,
.richtext .ProseMirror h3,
.richtext .chapter-prose h1,
.richtext .chapter-prose h2,
.richtext .chapter-prose h3 {
  font-family: Figtree, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--mp-text);
}

.richtext .ProseMirror h1,
.richtext .chapter-prose h1 {
  margin: 1.4em 0 0.55em;
  font-size: 28px;
  line-height: 1.3em;
}

.richtext .ProseMirror h2,
.richtext .chapter-prose h2 {
  margin: 1.25em 0 0.45em;
  font-size: 22px;
  line-height: 1.35em;
}

.richtext .ProseMirror h3,
.richtext .chapter-prose h3 {
  margin: 1.1em 0 0.4em;
  font-size: 18px;
  line-height: 1.4em;
}

.richtext .ProseMirror blockquote,
.richtext .chapter-prose blockquote {
  border-left: 2px solid var(--mp-accent);
  margin: 0 0 20px;
  padding: 0 0 0 16px;
  color: var(--mp-text-soft);
}

.richtext .ProseMirror ul,
.richtext .ProseMirror ol,
.richtext .chapter-prose ul,
.richtext .chapter-prose ol {
  margin: 0 0 20px;
  padding-left: 1.4em;
}

.richtext .ProseMirror li,
.richtext .chapter-prose li {
  margin-bottom: 0.35em;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.8em;
}

.richtext .ProseMirror strong,
.richtext .chapter-prose strong {
  font-weight: 600;
}

.richtext .ProseMirror em,
.richtext .chapter-prose em {
  font-style: italic;
}

.richtext .ProseMirror ::selection,
.richtext .chapter-prose ::selection {
  background: color-mix(in srgb, var(--mp-accent) 35%, transparent);
}

.richtext .ProseMirror .highlighttext.is-attachment,
.richtext .chapter-prose .highlighttext.is-attachment {
  background-color: color-mix(in srgb, var(--mp-accent) 35%, transparent);
}

.richtext .ProseMirror .highlighttext.is-last-change,
.richtext .chapter-prose .highlighttext.is-last-change {
  background-color: color-mix(in srgb, var(--mp-accent) 44%, transparent);
  box-shadow: inset 0 -2px 0 0 color-mix(in srgb, var(--callout) 85%, transparent);
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

html.is-page-writing .richtext .ProseMirror .highlighttext.is-last-change,
html.is-page-writing .richtext .chapter-prose .highlighttext.is-last-change {
  animation: mp-last-change-pulse 1.2s ease-in-out infinite;
}

@keyframes mp-last-change-pulse {
  0%, 100% { background-color: color-mix(in srgb, var(--mp-accent) 32%, transparent); }
  50% { background-color: color-mix(in srgb, var(--mp-accent) 58%, transparent); }
}

/* Brief pulse when the author jumps to the last change from the chat ("Show me"). */
html.is-change-pulse .richtext .highlighttext.is-last-change {
  animation: mp-last-change-pulse 0.8s ease-in-out 3;
}

.contentblock.pages .is-speaking .highlighttext.is-last-change {
  background-color: color-mix(in srgb, var(--mp-accent) 55%, transparent);
  box-shadow: inset 0 -2px 0 0 var(--callout);
}

.richtext .ProseMirror-focused {
  outline: none;
}

.highlighttooltip-host {
  position: fixed;
  z-index: 200;
  width: 460px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 180ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0ms linear 180ms;
}

.highlighttooltip-host.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 250ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0ms linear 0ms;
}

.highlighttooltip-host[hidden] {
  display: none !important;
}

.highlighttooltip-host .highlighttooltip {
  position: relative;
  inset: auto;
  margin: 0;
  pointer-events: none;
}

.highlighttooltip-host.is-visible .highlighttooltip {
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .highlighttooltip-host {
    transform: none;
    transition: opacity 80ms linear, visibility 0ms linear 80ms;
  }

  .highlighttooltip-host.is-visible {
    transform: none;
    transition: opacity 80ms linear, visibility 0ms linear 0ms;
  }

  html.is-page-writing .richtext .highlighttext.is-last-change,
  html.is-change-pulse .richtext .highlighttext.is-last-change {
    animation: none;
  }
}

.highlight-suggest-form {
  margin-bottom: 0;
}

.contentblock.pages,
.contentblock.summary,
.contentblock.characters,
.contentblock.beatsheet {
  overscroll-behavior-y: contain;
}

.nextchapter {
  z-index: 16;
  box-sizing: border-box;
  min-width: 241px;
  max-width: min(420px, calc(100% - 48px));
  height: 55px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 22px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background-color: color-mix(in srgb, var(--mp-surface) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 10px color-mix(in srgb, var(--mp-accent) 10%, transparent);
  color: var(--mp-text);
  font-family: Figtree, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-content: center;
  align-items: center;
  display: flex;
  position: fixed;
  bottom: 82px;
  left: 321px;
  right: 460px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 360ms cubic-bezier(0.22, 1, 0.36, 1), transform 360ms cubic-bezier(0.22, 1, 0.36, 1), visibility 360ms cubic-bezier(0.22, 1, 0.36, 1), left 360ms cubic-bezier(0.22, 1, 0.36, 1), right 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nextchapter .dim {
  margin-right: 0.3em;
  opacity: 0.55;
}

.nextchapter.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.nextchapter:focus-visible {
  outline: 2px solid var(--callout);
  outline-offset: 3px;
}

.pagewrapper:has(.pagedrawer.closed) .nextchapter {
  left: 0;
}

.pagewrapper:has(.pagedrawer.sneak) .nextchapter {
  left: 50px;
}

.pagewrapper:has(.chatdrawer.closed) .nextchapter {
  right: 53px;
}

.contentblock.pages.is-chapter-arrive .contentcontainer:not([hidden]) {
  animation: magicpage-chapter-arrive 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes magicpage-chapter-arrive {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.themeswatches {
  grid-column-gap: 10px;
  grid-row-gap: 10px;
  flex-flow: wrap;
  align-items: center;
  display: flex;
}

.themeswatch {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: hsl(var(--swatch-hue) var(--swatch-sat) 65%);
  cursor: pointer;
  display: flex;
  position: relative;
  overflow: hidden;
  transition: border-color .21s, box-shadow .21s, transform .21s;
}

.themeswatch:hover {
  border-color: color-mix(in srgb, var(--mp-accent) 45%, transparent);
  transform: translateY(-1px);
}

.themeswatch.is-selected {
  border-color: var(--mp-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mp-accent) 35%, transparent);
}

.themeswatch-custom {
  background:
    conic-gradient(from 180deg, #bd82cc, #5b8def, #3ecfc4, #e8a23a, #e06b8a, #bd82cc);
}

.themeswatch-custom.is-selected {
  background: var(--mp-accent);
}

.theme-color-input {
  appearance: none;
  -webkit-appearance: none;
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.themeswatch-hint {
  opacity: .55;
  color: var(--mp-text);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5em;
}

.pagesblock[data-character-nav] .pagegrabber {
  display: none;
}

.pagesblock[data-character-nav] .sidesub {
  text-transform: none;
  letter-spacing: 0;
}

.pagesblock[data-character-nav] .pagelink:hover .pagethumb .pagenum,
.pagesblock[data-character-nav] .pagelink.is-dragging .pagethumb .pagenum {
  opacity: 1;
}

.contentblock.characters .summarycontainer {
  padding-bottom: 40px;
  cursor: pointer;
  position: relative;
}

.contentblock.characters > .contentcontainer.summarycontainer {
  padding-bottom: 80px;
}

.character-delete {
  display: inline-block;
  margin-top: 28px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--mp-text-dim);
  font-family: Figtree, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease;
}

.character-delete:hover,
.character-delete:focus-visible {
  color: var(--mp-text);
  outline: none;
}

.character-delete.is-armed {
  color: var(--mp-danger);
}

.contentblock.characters .headerwrapper {
  cursor: pointer;
}

.contentblock.characters .chaptertitle[contenteditable="true"] {
  outline: none;
  caret-color: var(--mp-caret);
  cursor: text;
}

.contentblock.characters .chaptertitle[contenteditable="true"]:empty::before {
  content: "New character";
  color: var(--mp-text-faint);
}

.contentblock.characters .character-body {
  flex: 1 1 100%;
  width: 100%;
  min-height: 40vh;
  font-family: Figtree, sans-serif;
  caret-color: var(--mp-caret);
  cursor: text;
}

.contentblock.characters .character-prose {
  outline: none;
  min-height: 40vh;
  caret-color: var(--mp-caret);
}

.contentblock.characters .character-prose p {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7em;
}

.contentblock.characters .character-prose h2 {
  font-family: Figtree, sans-serif;
  font-weight: 500;
  margin: 1.4em 0 0.55em;
  padding-bottom: 0.4em;
  border-bottom: 1.5px solid var(--mp-accent-muted);
  font-size: 20px;
  line-height: 1.35em;
  color: var(--mp-accent-soft, var(--callout));
}

.contentblock.characters .character-prose h3 {
  font-family: Figtree, sans-serif;
  font-weight: 500;
  margin: 1.1em 0 0.35em;
  font-size: 16px;
  line-height: 1.4em;
  color: var(--mp-accent-soft, var(--callout));
}

.contentblock.characters .character-prose h2:first-child,
.contentblock.characters .character-prose h3:first-child {
  margin-top: 0;
}

.contentblock.characters .character-prose .beatsheet-hash {
  opacity: 0.3;
  font-weight: 400;
}

.contentblock.characters .character-prose .beatsheet-hash.is-hidden {
  opacity: 0;
  font-size: 0;
  width: 0;
  display: inline-block;
  overflow: hidden;
  pointer-events: none;
}

.contentblock.characters .character-prose ul,
.contentblock.characters .character-prose ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.contentblock.characters .character-prose li {
  margin-bottom: 0.3em;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7em;
}

.contentblock.characters .character-prose blockquote {
  border-left: 2px solid var(--mp-accent);
  margin: 0 0 16px;
  padding: 0 0 0 16px;
  color: var(--mp-text-soft);
}

.contentblock.characters .character-prose strong {
  font-weight: 600;
}

.contentblock.characters .character-prose em {
  font-style: italic;
}

.contentblock.characters .character-prose ::selection {
  background: color-mix(in srgb, var(--mp-accent) 35%, transparent);
}

.contentblock.characters .character-prose .highlighttext.is-attachment {
  background-color: color-mix(in srgb, var(--mp-accent) 35%, transparent);
}

.contentblock.characters .character-prose[data-empty="true"] p:first-child:empty::before,
.contentblock.characters .character-prose[data-empty="true"] p:first-child:has(br):only-child::before {
  content: "Add notes…";
  color: var(--mp-text-faint);
  pointer-events: none;
}

.contentblock.characters .summarycontainer > .highlighttooltip {
  display: none;
}

.contentblock.characters .summarycontainer.select > .highlighttooltip.chapter {
  display: flex;
  inset: auto 0 calc(100% + 10px - 40px);
  z-index: 3;
}

.contentblock.characters .chapterpills {
  display: none;
}

.contentblock.characters .newcharacter {
  display: none;
}

.newcharacter {
  z-index: 16;
  box-sizing: border-box;
  min-width: 241px;
  max-width: min(420px, calc(100% - 48px));
  height: 55px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 22px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background-color: color-mix(in srgb, var(--mp-surface) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 10px color-mix(in srgb, var(--mp-accent) 10%, transparent);
  color: var(--mp-text);
  font-family: Figtree, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  justify-content: center;
  align-items: center;
  display: flex;
  position: fixed;
  bottom: 40px;
  left: 321px;
  right: 460px;
}

.newcharacter-plus {
  color: var(--mp-accent);
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.newcharacter-plusicon {
  width: 16px;
  height: 16px;
}

.newcharacter:hover {
  border-color: var(--callout);
}

.newcharacter:focus-visible {
  outline: 2px solid var(--callout);
  outline-offset: 3px;
}

.pagewrapper:has(.pagedrawer.closed) .newcharacter {
  left: 0;
}

.pagewrapper:has(.pagedrawer.sneak) .newcharacter {
  left: 50px;
}

.pagewrapper:has(.chatdrawer.closed) .newcharacter {
  right: 53px;
}

.book-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.book-title-row .textfield.single {
  flex: 1;
  width: auto;
  min-width: 0;
}

.book-cover-thumb {
  background-color: var(--mp-fill-active);
  border: none;
  border-radius: 5px;
  flex: none;
  width: 39px;
  height: 52px;
  padding: 0;
  cursor: pointer;
  display: flex;
  position: relative;
  overflow: hidden;
  transition: filter 160ms ease;
}

.book-cover-thumb:hover {
  filter: brightness(1.18);
}

.book-cover-thumb:focus-visible {
  outline: 2px solid var(--callout);
  outline-offset: 2px;
}

.generatebutton {
  box-sizing: border-box;
  grid-column-gap: 8px;
  grid-row-gap: 8px;
  border: 1.5px solid var(--border);
  color: var(--mp-text);
  background-color: transparent;
  border-radius: 100px;
  justify-content: center;
  align-items: center;
  width: 640px;
  height: 55px;
  margin: 0 0 20px;
  padding: 0 22px;
  font-family: Figtree, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  display: none;
  position: static;
}

.generatebutton .buttonicon {
  flex: none;
  width: 16px;
  height: 16px;
}

.contentcontainer.is-empty > .generatebutton {
  display: flex;
}

/* Empty-page hint. Stored manuscript is <p></p>; this text is never persisted. */
.contentcontainer.is-empty .chapter-prose > p:first-child:last-child::before {
  content: "Write your masterpiece here...";
  color: var(--mp-text-dim);
  opacity: 0.45;
  float: left;
  height: 0;
  pointer-events: none;
}

.generatebutton[hidden] {
  display: none;
}

.generatebutton:hover {
  background-color: color-mix(in srgb, var(--mp-surface) 50%, transparent);
}

.generatebutton:focus-visible {
  outline: 2px solid var(--callout);
  outline-offset: 3px;
}

.audiocontrols[hidden] {
  display: none;
}

.contentblock.pages:has(.contentcontainer:not([hidden]).is-empty) .audiocontrols {
  display: none;
}

.thememodes,
.exportmodes {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: fit-content;
  display: flex;
}

.thememode {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--mp-text-dim);
  border: none;
  margin: 0;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2em;
  cursor: pointer;
}

.thememode + .thememode {
  border-left: 1.5px solid var(--border);
}

.thememode:hover {
  color: var(--mp-text);
  background-color: var(--mp-fill-hover);
}

.thememode.is-selected {
  color: var(--mp-text);
  background-color: color-mix(in srgb, var(--mp-accent) 18%, transparent);
}

.thememode:focus-visible {
  outline: 2px solid var(--callout);
  outline-offset: -2px;
  z-index: 1;
}

.booktitle-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.format-badge {
  border: 1.5px solid var(--border);
  border-radius: 100px;
  color: var(--mp-text-dim);
  padding: 2px 10px;
  font-family: Figtree, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.pagewrapper.is-library {
  flex-direction: column;
}

.pagewrapper.is-library .pagedrawer {
  width: 100%;
  height: auto;
  position: relative;
  overflow: visible;
}

.pagewrapper.is-library .drawericon.preview,
.pagewrapper.is-library .pagesblock {
  display: none;
}

.pagewrapper.is-library .logo {
  background-color: var(--mp-fill-active);
}

.logo-mark {
  display: block;
  width: 26px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.pagewrapper.is-library .contentblock {
  padding-top: 24px;
  border-left: 0;
  border-right: 0;
  width: auto;
}

[data-book-library] {
  display: contents;
}

/* Library (all-books.html): a single column that shares .contentcontainer's 640px
   width/centering. [data-book-library] is display: contents, so the heading, each
   card and the "Create new book" row are all direct flex items here. */
.contentblock > .contentcontainer.librarycontainer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.librarycontainer > .headerwrapper {
  flex: none;
  width: 100%;
  margin-bottom: 16px;
}

.librarycontainer .bookcard {
  flex: none;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 24px 10px 10px;
}

.librarycontainer .bookthumb {
  width: 150px;
}

.librarycontainer .booksettings {
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
}

.librarycontainer .booktitle-card {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.4em;
}

.librarycontainer .booksummary:empty {
  display: none;
}

.librarycontainer > [data-book-library] > .newbook,
.librarycontainer > .newbook {
  flex: none;
  box-sizing: border-box;
  width: 100%;
  height: 64px;
  border-style: dashed;
  color: var(--mp-text-dim);
}

.librarycontainer > [data-book-library] > .newbook:hover,
.librarycontainer > .newbook:hover {
  color: var(--mp-text);
}

.librarycontainer > .book-create {
  flex: none;
}

.book-create {
  flex: 1 1 100%;
  width: 100%;
  display: flex;
  flex-flow: column;
  gap: 18px;
}

.book-create[hidden],
.book-create-step[hidden],
.bookcard[data-library-template],
.bookcard[hidden] {
  display: none;
}

.book-create-back {
  color: var(--mp-text-dim);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  width: fit-content;
}

.book-create-back:hover {
  color: var(--mp-text);
}

.book-create-title {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3em;
}

.book-create-copy {
  margin: 0;
  opacity: 0.7;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5em;
}

.format-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media screen and (max-width: 680px) {
  .format-choices {
    grid-template-columns: 1fr;
  }
}

.format-choice {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--mp-text);
  cursor: pointer;
  display: flex;
  flex-flow: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 120px;
  padding: 22px 24px;
  text-align: left;
  transition: all 0.21s;
}

.format-choice:hover,
.format-choice.is-selected {
  border-color: var(--callout);
  background-color: var(--border);
}

.format-choice:focus-visible {
  outline: 2px solid var(--callout);
  outline-offset: 2px;
}

.format-choice-title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3em;
}

.format-choice-sub {
  opacity: 0.7;
  font-size: 14px;
  font-weight: 300;
}

.format-readonly {
  border: 1.5px solid var(--border);
  background-color: var(--border);
  border-radius: 10px;
  color: var(--mp-text);
  height: 52px;
  padding: 12px 18px;
  font-size: 15.55px;
  font-weight: 400;
  line-height: 1.4em;
  display: flex;
  align-items: center;
}

html.is-screenplay .generatebutton,
body.is-screenplay .generatebutton,
html.is-screenplay .contentcontainer.is-empty > .generatebutton,
body.is-screenplay .contentcontainer.is-empty > .generatebutton {
  display: none !important;
}

.richtext.fountain-body,
.richtext[data-fountain-editor] {
  font-family: "Courier New", Courier, monospace;
}

.richtext .fountain-prose,
.richtext .fountain-prose.ProseMirror {
  outline: none;
  min-height: 40vh;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.15;
  caret-color: var(--mp-caret);
}

.richtext .fountain-prose p,
.richtext .fountain-prose .fountain-line {
  margin: 0 0 0.15em;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.15;
}

.richtext .fountain-prose .fountain-scene {
  margin: 1.4em 0 0.85em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--callout);
}

.richtext .fountain-prose .fountain-action {
  margin: 0 0 0.85em;
  margin-bottom: calc(0.85em + 5px);
  line-height: 1.3em;
}

.richtext .fountain-prose .fountain-character {
  margin: 1em 0 5px;
  padding-left: 38%;
  text-transform: uppercase;
  font-weight: 600;
}

.richtext .fountain-prose .fountain-parenthetical {
  padding-left: 26%;
  padding-right: 22%;
}

.richtext .fountain-prose .fountain-dialogue {
  padding-left: 18%;
  padding-right: 18%;
  margin-bottom: 0.85em;
  margin-bottom: calc(0.85em + 5px);
}

.richtext .fountain-prose .fountain-transition {
  margin: 1em 0 1em;
  text-align: right;
  text-transform: uppercase;
}

/* Fountain force markers ("!" action, "@" cue, "." scene, ">" transition) stay in the
   text so a forced kind survives a reload; they are only dimmed on screen. */
.richtext .fountain-prose .fountain-force-marker {
  opacity: 0.35;
}

.richtext .fountain-prose.ProseMirror-empty::before,
.richtext .fountain-prose p.fountain-line:only-child:empty::before {
  content: "INT. LOCATION - DAY";
  color: var(--mp-text-dim);
  opacity: 0.45;
  pointer-events: none;
}

.richtext .fountain-prose .highlighttext.is-attachment {
  background-color: color-mix(in srgb, var(--mp-accent) 35%, transparent);
}

.richtext .fountain-prose .highlighttext.is-last-change {
  background-color: color-mix(in srgb, var(--mp-accent) 44%, transparent);
  box-shadow: inset 0 -2px 0 0 color-mix(in srgb, var(--callout) 85%, transparent);
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

html.is-page-writing .richtext .fountain-prose .highlighttext.is-last-change {
  animation: mp-last-change-pulse 1.2s ease-in-out infinite;
}

.richtext .fountain-prose ::selection {
  background: color-mix(in srgb, var(--mp-accent) 35%, transparent);
}

.fountain-suggest {
  position: fixed;
  z-index: 180;
  min-width: 148px;
  max-width: 280px;
  padding: 4px;
  border-radius: 8px;
  background-color: var(--mp-surface-raised);
  box-shadow: var(--mp-shadow);
  color: var(--mp-text);
  pointer-events: auto;
}

.fountain-suggest[hidden] {
  display: none !important;
}

.fountain-suggest-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--mp-text);
  font-family: Figtree, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.fountain-suggest-item:hover,
.fountain-suggest-item.is-active {
  background-color: var(--mp-fill-active);
  color: var(--mp-text);
}

.book-cloud {
  max-width: 36rem;
  margin: 0 0 28px;
}

.book-cloud-status {
  margin: 0 0 10px;
  color: var(--mp-text-dim, #6b6560);
  font-family: Figtree, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.book-cloud-form,
.book-cloud-signedin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.book-cloud-form[hidden],
.book-cloud-signedin[hidden] {
  display: none !important;
}

.book-cloud-form input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
}

.book-cloud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

html.mp-auth-pending .pagewrapper {
  visibility: hidden;
}

[data-book-library][hidden] {
  display: none !important;
}

/* Mobile chrome: same drawers, icons, type, and audio pill — re-skinned as a
   top menu + chapter sheet + full-width chat, not a new visual language. */
.mobilebar {
  display: none;
}

.mobile-backdrop {
  display: none;
}

.drawericon.preview .mobilebar-back {
  display: none;
}

@media screen and (max-width: 800px) {
  :root {
    --mp-mobilebar: calc(80px + env(safe-area-inset-top, 0px));
  }

  .mobilebar.drawermenu {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    width: 100%;
    height: var(--mp-mobilebar);
    padding-top: calc(15px + env(safe-area-inset-top, 0px));
    background-color: var(--mp-bg);
  }

  html[data-theme="light"] .mobilebar.drawermenu {
    background-color: var(--mp-surface);
  }

  .mobilebar.drawermenu .text-block {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
  }

  .mobilebar.drawermenu > .drawericon.preview,
  .mobilebar.drawermenu > .drawericon.chatfloat {
    display: flex;
    position: relative;
    inset: auto;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 3;
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background-color: var(--background);
    color: var(--mp-accent-muted);
    transform: none;
    pointer-events: auto;
  }

  .mobilebar.drawermenu > .drawericon.chatfloat svg,
  .chatdrawer.closed .mobilebar .drawericon.chatfloat svg,
  .mobilebar.drawermenu > .drawericon.preview svg {
    transform: none;
  }

  .drawericon.preview.is-back .drawerico {
    display: none;
  }

  .drawericon.preview.is-back .mobilebar-back {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .drawericon.preview.is-back .mobilebar-back .logo-back-icon {
    width: 18px;
    height: 18px;
  }

  html.is-mobile-chapters .mobile-backdrop.sideoverlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 38;
    pointer-events: auto;
  }

  .pagedrawer,
  .pagedrawer.closed,
  .pagedrawer.sneak {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    flex: 0 0 0;
    min-width: 0;
    width: 100%;
    height: 88vh;
    max-height: 88vh;
    overflow: hidden;
    background-color: var(--mp-bg);
    border-top: 1.5px solid var(--border);
    border-radius: 10px 10px 0 0;
    transform: translateY(110%);
    pointer-events: none;
    transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  html[data-theme="light"] .pagedrawer,
  html[data-theme="light"] .pagedrawer.closed,
  html[data-theme="light"] .pagedrawer.sneak {
    background-color: var(--mp-surface);
  }

  .pagedrawer.is-sheet-open {
    transform: translateY(0);
    pointer-events: auto;
  }

  .pagedrawer.sneak .drawermenu {
    justify-content: space-between;
    align-items: center;
    gap: 12.34px;
    padding-left: 15px;
    padding-right: 15px;
    border-bottom-color: var(--border);
  }

  .pagedrawer.sneak .drawermenu > .alignrow {
    position: relative;
  }

  .pagedrawer.sneak .drawermenu .alignrow,
  .pagedrawer.sneak .tabs,
  .pagedrawer.sneak .pagesblock {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    width: auto;
    min-width: 0;
    overflow: visible;
    transform: none;
    transition: none;
  }

  .pagedrawer.sneak .drawermenu > .drawericon svg {
    transform: none;
  }

  .pagedrawer .drawermenu .logo .logo-back {
    opacity: 1;
  }

  .chatdrawer,
  .chatdrawer.closed {
    position: fixed;
    top: var(--mp-mobilebar);
    left: 0;
    right: 0;
    z-index: 35;
    flex: 0 0 0;
    min-width: 0;
    width: 100%;
    height: calc(var(--mp-vvh, 100dvh) - var(--mp-mobilebar));
    padding: 0;
    overflow: hidden;
    background-color: var(--mp-bg);
    transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear;
  }

  html[data-theme="light"] .chatdrawer,
  html[data-theme="light"] .chatdrawer.closed {
    background-color: var(--mp-surface);
  }

  .chatdrawer.closed {
    padding: 0;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
  }

  .chatdrawer.closed .chatwrapper {
    transform: none;
  }

  .chatwrapper {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .chatbackground .fullimage,
  .chatbackground .sideoverlay {
    display: none;
  }

  .contentblock,
  .contentblock.pages,
  .contentblock.summary,
  .contentblock.characters,
  .contentblock.beatsheet {
    width: auto;
    padding-top: var(--mp-mobilebar);
  }

  .contentblock.pages .contentcontainer,
  .contentblock > .contentcontainer,
  .contentcontainer,
  .summarycontainer,
  .contentblock.summary .summarycontainer.contentcontainer,
  .contentblock.beatsheet .summarycontainer.contentcontainer,
  .contentblock.characters .summarycontainer.contentcontainer,
  .contentblock.summary .settingscontainer.contentcontainer {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }

  .contentblock.pages .contentcontainer {
    padding-bottom: 120px;
  }

  .stickypage {
    z-index: 10;
    padding-left: 20px;
    padding-right: 20px;
  }

  .audiocontrols,
  .pagewrapper:has(.pagedrawer.closed) .audiocontrols,
  .pagewrapper:has(.pagedrawer.sneak) .audiocontrols,
  .pagewrapper:has(.chatdrawer.closed) .audiocontrols {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .nextchapter,
  .pagewrapper:has(.pagedrawer.closed) .nextchapter,
  .pagewrapper:has(.pagedrawer.sneak) .nextchapter,
  .pagewrapper:has(.chatdrawer.closed) .nextchapter,
  .newcharacter,
  .pagewrapper:has(.pagedrawer.closed) .newcharacter,
  .pagewrapper:has(.pagedrawer.sneak) .newcharacter,
  .pagewrapper:has(.chatdrawer.closed) .newcharacter {
    left: 12px;
    right: 12px;
  }

  .nextchapter {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .newcharacter {
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }

  html.is-mobile-chat .contentblock,
  html.is-mobile-chat .audiocontrols,
  html.is-mobile-chat .nextchapter,
  html.is-mobile-chat .newcharacter {
    visibility: hidden;
    pointer-events: none;
  }

  html.is-mobile-chat .audiocontrols,
  html.is-mobile-chat .nextchapter,
  html.is-mobile-chat .newcharacter {
    display: none;
  }

  .textwriting {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .pagewrapper.is-library .mobilebar {
    display: none;
  }

  .pagewrapper.is-library .contentblock {
    padding-top: 16px;
  }

  .pagewrapper.is-library .pagedrawer,
  .pagewrapper.is-library .pagedrawer.closed,
  .pagewrapper.is-library .pagedrawer.sneak {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: 3;
    width: 100%;
    height: auto;
    max-height: none;
    transform: none;
    pointer-events: auto;
    border-top: 0;
    border-radius: 0;
    overflow: visible;
  }

  .librarycontainer .bookthumb {
    width: 96px;
  }

  .librarycontainer .booktitle-card {
    font-size: 20px;
  }

  .librarycontainer .bookcard {
    padding: 10px 12px 10px 10px;
  }

  .book-cloud .format-choice {
    min-height: 52px;
    padding: 12px 18px;
  }
}

