/* Adapted from ag-fifthpendium-tcm/styles/{variables,journal,toc}.css.
   Foundry window controls are omitted; semantic references retain the site palette.
   Beaufort and Roboto Serif include the Cyrillic glyphs supplied by Foundry's ru-ru module. */

@font-face {
  font-family: 'TCM Beaufort';
  src: url('/styles/sourcebooks/assets/tcm/fonts/Beaufort-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Beaufort';
  src: url('/styles/sourcebooks/assets/tcm/fonts/Beaufort-RegularItalic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Beaufort';
  src: url('/styles/sourcebooks/assets/tcm/fonts/Beaufort-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Beaufort';
  src: url('/styles/sourcebooks/assets/tcm/fonts/Beaufort-MediumItalic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Beaufort';
  src: url('/styles/sourcebooks/assets/tcm/fonts/Beaufort-Bold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Beaufort';
  src: url('/styles/sourcebooks/assets/tcm/fonts/Beaufort-BoldItalic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Beaufort';
  src: url('/styles/sourcebooks/assets/tcm/fonts/Beaufort-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Beaufort';
  src: url('/styles/sourcebooks/assets/tcm/fonts/Beaufort-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Roboto Serif';
  src: url('/styles/sourcebooks/assets/tcm/fonts/RobotoSerif-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Roboto Serif';
  src: url('/styles/sourcebooks/assets/tcm/fonts/RobotoSerif-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Roboto Serif';
  src: url('/styles/sourcebooks/assets/tcm/fonts/RobotoSerif-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Roboto Serif';
  src: url('/styles/sourcebooks/assets/tcm/fonts/RobotoSerif-MediumItalic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Roboto Serif';
  src: url('/styles/sourcebooks/assets/tcm/fonts/RobotoSerif-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Roboto Serif';
  src: url('/styles/sourcebooks/assets/tcm/fonts/RobotoSerif-SemiBoldItalic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Roboto Serif';
  src: url('/styles/sourcebooks/assets/tcm/fonts/RobotoSerif-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TCM Roboto Serif';
  src: url('/styles/sourcebooks/assets/tcm/fonts/RobotoSerif-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

.sourcebook-page.sourcebook--tcm {
  --tcm-font-display: 'TCM Beaufort', 'TCM Roboto Serif', Georgia, serif;
  --tcm-font-antique: 'TCM Roboto Serif', Georgia, 'Times New Roman', serif;
  --tcm-font-body: 'TCM Roboto Serif', Georgia, 'Times New Roman', serif;
  --tcm-font-sans: "Roboto", Arial, sans-serif;
  --tcm-ornament-flourish: url('/styles/sourcebooks/assets/tcm/tcm-title-flourish.webp');
  --tcm-ornament-rule-top: url('/styles/sourcebooks/assets/tcm/tcm-rule-top.webp');
  --tcm-ornament-rule-bottom: url('/styles/sourcebooks/assets/tcm/tcm-rule-bottom.webp');
  --tcm-ornament-table-top: url('/styles/sourcebooks/assets/tcm/tcm-table-top.webp');
  --tcm-ornament-table-bottom: url('/styles/sourcebooks/assets/tcm/tcm-table-bottom.webp');
  --tcm-ornament-salmon: url('/styles/sourcebooks/assets/tcm/tcm-toc-salmon.webp');
  --tcm-frame-image: url('/styles/sourcebooks/assets/tcm/tcm-frame-light.webp');
  --tcm-paper-image: url('/styles/sourcebooks/assets/tcm/tcm-paper-light.webp');
  --tcm-paper-color: #f1ece2;
  --tcm-ink-primary: #251e18;
  --tcm-ink-secondary: #4a3c30;
  --tcm-ink-muted: #6e5d4c;
  --tcm-heading-ink: #2a211a;
  --tcm-heading-accent: #52402f;
  --tcm-flourish-color: #846f57;
  --tcm-rule-color: #8e7a62;
  --tcm-divider-subtle: rgba(132, 111, 87, 0.38);
  --tcm-crimson: #8c2327;
  --tcm-callout-bg: rgba(235, 228, 215, 0.88);
  --tcm-callout-heading: #4e3b2b;
  --tcm-blockquote-bg: rgba(142, 122, 98, 0.10);
  --tcm-blockquote-border: #846f57;
  --tcm-table-row-odd: rgba(145, 128, 106, 0.16);
  --tcm-table-row-even: rgba(145, 128, 106, 0.03);
  --tcm-table-row-hover: rgba(140, 35, 39, 0.09);
  --tcm-table-divider: rgba(138, 120, 98, 0.40);
  --tcm-table-header-ink: #221b15;
  --tcm-statblock-bg: #ede7dc;
  --tcm-statblock-frame: #7e6b55;
  --tcm-statblock-header: #382c21;
  --tcm-statblock-sub: #5f4f3f;
  --tcm-statblock-rule: #96836c;
  --tcm-statblock-ab-border: #d5cbbd;
  --tcm-statblock-ab-h1: #e4ddd0;
  --tcm-statblock-ab-s1: #dad1c2;
  --tcm-statblock-ab-h2: #dfd8cb;
  --tcm-statblock-ab-s2: #d3cab9;
  --tcm-shadow: rgba(28, 20, 14, 0.16);
  --tcm-sidebar-bg: var(--tcm-paper-color);
  --tcm-sidebar-active-bg: var(--tcm-statblock-ab-s1);
  --tcm-sidebar-border: var(--tcm-divider-subtle);
  --tcm-sidebar-text: var(--tcm-ink-primary);
  --tcm-sidebar-muted: var(--tcm-ink-muted);
  --tcm-sidebar-active-accent: var(--tcm-crimson);
  --tcm-scrollbar-thumb: var(--tcm-rule-color);
}

.sourcebook-page.sourcebook--tcm {
  --rh-sourcebook-accent: var(--tcm-crimson);
  --rh-sourcebook-accent-muted: #d8c8ad;
  --rh-sourcebook-text: var(--tcm-ink-primary);
  --rh-sourcebook-text-muted: var(--tcm-ink-muted);
  --rh-sourcebook-heading-color: var(--tcm-heading-ink);
  --rh-sourcebook-heading-font: var(--tcm-font-display);
  --rh-sourcebook-heading-underline-color: var(--tcm-divider-subtle);
  --rh-sourcebook-heading-underline-image: none;
  --rh-sourcebook-chapter-title-color: var(--tcm-heading-ink);
  --rh-sourcebook-chapter-title-letter-spacing: 0.06em;
  --rh-sourcebook-chapter-title-underline-image: none;
  --rh-sourcebook-page-background-image: var(--tcm-paper-image);
  --rh-sourcebook-content-background-color: var(--tcm-paper-color);
  --rh-sourcebook-content-background-image: var(--tcm-paper-image);
  --rh-sourcebook-content-border-image: var(--tcm-frame-image) 100 / 36px / 0 round;
  --rh-sourcebook-content-border-width: 32px;
  --rh-sourcebook-surface-bg: var(--tcm-paper-color);
  --rh-sourcebook-table-header-bg: transparent;
  --rh-sourcebook-table-odd-bg: var(--tcm-table-row-odd);
  --rh-sourcebook-table-even-bg: var(--tcm-table-row-even);
  --rh-sourcebook-table-hover-bg: var(--tcm-table-row-hover);
  --rh-sourcebook-table-border: var(--tcm-table-divider);
  --rh-sourcebook-notable-bg: var(--tcm-callout-bg);
  --rh-sourcebook-notable-border: var(--tcm-crimson);
  --rh-sourcebook-narrative-bg: var(--tcm-callout-bg);
  --rh-sourcebook-narrative-border: var(--tcm-crimson);
  --rh-sourcebook-callout-heading-color: var(--tcm-callout-heading);
  --rh-sourcebook-callout-bg-image: none;
  --rh-sourcebook-callout-border: var(--tcm-crimson);
  --rh-sourcebook-branded-callout-border: var(--tcm-crimson);
  --rh-sourcebook-nav-header-bg: var(--tcm-sidebar-bg);
  --rh-sourcebook-nav-header-text: var(--tcm-sidebar-text);
  --rh-sourcebook-nav-active-bg: var(--tcm-sidebar-active-bg);
  --rh-sourcebook-nav-hover-bg: var(--tcm-blockquote-bg);
  --rh-sourcebook-nav-border: var(--tcm-sidebar-border);
  --rh-sourcebook-nav-depth-0-bg: var(--tcm-sidebar-bg);
  --rh-sourcebook-nav-depth-1-bg: var(--tcm-paper-color);
  --rh-sourcebook-nav-depth-2-bg: var(--tcm-statblock-bg);
  --rh-sourcebook-nav-depth-3-bg: var(--tcm-statblock-ab-h1);
  --rh-sourcebook-toc-header-bg: transparent;
  --rh-sourcebook-toc-header-text: var(--tcm-heading-ink);
  --rh-sourcebook-toc-column-count: 3;
  --rh-sourcebook-toc-column-width: 23ch;
  --rh-sourcebook-toc-column-gap: 2.1rem;
}

/* The book keeps its light paper palette in either site theme, like other readers.
   Sidebar tokens are local so the portalled mobile contents uses the same ink. */

.sourcebook--tcm :is(.sourcebook-reader-nav, .sourcebook-reader-rail),
.sourcebook--tcm.sourcebook-nav-sheet {
  --rh-sourcebook-text: var(--tcm-sidebar-text);
  --rh-sourcebook-text-muted: var(--tcm-sidebar-muted);
  --rh-sourcebook-accent: var(--tcm-sidebar-active-accent);
}

.sourcebook--tcm .content-embed-player-map-button {
  --rh-sourcebook-accent: var(--tcm-heading-accent);
}

.sourcebook--tcm .sourcebook-reader-nav-list {
  scrollbar-color: var(--tcm-scrollbar-thumb) transparent;
}

.sourcebook--tcm .sourcebook-reader-nav-row {
  border-block-end: 0;
  border-block-start: 1px solid var(--tcm-divider-subtle);
  font-family: var(--tcm-font-body);
  font-size: 0.85rem;
  font-weight: 400;
}

/* Draw ordinary dividers on the following row so an expanded chapter's
   last visible descendant also meets the group ornament without a border. */
.sourcebook--tcm .sourcebook-reader-nav-list > ul > li:first-child > .sourcebook-reader-nav-row,
.sourcebook--tcm .sourcebook-toc-group + .sourcebook-reader-nav-row {
  border-block-start: 0;
}

.sourcebook--tcm .sourcebook-reader-nav-row[data-active='true'] {
  background: var(--tcm-sidebar-active-bg);
  color: var(--tcm-sidebar-text);
  font-weight: 600;
}

.sourcebook--tcm .sourcebook-reader-nav-row:is(:hover, :focus-within) {
  background: var(--rh-sourcebook-nav-hover-bg);
}

.sourcebook--tcm .sourcebook-reader-nav-depth-2 .sourcebook-reader-nav-link,
.sourcebook--tcm .sourcebook-reader-nav-depth-3-plus .sourcebook-reader-nav-link {
  font-size: 0.79rem;
}

.sourcebook--tcm .sourcebook-reader-rail {
  font-family: var(--tcm-font-display);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Give the contents canvas its own landscape art through the shared cover token. */
.sourcebook--tcm.sourcebook-toc-page::before {
  --rh-sourcebook-cover-image: url('/styles/sourcebooks/assets/tcm/a-dreadful-folktale.webp');
  background-repeat: no-repeat;
  background-size: auto, auto, auto, cover;
}

.sourcebook--tcm .sourcebook-toc-panel {
  border: 34px solid transparent;
  border-image: var(--tcm-frame-image) 100 / 38px / 0 round;
  border-radius: 0;
  background-size: 512px auto;
}

.sourcebook--tcm :is(.sourcebook-toc-header, .sourcebook-reader-header) {
  display: block;
  text-align: center;
  margin-block: 0.1rem 1.15rem;
}

.sourcebook--tcm .sourcebook-toc-header > div {
  justify-content: center;
}

.sourcebook--tcm .sourcebook-toc-header {
  padding: 0.65rem 1.35rem 0;
}

.sourcebook--tcm .sourcebook-toc-header .fa-book-open {
  display: none;
}

.sourcebook--tcm :is(.sourcebook-toc-header, .sourcebook-reader-header)::before,
.sourcebook--tcm :is(.sourcebook-toc-header, .sourcebook-reader-header)::after {
  content: '';
  display: block;
  width: min(370px, 76%);
  height: 17px;
  margin-inline: auto;
  background-color: var(--tcm-flourish-color);
  -webkit-mask: var(--tcm-ornament-flourish) center / contain no-repeat;
  mask: var(--tcm-ornament-flourish) center / contain no-repeat;
  pointer-events: none;
}

.sourcebook--tcm :is(.sourcebook-toc-header, .sourcebook-reader-header)::after {
  transform: scaleY(-1);
}

.sourcebook--tcm :is(.sourcebook-toc-header, .sourcebook-reader-header) h1 {
  margin-block: 0.45rem;
  padding: 0;
  border: 0;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.sourcebook--tcm .sourcebook-toc-header h1 {
  margin: 0;
  padding-block: 0.2rem 0.25rem;
  padding-inline-start: 0.24em;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  line-height: 1.15;
}

.sourcebook--tcm .sourcebook-toc-header::before,
.sourcebook--tcm .sourcebook-toc-header::after {
  width: min(410px, 78%);
  height: 22px;
}

.sourcebook--tcm .sourcebook-reader-header {
  container-type: inline-size;
  margin-inline: 0.85rem;
}

.sourcebook--tcm .sourcebook-reader-header h1 {
  margin: 0;
  padding-block: 0.18rem;
  padding-inline-start: 0.08em;
  font-size: clamp(1.05rem, 3.5cqi, 1.58rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.sourcebook--tcm .sourcebook-toc-columns {
  padding: 0 1.35rem 0.9rem;
  column-rule: 1px solid var(--tcm-divider-subtle);
  font-family: var(--tcm-font-body);
  background: transparent;
}

.sourcebook--tcm .sourcebook-toc-entry {
  margin-block-end: 0.42rem;
}

.sourcebook--tcm .sourcebook-toc-entry-child {
  margin-block: 0.06rem;
}

.sourcebook--tcm .sourcebook-toc-link {
  padding: 0;
  border-inline-start: 2px solid transparent;
  padding-inline-start: 0.38rem;
  border-radius: 0;
  color: var(--tcm-ink-secondary);
  font-size: 0.84rem;
  line-height: 1.32;
}

.sourcebook--tcm .sourcebook-toc-link:is(:hover, :focus-visible) {
  color: var(--rh-sourcebook-accent);
  border-inline-start-color: var(--tcm-crimson);
  text-decoration: none;
}

.sourcebook--tcm .sourcebook-toc-link-chapter {
  margin: 0.32rem 0 0.16rem;
  padding: 0 0 0.1rem;
  border-inline-start: 0;
  font-family: var(--tcm-font-display);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.22;
  color: var(--tcm-heading-ink);
  border-bottom: 1px solid var(--tcm-divider-subtle);
}

.sourcebook--tcm .sourcebook-toc-columns > .sourcebook-toc-entry + .sourcebook-toc-entry > .sourcebook-toc-link-chapter {
  margin-block-start: 0.32rem;
}

.sourcebook--tcm .sourcebook-toc-children {
  margin: 0 0 0.28rem;
}

.sourcebook--tcm .sourcebook-toc-group {
  margin-block: 0.75rem 0.55rem;
  padding-inline-start: 0.1em;
  color: var(--tcm-heading-ink);
  font-family: var(--tcm-font-display);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
  break-inside: avoid-column;
  break-after: avoid-column;
}

.sourcebook--tcm .sourcebook-toc-group::before,
.sourcebook--tcm .sourcebook-toc-group::after {
  content: '';
  display: block;
  width: 100%;
  height: 10px;
  background-color: var(--tcm-rule-color);
  pointer-events: none;
}

.sourcebook--tcm .sourcebook-toc-group::before {
  margin-block-end: 0.22rem;
  -webkit-mask: var(--tcm-ornament-rule-top) center / 100% 100% no-repeat;
  mask: var(--tcm-ornament-rule-top) center / 100% 100% no-repeat;
}

.sourcebook--tcm .sourcebook-toc-group::after {
  margin-block-start: 0.2rem;
  -webkit-mask: var(--tcm-ornament-rule-bottom) center / 100% 100% no-repeat;
  mask: var(--tcm-ornament-rule-bottom) center / 100% 100% no-repeat;
}

.sourcebook--tcm .sourcebook-reader-nav-list .sourcebook-toc-group {
  margin-block: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
}

.sourcebook--tcm .sourcebook-reader-nav-list .sourcebook-toc-group::before,
.sourcebook--tcm .sourcebook-reader-nav-list .sourcebook-toc-group::after {
  height: 6px;
  margin-block: 0;
}

.sourcebook--tcm .sourcebook-toc-columns::after {
  content: '';
  display: block;
  width: 138px;
  height: 202px;
  margin: 0.85rem auto 0.15rem;
  background: var(--tcm-ornament-salmon) center / contain no-repeat;
  break-inside: avoid-column;
  opacity: 0.92;
  filter: sepia(0.08) contrast(1.02);
  pointer-events: none;
}

.sourcebook--tcm .sourcebook-reader-main {
  padding: 0.35rem 0.65rem;
  background-size: 512px auto;
}

.sourcebook--tcm .sourcebook-reader-content {
  font-family: var(--tcm-font-body);
  font-size: 0.94rem;
  line-height: 1.58;
}

.sourcebook--tcm .sourcebook-reader-content :is(h1, .sourcebook-content-block-title--level-1) {
  display: block;
  text-align: start;
  font-family: var(--tcm-font-display);
  font-size: 1.55rem;
  line-height: inherit;
  font-weight: 700;
  margin-block: 0.5rem 0.7rem;
  padding-block-end: 0.28rem;
  border: 0;
  color: var(--tcm-heading-ink);
  border-bottom: 2px solid var(--tcm-divider-subtle);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.sourcebook--tcm .sourcebook-reader-content :is(h2:not(.sourcebook-content-block-title--level-1), .sourcebook-content-block-title--level-2):not(:is(.notable, .advice, .quest, .narrative, .statblock) *) {
  clear: both;
  display: block;
  text-align: center;
  font-family: var(--tcm-font-display);
  font-size: 1.24rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding-inline-start: 0.08em;
  text-transform: uppercase;
  color: var(--tcm-heading-ink);
  border: none;
  margin-block: 1.35rem 0.75rem;
  line-height: 1.25;
}

.sourcebook--tcm .sourcebook-reader-content :is(h2:not(.sourcebook-content-block-title--level-1), .sourcebook-content-block-title--level-2):not(:is(.notable, .advice, .quest, .narrative, .statblock) *)::before,
.sourcebook--tcm .sourcebook-reader-content :is(h2:not(.sourcebook-content-block-title--level-1), .sourcebook-content-block-title--level-2):not(:is(.notable, .advice, .quest, .narrative, .statblock) *)::after {
  content: "";
  display: block;
  width: 100%;
  height: 11px;
  background-color: var(--tcm-rule-color);
  pointer-events: none;
}

.sourcebook--tcm .sourcebook-reader-content :is(h2:not(.sourcebook-content-block-title--level-1), .sourcebook-content-block-title--level-2):not(:is(.notable, .advice, .quest, .narrative, .statblock) *)::before {
  margin-bottom: 0.25rem;
  -webkit-mask: var(--tcm-ornament-rule-top) center / 100% 100% no-repeat;
  mask: var(--tcm-ornament-rule-top) center / 100% 100% no-repeat;
}

.sourcebook--tcm .sourcebook-reader-content :is(h2:not(.sourcebook-content-block-title--level-1), .sourcebook-content-block-title--level-2):not(:is(.notable, .advice, .quest, .narrative, .statblock) *)::after {
  margin-top: 0.22rem;
  -webkit-mask: var(--tcm-ornament-rule-bottom) center / 100% 100% no-repeat;
  mask: var(--tcm-ornament-rule-bottom) center / 100% 100% no-repeat;
}

.sourcebook--tcm .sourcebook-reader-content :is(h3:not(.sourcebook-content-block-title--level-2), .sourcebook-content-block-title--level-3):not(:is(.notable, .advice, .quest, .narrative, .statblock) *) {
  font-family: var(--tcm-font-display);
  font-size: 1.12rem;
  line-height: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tcm-heading-accent);
  border: none;
  border-bottom: 1px solid var(--tcm-divider-subtle);
  padding-bottom: 0.15rem;
  margin-block: 1.05rem 0.45rem;
}

.sourcebook--tcm .sourcebook-reader-content h4:not(:is(.notable, .advice, .quest, .narrative, .statblock, .roll-table-embed) *) {
  font-family: var(--tcm-font-display);
  font-size: 1.02rem;
  line-height: inherit;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tcm-heading-accent);
  border: none;
  margin-block: 0.9rem 0.28rem;
}

.sourcebook--tcm .sourcebook-reader-content h4:not(:is(.notable, .advice, .quest, .narrative, .statblock, .roll-table-embed) *).item {
  clear: both;
  font-size: 1.08rem;
  border-bottom: 1px solid var(--tcm-divider-subtle);
  padding-bottom: 0.14rem;
  margin-block: 1rem 0.4rem;
}

.sourcebook--tcm .sourcebook-reader-content h5:not(:is(.notable, .advice, .quest, .narrative, .statblock) *) {
  display: table;
  font-family: var(--tcm-font-antique);
  font-size: 1.06rem;
  font-style: italic;
  line-height: inherit;
  font-weight: 500;
  font-variant: normal;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--tcm-heading-ink);
  border: none;
  border-bottom: 1px solid var(--tcm-rule-color);
  padding-inline-end: 1.35rem;
  padding-bottom: 0.1rem;
  margin-block: 0.95rem 0.25rem;
}

.sourcebook--tcm .sourcebook-reader-content p {
  margin-block: 0 0.65rem;
}

.sourcebook--tcm .sourcebook-reader-content p:has(+ p > .inline-h4:first-child) {
  margin-block-end: 0;
}

.sourcebook--tcm .sourcebook-reader-content :is(h1, h2, h3, h4, h5, h6) {
  & + p,
  & + figure.content-embed--image + p,
  & + figure.content-embed--image + figure.content-embed--image + p,
  & + figure.content-embed--image + figure.content-embed--image + figure.content-embed--image + p,
  & + .sourcebook-content-html > p:nth-child(1 of :not(figure.content-embed--image)) {
    text-indent: 0;

    & > :is(.inline-h4, .inline-entry):first-child {
      padding-inline-start: 0;
    }
  }
}

.sourcebook--tcm .sourcebook-reader-content ul,
.sourcebook--tcm .sourcebook-reader-content ol {
  margin-block: 0.25rem 0.75rem;
}

.sourcebook--tcm .sourcebook-reader-content ul.columns-two,
.sourcebook--tcm .sourcebook-reader-content ol.columns-two {
  columns: 2;
  column-gap: 1.75rem;
}

.sourcebook--tcm .sourcebook-reader-content ul li,
.sourcebook--tcm .sourcebook-reader-content ol li {
  margin-block: 0.2rem;
}

.sourcebook--tcm .sourcebook-reader-content ul li p,
.sourcebook--tcm .sourcebook-reader-content ol li p {
  margin-block-end: 0.25rem;
}

.sourcebook--tcm .sourcebook-reader-content hr {
  border: none;
  height: 12px;
  width: min(360px, 72%);
  margin: 1.25rem auto;
  background-color: var(--tcm-rule-color);
  opacity: 0.85;
  -webkit-mask: var(--tcm-ornament-rule-bottom) center / contain no-repeat;
  mask: var(--tcm-ornament-rule-bottom) center / contain no-repeat;
  clear: both;
}

.sourcebook--tcm .sourcebook-reader-content img {
  border: none;
  box-shadow: none;
}

.sourcebook--tcm .sourcebook-reader-content figure {
  margin: 0.75rem auto 1rem;
}

.sourcebook--tcm .sourcebook-reader-content figure.center {
  text-align: center;
}

.sourcebook--tcm .sourcebook-reader-content figure img {
  border-radius: 2px;
}

.sourcebook--tcm .sourcebook-reader-content figure figcaption {
  font-family: var(--tcm-font-antique);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--tcm-ink-muted);
  margin-top: 0.35rem;
}

.sourcebook--tcm .sourcebook-reader-content .sourcebook-content-block--image figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.5rem auto 1rem;
}

.sourcebook--tcm .sourcebook-reader-content .sourcebook-content-block--image figure img {
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.sourcebook--tcm .sourcebook-reader-content .sourcebook-content-block--image figure figcaption {
  text-align: center;
  margin-top: 0.45rem;
}

.sourcebook--tcm .sourcebook-reader-content .content-embed {
  margin: 0.65rem auto 0.95rem;
}

.sourcebook--tcm .sourcebook-reader-content .content-embed img:not(.dice-roll-icon) {
  border: none;
  box-shadow: none;
  max-width: 100%;
  height: auto;
  display: block;
  margin-inline: auto;
}

.sourcebook--tcm .sourcebook-reader-content .content-embed figcaption {
  order: 1;
  text-align: center;
  font-family: var(--tcm-font-antique);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--tcm-ink-muted);
  margin-top: 0.32rem;
}

.sourcebook--tcm .sourcebook-reader-content .content-embed figcaption .embed-caption {
  font-style: italic;
  font-weight: 500;
  color: var(--tcm-ink-secondary);
}

.sourcebook--tcm .sourcebook-reader-content .content-embed figcaption:has(+ table.roll-table-embed) {
  order: 0;
  align-self: flex-start;
  width: fit-content;
  text-align: start;
  font-family: var(--tcm-font-antique);
  font-style: italic;
  font-size: 1.06rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--tcm-heading-ink);
  border-bottom: 1px solid var(--tcm-rule-color);
  padding-inline-end: 1.35rem;
  padding-bottom: 0.1rem;
  margin: 0.55rem 0 0.2rem;
}

.sourcebook--tcm .sourcebook-reader-content .content-embed figcaption:has(+ table.roll-table-embed) .embed-caption {
  font-weight: 500;
  color: var(--tcm-heading-ink);
}

.sourcebook--tcm .sourcebook-reader-content .content-embed figcaption:not(:has(.embed-caption)):has(cite) {
  order: 1;
  align-self: stretch;
  text-align: end;
  font-style: normal;
  margin-top: 0.25rem;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed):is(.tcm-art-banner, .tcm-art-map) {
  display: block;
  width: 100%;
  margin: 0.55rem auto 0.95rem;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed):is(.tcm-art-banner, .tcm-art-map) .content-embed {
  margin: 0;
  width: 100%;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed):is(.tcm-art-banner, .tcm-art-map) img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-art-map img {
  max-height: 540px;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-art-spot {
  display: block;
  width: 100%;
  margin: 0.6rem auto 0.95rem;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-art-spot .content-embed {
  margin: 0;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-art-spot img {
  width: auto;
  max-width: 100%;
  max-height: 390px;
  object-fit: contain;
  margin-inline: auto;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-bargain-banner {
  display: block;
  max-width: min(440px, 86%);
  margin: 0.25rem auto 0.7rem;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-bargain-banner .content-embed {
  margin: 0;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-bargain-banner img {
  width: 100%;
  max-height: 145px;
  object-fit: contain;
}

.sourcebook--tcm .sourcebook-reader-content document-embed.float-right,
.sourcebook--tcm .sourcebook-reader-content .content-embed.float-right {
  --dnd5e-block-float-max: 42%;
  float: right;
  clear: right;
  margin: 0.15rem 0 0.75rem 1.15rem;
}

.sourcebook--tcm .sourcebook-reader-content document-embed.float-right > .content-embed,
.sourcebook--tcm .sourcebook-reader-content .content-embed.float-right > .content-embed {
  margin: 0;
  width: 100%;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed):is(.tcm-portrait-art, .tcm-spell-art, .tcm-cover-art) {
  width: min(245px, 40%);
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed):is(.tcm-portrait-art, .tcm-spell-art, .tcm-cover-art) img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-bg-art {
  display: block;
  width: 100%;
  margin: 0.35rem auto 0.9rem;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-bg-art .content-embed {
  margin: 0;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-bg-art img {
  width: auto;
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin-inline: auto;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed):is(.tcm-monster-art, .tcm-item-art) {
  width: min(195px, 33%);
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed):is(.tcm-monster-art, .tcm-item-art) img {
  width: 100%;
  max-height: 245px;
  object-fit: contain;
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-feat-art {
  width: min(140px, 25%);
}

.sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).tcm-feat-art img {
  width: 100%;
  max-height: 165px;
  object-fit: contain;
}

.sourcebook--tcm .sourcebook-reader-content blockquote {
  margin: 0.45rem 0 0.85rem;
  padding: 0.45rem 0.95rem;
  background: var(--tcm-blockquote-bg);
  border: none;
  border-inline-start: 3px solid var(--tcm-blockquote-border);
  font-family: var(--tcm-font-antique);
  font-style: italic;
  font-size: 0.96rem;
  line-height: 1.45;
  color: var(--tcm-ink-secondary);
}

.sourcebook--tcm .sourcebook-reader-content blockquote p:last-child {
  margin-bottom: 0;
}

.sourcebook--tcm .sourcebook-reader-content h3 + blockquote,
.sourcebook--tcm .sourcebook-reader-content h3 + p:has(> em:only-child) + blockquote,
.sourcebook--tcm .sourcebook-reader-content .sourcebook-content-block > .rich-content > blockquote:first-child {
  background: transparent;
  border-inline-start: none;
  border-bottom: 1px solid var(--tcm-divider-subtle);
  padding: 0 0 0.3rem 0;
  margin-top: -0.2rem;
  margin-bottom: 0.6rem;
}

.sourcebook--tcm .sourcebook-reader-content :is(.notable, .advice, .quest, .narrative) {
  clear: both;
  position: relative;
  background: var(--tcm-callout-bg);
  border: 2px solid var(--tcm-crimson);
  outline: 1px solid var(--tcm-crimson);
  outline-offset: -6px;
  border-radius: 0;
  margin: 1.2rem 0.35rem;
  padding: 1.2rem 1.4rem;
  filter: none;
  box-shadow: 0 3px 10px var(--tcm-shadow);
  color: var(--tcm-ink-primary);
  text-align: start;
  font-size: inherit;
  line-height: inherit;
}

.sourcebook--tcm .sourcebook-reader-content :is(.notable, .advice, .quest, .narrative) p {
  line-height: inherit;
  text-align: start;
}

.sourcebook--tcm .sourcebook-reader-content :is(.notable, .advice, .quest, .narrative)::before,
.sourcebook--tcm .sourcebook-reader-content :is(.notable, .advice, .quest, .narrative)::after,
.sourcebook--tcm .sourcebook-reader-content :is(.notable, .advice, .quest, .narrative) > :last-child::before,
.sourcebook--tcm .sourcebook-reader-content :is(.notable, .advice, .quest, .narrative) > :last-child::after {
  content: none !important;
  display: none !important;
}

.sourcebook--tcm .sourcebook-reader-content :is(.notable, .advice, .quest, .narrative) :is(h1, h2, h3, h4, h5) {
  font-family: var(--tcm-font-display);
  font-variant: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.05rem;
  line-height: inherit;
  font-weight: 700;
  color: var(--tcm-callout-heading);
  border: none;
  margin-block: 0 0.45rem;
  padding: 0;
}

.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) {
  --font-body: var(--tcm-font-sans);
  width: 100%;
  font-family: var(--tcm-font-sans);
  font-size: 0.87rem;
  line-height: 1.4;
  color: var(--tcm-ink-primary);
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  margin: 0.35rem 0 1.15rem;
  padding-bottom: 13px;
  background: var(--tcm-ornament-table-bottom) bottom center / 100% 11px no-repeat;
}

/* Labelled embeds render their table title as a header before the table. */
.sourcebook--tcm .sourcebook-reader-content .content-embed > header,
.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) caption {
  text-align: start;
  font-family: var(--tcm-font-antique);
  font-size: 1.06rem;
  font-style: italic;
  font-weight: 500;
  font-variant: normal;
  color: var(--tcm-heading-ink);
  border-bottom: 1px solid var(--tcm-rule-color);
  padding-bottom: 0.12rem;
  margin-bottom: 0.25rem;
}

.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) thead {
  background: var(--tcm-ornament-table-top) bottom center / 100% 11px no-repeat;
  color: var(--tcm-table-header-ink);
  font-family: var(--tcm-font-sans);
  font-weight: 700;
  border: none;
}

.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) thead tr {
  background: transparent;
}

.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) thead th,
.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) thead td {
  text-align: start;
  padding: 0.35rem 0.6rem 13px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tcm-table-header-ink);
  border: none;
  line-height: inherit;
}

.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) tbody tr:nth-child(odd) {
  background-color: var(--tcm-table-row-odd);
}

.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) tbody tr:nth-child(even) {
  background-color: var(--tcm-table-row-even);
}

.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) tbody tr:hover {
  background-color: var(--tcm-table-row-hover);
}

.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) tbody td,
.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) tbody th {
  padding: 0.42rem 0.6rem;
  border: none;
  border-bottom: 1px solid var(--tcm-table-divider);
  vertical-align: top;
  text-align: start;
  line-height: inherit;
}

.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) tbody tr:last-child td,
.sourcebook--tcm .sourcebook-reader-content table:not(.statblock table) tbody tr:last-child th {
  border-bottom: none;
}

.sourcebook--tcm .sourcebook-reader-content :is(table.roll-table-embed, .roll-table-embed table):not(.statblock table) thead th:first-child,
.sourcebook--tcm .sourcebook-reader-content :is(table.roll-table-embed, .roll-table-embed table):not(.statblock table) tbody td:first-child {
  text-align: center;
  white-space: nowrap;
  width: 4.5rem;
  font-weight: 700;
}

.sourcebook--tcm .sourcebook-reader-content :is(table.roll-table-embed, .roll-table-embed table):not(.statblock table) thead th > h4.roll-table-embed-title {
  font-family: var(--tcm-font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--tcm-table-header-ink);
  border: none;
  margin: 0;
}

.sourcebook--tcm .sourcebook-reader-content :is(table.roll-table-embed, .roll-table-embed table):not(.statblock table) td > h4 {
  display: inline;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  font-weight: 700;
  border: none;
  margin: 0;
}

.sourcebook--tcm .sourcebook-reader-content :is(table.roll-table-embed, .roll-table-embed table):not(.statblock table) td > h4::after {
  content: ". ";
}

.sourcebook--tcm .sourcebook-reader-content :is(table.roll-table-embed, .roll-table-embed table):not(.statblock table) td > h4 + p {
  display: inline;
}

.sourcebook--tcm .sourcebook-reader-content .statblock {
  clear: both;
  --font-body: var(--tcm-font-sans);
  --dnd5e-statblock-background-plain: var(--tcm-statblock-bg);
  --dnd5e-statblock-border: var(--tcm-statblock-frame);
  --dnd5e-statblock-text-header: var(--tcm-statblock-header);
  --dnd5e-statblock-text-primary: var(--tcm-ink-primary);
  --dnd5e-statblock-text-secondary: var(--tcm-statblock-sub);
  --dnd5e-statblock-title-border: var(--tcm-statblock-rule);
  --dnd5e-statblock-ability-border: var(--tcm-statblock-ab-border);
  --dnd5e-statblock-ability-header-1st: var(--tcm-statblock-ab-h1);
  --dnd5e-statblock-ability-stat-1st: var(--tcm-statblock-ab-s1);
  --dnd5e-statblock-ability-header-2nd: var(--tcm-statblock-ab-h2);
  --dnd5e-statblock-ability-stat-2nd: var(--tcm-statblock-ab-s2);
  background: var(--tcm-statblock-bg);
  border: 2px solid var(--tcm-statblock-frame);
  outline: 1px solid var(--tcm-statblock-frame);
  outline-offset: -5px;
  border-radius: 0;
  padding: 0.7rem 0.95rem 0.75rem;
  box-shadow: 0 3px 10px var(--tcm-shadow);
  font-family: var(--tcm-font-sans);
  color: var(--tcm-ink-primary);
}

.sourcebook--tcm .sourcebook-reader-content .statblock .statblock-title {
  font-family: var(--tcm-font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--tcm-statblock-header);
  border-block-end: 1px solid var(--tcm-statblock-rule);
}

.sourcebook--tcm .sourcebook-reader-content .statblock .statblock-tags {
  font-family: var(--tcm-font-antique);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--tcm-statblock-sub);
}

.sourcebook--tcm .sourcebook-reader-content .statblock .statblock-actions-title {
  font-family: var(--tcm-font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--tcm-statblock-header);
  border-block-end: 1px solid var(--tcm-statblock-rule);
}

/* Foundry page title levels map to h2/h3/h4 in the website's document outline. */
.sourcebook--tcm .sourcebook-content-block-title--level-1::before,
.sourcebook--tcm .sourcebook-content-block-title--level-1::after {
  content: none !important;
  display: none !important;
}

.sourcebook--tcm :is(.sourcebook-content-block-title--level-3, .sourcebook-content-block-title--level-4) {
  --rh-sourcebook-heading-color: var(--tcm-heading-accent);
}

/* Keep the framed page usable on phones and stack floated illustrations. */

@media (max-width: 639px) {
  .sourcebook-page.sourcebook--tcm {
    --rh-sourcebook-content-border-width: 14px;
    --rh-sourcebook-content-border-image: var(--tcm-frame-image) 100 / 16px / 0 round;
  }

  .sourcebook--tcm .sourcebook-toc-panel {
    border-width: 14px;
    border-image-width: 16px;
  }

  .sourcebook--tcm .sourcebook-toc-header { padding-inline: 0.35rem; }

  .sourcebook--tcm .sourcebook-toc-header h1 {
    font-size: clamp(1.1rem, 6vw, 1.85rem);
    letter-spacing: 0.12em;
    padding-inline-start: 0.12em;
  }

  .sourcebook--tcm .sourcebook-reader-main { padding-inline: 0.25rem; }

  .sourcebook--tcm .sourcebook-reader-content :is(document-embed, .content-embed).float-right {
    float: none;
    width: 100%;
    margin-inline: auto;
  }

  .sourcebook--tcm .sourcebook-reader-content :is(ul, ol).columns-two { columns: 1; }

  .sourcebook--tcm .sourcebook-reader-content :is(.notable, .advice, .quest, .narrative) {
    margin-inline: 0;
    padding-inline: 0.8rem;
  }
}
