@font-face {
  font-family: "Rei Notebook Hand";
  src: url("assets/fonts/rei-notebook-hand.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Rei Gothic Title";
  src: url("assets/fonts/rei-gothic-title.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --ink: #493a43;
  --ink-soft: #705a67;
  --muted: #9b7f8e;
  --black: #2f252b;
  --black-soft: #463740;
  --rose: #d894b1;
  --rose-dark: #aa6f88;
  --pink: #efd0dd;
  --pink-pale: #f8e9ef;
  --paper: #fffaf7;
  --paper-cool: #fff8fb;
  --line: #c7a5b5;
  --book-w: 980px;
  --book-h: 640px;
  --page-w: 490px;
  --page-h: 640px;
  --pixel: "MS Gothic", "MS PGothic", Fixedsys, "Courier New", monospace;
  --serif: "Noto Serif TC", "Source Han Serif TC", "Yu Mincho", "MS Mincho", Georgia, serif;
  --gothic: "Old English Text MT", "Lucida Blackletter", "Times New Roman", serif;
  --notebook-hand: "Rei Notebook Hand", "Yu Kyokasho", "Kaiti TC", "KaiTi", "STKaiti", "Yu Mincho", "Noto Serif CJK JP", serif;
  --gothic-title: "Rei Gothic Title", "Yu Mincho Demibold", "Noto Serif CJK JP", "Noto Serif CJK SC", "Songti SC", var(--serif);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f5ecef;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font: 12px/1.58 var(--pixel);
  cursor: url("assets/journal/03_cursors_small_icons/cursor_bow.png") 1 1, auto;
  background-color: #f6edf0;
  background-image:
    linear-gradient(rgba(255, 250, 251, .82), rgba(255, 250, 251, .82)),
    url("assets/materials/black/pattern_tile_01_01.svg"),
    url("assets/materials/black/pattern_tile_04_01.svg");
  background-repeat: repeat, repeat, repeat;
  background-size: auto, 146px 145px, 238px 169px;
  background-position: 0 0, 0 0, 73px 62px;
  background-attachment: fixed;
}

.book,
.mobile-page {
  font-family: var(--notebook-hand);
}

.site-title-wrap h1,
.book h1,
.book h2,
.mobile-page h1,
.mobile-page h2,
.cover-copy strong {
  font-family: var(--gothic-title);
  font-weight: 700;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  opacity: .16;
  background-image:
    linear-gradient(90deg, #2e242a 0 28px, transparent 28px calc(100% - 28px), #2e242a calc(100% - 28px)),
    repeating-linear-gradient(135deg, transparent 0 74px, rgba(45, 34, 41, .45) 74px 82px, transparent 82px 156px),
    url("assets/materials/black/pattern_tile_02_01.svg");
  background-repeat: no-repeat, repeat, repeat;
  background-size: auto, 220px 220px, 290px 269px;
  background-position: 0 0, 0 0, 132px 108px;
}

body::after {
  inset: 8px;
  border-right: 3px double rgba(47, 36, 43, .48);
  border-left: 3px double rgba(47, 36, 43, .48);
  box-shadow: inset 14px 0 rgba(255, 255, 255, .35), inset -14px 0 rgba(255, 255, 255, .35);
}

button,
a {
  cursor: url("assets/journal/03_cursors_small_icons/cursor_bow.png") 1 1, pointer;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: var(--ink);
}

img {
  max-width: 100%;
}

a {
  color: #755568;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

/* Continuous desktop ceiling: each band uses the source image at its natural
   aspect ratio and repeats horizontally without a stretched final segment. */
.ceiling {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  height: 99px;
  overflow: hidden;
  pointer-events: none;
  border-top: 3px solid var(--black);
  border-bottom: 0;
  background: linear-gradient(#fffafc 0 18px, #f2dce5 18px 34px, rgba(255, 248, 251, .96) 34px 74px, rgba(255, 248, 251, .28) 74px, transparent 100%);
  box-shadow: none;
}

.ceiling-lace-band,
.ceiling-chain-band {
  position: absolute;
  right: 0;
  left: 0;
  display: block;
  background-position: left top;
  background-repeat: repeat-x;
}

.ceiling-lace-band {
  top: 0;
  height: 70px;
  background-image: url("assets/materials/black/border_004.svg");
  background-size: auto 64px;
}

.ceiling-chain-band {
  top: 51px;
  height: 48px;
  opacity: .86;
  background-image: url("assets/journal/01_banners/garland_cross_moon_chain.png");
  background-size: auto 42px;
}

.ceiling-rose {
  position: absolute;
  top: 20px;
  z-index: 2;
  width: 82px;
  height: 68px;
  object-fit: contain;
  opacity: .9;
  filter: drop-shadow(1px 2px #fff);
}

.ceiling-rose-left {
  left: 1.2%;
  transform: rotate(-7deg);
}

.ceiling-rose-right {
  right: 1.2%;
  transform: scaleX(-1) rotate(-7deg);
}

.site-shell {
  position: relative;
  z-index: 2;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 112px 18px 34px;
}

.site-header {
  display: grid;
  grid-template-columns: 76px 1fr 76px;
  align-items: center;
  width: min(880px, 94vw);
  min-height: 80px;
  margin: 0 auto 5px;
  border-top: 1px solid rgba(76, 56, 67, .5);
  border-bottom: 1px dotted var(--line);
  background: rgba(255, 250, 249, .84);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .5);
}

.header-ornament {
  display: grid;
  place-items: center;
}

.header-ornament img {
  max-width: 48px;
  max-height: 56px;
  object-fit: contain;
  opacity: .76;
}

.header-ornament.left img {
  transform: rotate(-8deg);
}

.site-title-wrap {
  padding: 6px 12px;
  text-align: center;
}

.eyebrow,
.jp-title,
.motto {
  margin: 0;
}

.eyebrow {
  margin-bottom: 4px;
  color: #967c8a;
  font-size: 7px;
  letter-spacing: .18em;
}

.site-title-wrap h1 {
  margin: 0;
  color: #54414c;
  font: 700 29px/1 var(--gothic);
  letter-spacing: .025em;
  text-shadow: 1px 1px #f3ccdc;
}

.jp-title {
  margin-top: 5px;
  color: #78616f;
  font: 600 11px var(--serif);
  letter-spacing: .13em;
}

.motto {
  margin-top: 1px;
  color: #ac728c;
  font: italic 8px var(--serif);
  letter-spacing: .16em;
}

.web-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(830px, 92vw);
  height: 26px;
  margin: 6px auto 12px;
  overflow: hidden;
  border-top: 1px dotted #b995a7;
  border-bottom: 1px dotted #b995a7;
  background: rgba(255, 248, 250, .86);
}

.web-strip > img {
  flex: 0 0 auto;
  width: 54px;
  height: 20px;
  object-fit: contain;
}

.web-strip > img:last-child {
  width: 20px;
}

.web-strip marquee {
  color: #856477;
  font-size: 8px;
}

/* Physical reader frame */
.reader-frame {
  position: relative;
  width: min(1130px, calc(100vw - 44px));
  min-height: 0;
  margin: 0 auto;
  padding: 26px 54px 17px;
  overflow: visible;
  border: 2px solid #493740;
  outline: 4px double rgba(222, 173, 194, .8);
  background-color: rgba(255, 250, 248, .72);
  background-image:
    linear-gradient(rgba(255, 252, 250, .88), rgba(255, 248, 250, .88)),
    url("assets/materials/black/pattern_tile_03_01.svg");
  background-repeat: repeat;
  background-size: auto, 170px 170px;
  box-shadow: 0 9px 25px rgba(69, 49, 60, .15), inset 0 0 0 2px #fff;
  transition: width .38s ease, padding .38s ease;
}

.reader-frame::before,
.reader-frame::after {
  content: "";
  position: absolute;
  right: 24px;
  left: 24px;
  height: 16px;
  pointer-events: none;
  opacity: .45;
  background: url("assets/journal/05_lace_dividers/lace_pale_01.png") center / auto 15px repeat-x;
}

.reader-frame::before {
  top: 4px;
}

.reader-frame::after {
  bottom: 4px;
  transform: rotate(180deg);
}

.reader-frame.book-closed {
  width: min(760px, calc(100vw - 44px));
  padding-right: 44px;
  padding-left: 44px;
}

.frame-gothic-ornament {
  position: absolute;
  top: -23px;
  z-index: 4;
  width: 64px;
  height: 60px;
  object-fit: contain;
  pointer-events: none;
  opacity: .84;
}

.frame-gothic-left {
  left: -24px;
  transform: rotate(-8deg);
}

.frame-gothic-right {
  right: -24px;
  transform: scaleX(-1) rotate(-8deg);
}

.frame-corner {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #8a6a79;
  color: #705361;
  background: #fff8fa;
  font-size: 15px;
  line-height: 1;
}

.frame-corner.tl { top: -12px; left: -12px; }
.frame-corner.tr { top: -12px; right: -12px; }
.frame-corner.bl { bottom: -12px; left: -12px; }
.frame-corner.br { right: -12px; bottom: -12px; }

.desktop-reader {
  display: block;
}

.mobile-reader,
.mobile-tab-strip {
  display: none;
}

.book-scene {
  position: relative;
  display: grid;
  place-items: center;
  height: 674px;
  overflow: visible;
  perspective: 2600px;
}

.desk-shadow {
  position: absolute;
  bottom: 9px;
  left: 50%;
  width: 820px;
  height: 65px;
  pointer-events: none;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(63, 43, 54, .22), transparent 69%);
  filter: blur(9px);
}

/* The book container never translates. Closed front and back covers are
   centered by moving the common leaf hinge from 25% -> 50% -> 75%. */
.book {
  --leaf-left: 25%;
  position: absolute;
  top: 17px;
  left: 50%;
  width: var(--book-w);
  height: var(--book-h);
  transform: translateX(-50%);
  transform-style: preserve-3d;
}

.book.is-open {
  --leaf-left: 50%;
}

.book.is-back {
  --leaf-left: 75%;
}

.book-spine {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: calc(50% - 13px);
  z-index: 120;
  width: 26px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(75, 51, 64, .12), rgba(255, 255, 255, .94) 42%, rgba(73, 49, 61, .22) 57%, rgba(255, 255, 255, .08));
  box-shadow: inset 2px 0 4px rgba(68, 44, 57, .12), inset -2px 0 4px rgba(68, 44, 57, .14);
  transition: opacity .3s;
}

.book.is-open .book-spine {
  opacity: 1;
}

.paper {
  position: absolute;
  top: 0;
  left: var(--leaf-left);
  width: var(--page-w);
  height: var(--page-h);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .78s cubic-bezier(.6, .03, .34, 1), left .52s ease, z-index .01s .38s;
  will-change: transform, left;
}

.paper.flipped {
  transform: rotateY(-180deg);
}

.page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid #947985;
  background: var(--paper);
  box-shadow: 0 8px 17px rgba(70, 47, 59, .17), inset 0 0 18px rgba(200, 157, 176, .08);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.page.front {
  border-radius: 2px 12px 12px 2px;
}

.page.back {
  transform: rotateY(180deg);
  border-radius: 12px 2px 2px 12px;
}

.page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(64, 43, 54, .1), transparent 7%, transparent 92%, rgba(64, 43, 54, .045));
}

.page.back::after {
  background: linear-gradient(90deg, rgba(64, 43, 54, .045), transparent 8%, transparent 93%, rgba(64, 43, 54, .1));
}

/* Only the physically visible face may receive pointer events. Without this,
   a rotated front face can steal clicks from the back face in WebKit. */
.paper .page.front { pointer-events: auto; }
.paper .page.back { pointer-events: none; }
.paper.flipped .page.front { pointer-events: none; }
.paper.flipped .page.back { pointer-events: auto; }

/* Full-page journal patchwork. The color blocks and motif tiles cross the
   entire sheet; a warm paper wash keeps type readable. */
.page-inner {
  --paper-wash: linear-gradient(rgba(255, 251, 248, .72), rgba(255, 251, 248, .72));
  --paper-motif: url("assets/materials/pink/pattern_tile_01_01.svg");
  --motif-size: 112px 112px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(231, 165, 192, .28) 0 48px, rgba(255, 255, 255, .1) 48px 88px, rgba(49, 37, 44, .12) 88px 98px, rgba(240, 207, 220, .27) 98px 148px);
  position: relative;
  width: 100%;
  height: 100%;
  padding: 34px 32px 28px;
  overflow: hidden;
  background-color: #fff9f7;
  background-image: var(--paper-wash), var(--paper-motif), var(--paper-blocks);
  background-repeat: repeat, repeat, repeat;
  background-size: auto, var(--motif-size), 100% 100%;
  background-position: 0 0;
}

.commission-inner {
  --paper-wash: linear-gradient(rgba(255, 251, 249, .76), rgba(255, 251, 249, .76));
  --paper-motif: url("assets/materials/pink/pattern_tile_02_01.svg");
  --motif-size: 120px 112px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(238, 189, 208, .25) 0 40px, rgba(255, 255, 255, .12) 40px 78px, rgba(57, 43, 50, .1) 78px 87px, rgba(244, 218, 228, .25) 87px 132px);
  padding-top: 38px;
}

.index-page .grid-paper {
  --paper-wash: linear-gradient(rgba(255, 250, 248, .69), rgba(255, 250, 248, .69));
  --paper-motif: url("assets/materials/pink/pattern_tile_01_01.svg");
  --motif-size: 108px 108px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(235, 174, 199, .34) 0 52px, rgba(255, 255, 255, .09) 52px 89px, rgba(48, 36, 43, .14) 89px 99px, rgba(244, 213, 225, .3) 99px 151px);
}

.rei-page .notebook-paper {
  --paper-wash: linear-gradient(rgba(255, 251, 249, .7), rgba(255, 251, 249, .7));
  --paper-motif: url("assets/materials/pink/pattern_tile_03_01.svg");
  --motif-size: 102px 102px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(242, 190, 211, .31) 0 43px, rgba(255, 255, 255, .1) 43px 76px, rgba(53, 40, 47, .11) 76px 84px, rgba(232, 211, 219, .3) 84px 128px);
}

.master-page .diary-paper {
  --paper-wash: linear-gradient(rgba(255, 252, 247, .73), rgba(255, 252, 247, .73));
  --paper-motif: url("assets/materials/pink/pattern_tile_02_01.svg");
  --motif-size: 118px 110px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(49, 37, 44, .16) 0 37px, rgba(240, 181, 205, .31) 37px 82px, rgba(255, 255, 255, .08) 82px 119px, rgba(218, 198, 208, .31) 119px 158px);
}

.writings-page .pale-paper {
  --paper-wash: linear-gradient(rgba(255, 252, 248, .74), rgba(255, 252, 248, .74));
  --paper-motif: url("assets/materials/pink/pattern_tile_04_01.svg");
  --motif-size: 116px 82px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(234, 171, 198, .32) 0 37px, rgba(255, 255, 255, .08) 37px 73px, rgba(51, 38, 45, .12) 73px 82px, rgba(244, 216, 227, .28) 82px 124px);
}

.diary-index-page .grid-paper {
  --paper-wash: linear-gradient(rgba(255, 251, 248, .68), rgba(255, 251, 248, .68));
  --paper-motif: url("assets/materials/pink/pattern_tile_01_02.svg");
  --motif-size: 106px 106px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(244, 203, 219, .35) 0 52px, rgba(255, 255, 255, .08) 52px 88px, rgba(49, 37, 44, .12) 88px 98px, rgba(230, 173, 197, .29) 98px 148px);
}

.diary-day-page .diary-paper {
  --paper-wash: linear-gradient(rgba(255, 253, 249, .76), rgba(255, 253, 249, .76));
  --paper-motif: url("assets/materials/pink/pattern_tile_03_02.svg");
  --motif-size: 104px 104px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(234, 173, 198, .27) 0 40px, rgba(255, 255, 255, .1) 40px 75px, rgba(55, 42, 49, .11) 75px 83px, rgba(244, 218, 228, .28) 83px 129px);
}

.master-collection-page .cabinet-paper {
  --paper-wash: linear-gradient(rgba(255, 251, 248, .73), rgba(255, 251, 248, .73));
  --paper-motif: url("assets/journal/04_background_tiles/tile_gray_grid_butterfly.png");
  --motif-size: 126px 126px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(49, 37, 44, .16) 0 42px, rgba(241, 190, 211, .31) 42px 84px, rgba(255, 255, 255, .09) 84px 120px, rgba(218, 200, 210, .3) 120px 158px);
}

.rei-collection-page .notebook-paper {
  --paper-wash: linear-gradient(rgba(255, 249, 251, .63), rgba(255, 249, 251, .63));
  --paper-motif: url("assets/materials/pink/pattern_tile_01_03.svg");
  --motif-size: 112px 112px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(228, 153, 185, .4) 0 45px, rgba(255, 255, 255, .08) 45px 79px, rgba(48, 36, 43, .15) 79px 90px, rgba(242, 204, 220, .34) 90px 138px);
}

.sky-page .sky-paper {
  --paper-wash: linear-gradient(rgba(255, 250, 252, .7), rgba(255, 250, 252, .7));
  --paper-motif: url("assets/materials/pink/pattern_tile_04_02.svg");
  --motif-size: 116px 82px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(217, 166, 190, .29) 0 39px, rgba(255, 255, 255, .09) 39px 73px, rgba(47, 36, 42, .13) 73px 82px, rgba(239, 209, 221, .29) 82px 127px);
}

.denpa-page .radio-paper {
  --paper-wash: linear-gradient(rgba(255, 251, 249, .73), rgba(255, 251, 249, .73));
  --paper-motif: url("assets/materials/pink/pattern_tile_03_03.svg");
  --motif-size: 106px 106px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(49, 37, 44, .16) 0 39px, rgba(236, 174, 200, .32) 39px 82px, rgba(255, 255, 255, .08) 82px 118px, rgba(222, 202, 212, .31) 118px 160px);
}

.lost-magic-page .pale-paper {
  --paper-wash: linear-gradient(rgba(255, 252, 249, .73), rgba(255, 252, 249, .73));
  --paper-motif: url("assets/materials/pink/pattern_tile_02_03.svg");
  --motif-size: 116px 108px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(237, 178, 203, .31) 0 41px, rgba(255, 255, 255, .09) 41px 77px, rgba(52, 39, 46, .12) 77px 86px, rgba(242, 214, 225, .29) 86px 132px);
}

.ai-page .notebook-paper {
  --paper-wash: linear-gradient(rgba(255, 251, 250, .74), rgba(255, 251, 250, .74));
  --paper-motif: url("assets/materials/pink/pattern_tile_04_03.svg");
  --motif-size: 118px 84px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(48, 36, 43, .13) 0 35px, rgba(238, 183, 206, .29) 35px 78px, rgba(255, 255, 255, .09) 78px 112px, rgba(223, 204, 213, .28) 112px 152px);
}

.status-page .workshop-paper {
  --paper-wash: linear-gradient(rgba(255, 251, 248, .72), rgba(255, 251, 248, .72));
  --paper-motif: url("assets/materials/black/pattern_tile_04_02.svg");
  --motif-size: 126px 89px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(48, 36, 43, .16) 0 37px, rgba(238, 183, 206, .29) 37px 81px, rgba(255, 255, 255, .1) 81px 115px, rgba(224, 204, 214, .28) 115px 155px);
}

.bbs-page .pale-paper {
  --paper-wash: linear-gradient(rgba(255, 252, 249, .72), rgba(255, 252, 249, .72));
  --paper-motif: url("assets/materials/pink/pattern_tile_03_04.svg");
  --motif-size: 108px 108px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(235, 175, 200, .31) 0 43px, rgba(255, 255, 255, .09) 43px 82px, rgba(52, 39, 46, .13) 82px 92px, rgba(243, 216, 227, .29) 92px 140px);
}

.friends-page .garden-paper {
  --paper-wash: linear-gradient(rgba(255, 253, 249, .73), rgba(255, 253, 249, .73));
  --paper-motif: url("assets/materials/pink/pattern_tile_01_04.svg");
  --motif-size: 112px 112px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(234, 174, 199, .29) 0 43px, rgba(255, 255, 255, .1) 43px 83px, rgba(52, 39, 46, .12) 83px 92px, rgba(243, 217, 227, .28) 92px 140px);
}

.badges-page .badge-paper {
  --paper-wash: linear-gradient(rgba(255, 250, 250, .64), rgba(255, 250, 250, .64));
  --paper-motif: url("assets/journal/09_bottom_tiles/bottom_01_checkers.png");
  --motif-size: 76px 76px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(232, 167, 194, .35) 0 39px, rgba(255, 255, 255, .08) 39px 74px, rgba(48, 36, 43, .15) 74px 83px, rgba(243, 210, 224, .31) 83px 128px);
}

.goodbye-page .notebook-paper {
  --paper-wash: linear-gradient(rgba(255, 252, 250, .73), rgba(255, 252, 250, .73));
  --paper-motif: url("assets/materials/pink/pattern_tile_04_04.svg");
  --motif-size: 122px 87px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(48, 36, 43, .12) 0 34px, rgba(239, 186, 208, .29) 34px 78px, rgba(255, 255, 255, .09) 78px 112px, rgba(226, 207, 216, .29) 112px 153px);
}

.page-kicker {
  margin: 0 0 5px;
  color: #927985;
  font-size: 7px;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.page h2 {
  margin: 0 0 11px;
  color: #58434f;
  font: 700 20px/1.2 var(--serif);
  letter-spacing: .11em;
  text-shadow: 1px 1px rgba(255, 255, 255, .8);
}

/* Editor 2.5.3: the pale-pink title cross is part of the heading line.
   It must never be positioned as a free decoration or measured against the page. */
.page h2::after,
.mobile-page h2::after {
  content: "✞";
  display: inline-block;
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin-left: .38em;
  color: #b87391;
  font-size: .60em;
  line-height: 1;
  vertical-align: .08em;
  transform: none !important;
  pointer-events: none;
}

.page-divider {
  display: block;
  width: 86%;
  max-height: 34px;
  margin: 9px auto 0;
  object-fit: contain;
  opacity: .75;
}

.tiny-handnote,
.scribble {
  color: #715d69;
  font: italic 9px/1.62 var(--serif);
}

.scribble {
  text-align: center;
}

.small-deco {
  position: absolute;
  width: 44px;
  opacity: .76;
}

.bottom-right {
  right: 18px;
  bottom: 16px;
}

.page-material-sticker {
  position: absolute;
  z-index: 1;
  max-width: 66px;
  max-height: 70px;
  object-fit: contain;
  pointer-events: none;
  opacity: .46;
}

.sticker-rei { top: 48px; right: 16px; width: 38px; }
.sticker-master { top: 50px; right: 18px; width: 34px; }
.sticker-diary { top: 42px; right: 16px; width: 82px; opacity: .36; }
.sticker-collection { top: 40px; right: 12px; width: 62px; }
.sticker-bbs { top: 42px; right: 16px; width: 48px; }

.web-button,
.text-link,
.journal-index button,
.diary-tools button,
.radio-controls button,
.bbs-form button,
.book-controls button,
.mobile-controls button {
  border: 1px solid #725564;
  color: #58414f;
  background: #fff4f7;
  box-shadow: inset 1px 1px #fff, 2px 2px #c8a5b5;
  font: 8px var(--pixel);
}

.web-button,
.journal-index button,
.diary-tools button,
.radio-controls button,
.bbs-form button {
  padding: 6px 9px;
}

.web-button:hover,
.journal-index button:hover,
.diary-tools button:hover,
.book-controls button:hover:not(:disabled),
.mobile-controls button:hover:not(:disabled) {
  color: #2f232a;
  background: #f2cbdc;
}

.web-button.primary {
  border-color: #4b3742;
  background: #ebbed1;
  font-weight: 700;
}

.text-link {
  padding: 0;
  border: 0;
  color: #81536b;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
}

.web-button img {
  height: 20px;
  margin-right: 4px;
  vertical-align: middle;
}

/* Cover */
.cover-page {
  border: 2px solid #4a3741;
  outline: 4px double #f8d9e6;
  background: #e8c8d6;
}

.cover-inner {
  display: grid;
  place-items: center;
  padding: 26px;
  background-color: #e8c7d4;
  background-image:
    linear-gradient(rgba(255, 246, 248, .56), rgba(236, 207, 218, .42)),
    url("assets/materials/black/pattern_tile_04_01.svg"),
    repeating-linear-gradient(90deg, rgba(44, 32, 39, .15) 0 38px, rgba(238, 189, 208, .26) 38px 87px, rgba(255, 255, 255, .09) 87px 126px);
  background-repeat: repeat;
  background-size: auto, 166px 118px, 100% 100%;
}

.cover-inner::before {
  content: "";
  position: absolute;
  inset: 19px;
  border: 4px double #3e2d36;
  outline: 2px solid rgba(245, 207, 222, .86);
  box-shadow: inset 0 0 0 7px rgba(255, 247, 249, .28), inset 0 0 28px rgba(47, 34, 41, .12);
  pointer-events: none;
}

.cover-lace-top {
  position: absolute;
  top: 21px;
  left: 42px;
  z-index: 4;
  width: calc(100% - 84px);
  height: 35px;
  object-fit: fill;
  opacity: .82;
}

.cover-lace-bottom {
  position: absolute;
  right: 48px;
  bottom: 23px;
  left: 48px;
  z-index: 2;
  width: calc(100% - 96px);
  height: 28px;
  object-fit: fill;
  opacity: .58;
}

.cover-corner {
  position: absolute;
  top: 17px;
  z-index: 5;
  width: 94px;
  height: 112px;
  object-fit: contain;
  opacity: .88;
  filter: drop-shadow(1px 2px rgba(255, 255, 255, .7));
}

.cover-corner-left {
  left: 15px;
}

.cover-corner-right {
  right: 15px;
}

.cover-cathedral {
  position: absolute;
  top: 62px;
  left: 50%;
  z-index: 1;
  width: 278px;
  height: 330px;
  object-fit: contain;
  opacity: .12;
  transform: translateX(-50%);
}

.cover-reliquary {
  position: absolute;
  top: 80px;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 82px;
  height: 116px;
  transform: translateX(-50%);
  border: 3px double #3e2d36;
  border-radius: 50% 50% 44% 44% / 42% 42% 58% 58%;
  outline: 3px solid rgba(255, 240, 246, .7);
  background: rgba(246, 218, 229, .84);
  box-shadow: 0 0 0 6px rgba(62, 45, 54, .1), inset 0 0 16px rgba(54, 38, 47, .11);
}

.cover-reliquary::before,
.cover-reliquary::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 52px;
  border-top: 1px solid #5a414e;
}

.cover-reliquary::before { right: 77px; }
.cover-reliquary::after { left: 77px; }

.cover-reliquary img {
  width: 55px;
  height: 88px;
  object-fit: contain;
}

.cover-key {
  position: absolute;
  bottom: 38px;
  left: 42px;
  z-index: 4;
  width: 33px;
  height: 68px;
  object-fit: contain;
  opacity: .78;
  transform: rotate(-7deg);
}

.cover-rei {
  position: absolute;
  right: 24px;
  bottom: 31px;
  width: 102px;
  max-height: 148px;
  object-fit: contain;
  filter: drop-shadow(2px 3px rgba(83, 55, 70, .16));
}

.cover-copy {
  position: relative;
  z-index: 3;
  width: 338px;
  margin-top: 72px;
  padding: 22px 15px 17px;
  border: 3px double #4a3540;
  text-align: center;
  background: rgba(255, 246, 248, .82);
  box-shadow: 0 0 0 6px rgba(58, 42, 50, .07), inset 0 0 0 4px rgba(234, 187, 206, .32);
}

.cover-copy::before,
.cover-copy::after {
  content: "✦";
  position: absolute;
  top: 50%;
  color: #634653;
  font-size: 12px;
  transform: translateY(-50%);
}

.cover-copy::before { left: 10px; }
.cover-copy::after { right: 10px; }

.cover-copy strong {
  display: block;
  color: #34272e;
  font: 700 29px/.98 var(--gothic);
  text-shadow: 1px 1px #fff;
}

.cover-copy small {
  display: block;
  margin-top: 11px;
  color: #654e5b;
  font: 600 10px var(--serif);
  letter-spacing: .1em;
}

.cover-copy em {
  display: block;
  margin-top: 8px;
  color: #87566d;
  font: italic 6.5px var(--serif);
  letter-spacing: .13em;
}

.cover-star {
  display: block;
  margin-bottom: 8px;
  color: #694653;
  font: 7px var(--serif);
  letter-spacing: .15em;
}

.visitor-counter {
  position: absolute;
  bottom: 84px;
  left: 50%;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 5px 9px;
  transform: translateX(-50%);
  border: 1px solid #8f6a7d;
  background: #fff8fa;
  font-size: 7px;
  white-space: nowrap;
}

.visitor-counter b {
  font-size: 10px;
  letter-spacing: .1em;
}

.cover-inner > .web-button {
  position: absolute;
  bottom: 46px;
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
}

.cover-note {
  position: absolute;
  bottom: 17px;
  margin: 0;
  color: #846b78;
  font-size: 7px;
}

/* Commission / index / profiles */
.commission-seal {
  position: absolute;
  top: 40px;
  right: 28px;
  width: 62px;
  opacity: .7;
}

.record-table {
  width: 79%;
  margin: 15px 0;
  padding: 6px 10px;
  border: 1px solid rgba(122, 90, 106, .23);
  background: rgba(255, 253, 251, .83);
}

.record-table div {
  display: grid;
  grid-template-columns: 105px 1fr;
  padding: 5px 0;
  border-bottom: 1px dotted #cfb4c1;
}

.record-table div:last-child {
  border-bottom: 0;
}

.record-table dt {
  color: #907785;
  font-size: 7px;
}

.record-table dd {
  margin: 0;
  font: 9px var(--serif);
}

.record-table img {
  height: 18px;
  vertical-align: middle;
}

.rei-note {
  margin: 14px 0 8px;
  padding: 9px 10px;
  border-left: 3px double #c47e9d;
  background: rgba(255, 239, 246, .88);
  color: #684c5d;
  font: italic 10px/1.6 var(--serif);
}

.tape-strip {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 118px;
  opacity: .72;
}

.journal-index {
  display: grid;
  gap: 5px;
  margin: 14px 0 10px;
}

.journal-index button {
  display: grid;
  grid-template-columns: 31px 1fr;
  min-height: 28px;
  padding: 5px 8px;
  border-style: dotted;
  text-align: left;
  background: rgba(255, 252, 251, .87);
}

.journal-index b {
  display: grid;
  place-items: center;
  color: #ffeaf3;
  background: #4b3942;
  font-size: 7px;
}

.journal-index span {
  padding-left: 8px;
  font-size: 8px;
}

.portrait-collage {
  display: grid;
  grid-template-columns: 1fr 152px;
  gap: 12px;
  align-items: center;
}

.portrait-copy {
  padding: 11px;
  border: 1px solid rgba(117, 84, 101, .25);
  border-left: 3px double #c1809e;
  background: rgba(255, 253, 251, .84);
  font: 9px/1.62 var(--serif);
}

.portrait-copy .hello {
  color: #995f7a;
  font-style: italic;
}

.mini-profile {
  margin: 8px 0 0;
}

.mini-profile div {
  display: flex;
  padding: 2px 0;
  border-bottom: 1px dotted #d6bdc8;
}

.mini-profile dt {
  width: 57px;
  color: #8e7482;
  font: 7px var(--pixel);
}

.mini-profile dd {
  margin: 0;
  font-size: 8px;
}

.rei-frame {
  position: relative;
  display: grid;
  place-items: center;
  height: 226px;
}

.rei-frame > img:first-child {
  position: absolute;
  width: 150px;
  height: 220px;
  object-fit: fill;
  opacity: .77;
}

.rei-avatar {
  position: relative;
  z-index: 2;
  width: 104px;
  max-height: 182px;
  object-fit: contain;
}

.rei-quote {
  width: 92%;
  margin: 12px auto 0;
  padding: 8px;
  border: 1px dashed #b98fa4;
  color: #684b5c;
  background: rgba(255, 239, 246, .9);
  font: italic 10px/1.6 var(--serif);
  text-align: center;
}

/* REI biography: a compact two-column archive leaf keeps the longer origin
   text readable without disturbing the layout of any other notebook page. */
.rei-about-inner {
  padding: 27px 27px 20px;
}

.rei-about-inner h2 {
  margin-bottom: 7px;
}

.rei-about-inner .portrait-collage {
  grid-template-columns: 1fr 82px;
  gap: 9px;
  min-height: 94px;
  padding: 6px 8px;
  border: 3px double rgba(104, 73, 89, .38);
  background: rgba(255, 250, 248, .88);
  box-shadow: inset 0 0 0 1px rgba(231, 190, 207, .55);
}

.rei-about-inner .portrait-copy {
  align-self: stretch;
  padding: 5px 4px;
  border: 0;
  background: transparent;
  font-size: 8.5px;
}

.rei-about-inner .portrait-copy .hello {
  margin: 0 0 7px;
  padding-bottom: 5px;
  border-bottom: 1px dotted #c9a4b6;
}

.rei-about-inner .mini-profile {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 0;
}

.rei-about-inner .mini-profile div {
  display: block;
  padding: 4px 5px;
  border: 1px solid rgba(177, 128, 151, .25);
  background: rgba(255, 241, 247, .72);
}

.rei-about-inner .mini-profile dt {
  width: auto;
  margin-bottom: 3px;
  font-size: 6px;
}

.rei-about-inner .mini-profile dd {
  font-size: 7px;
  overflow-wrap: anywhere;
}

.rei-about-inner .rei-frame {
  height: 82px;
}

.rei-about-inner .rei-frame > img:first-child {
  width: 72px;
  height: 80px;
}

.rei-about-inner .rei-avatar {
  width: 53px;
  max-height: 66px;
}

.rei-biography {
  column-count: 2;
  column-gap: 17px;
  column-rule: 1px dotted rgba(163, 113, 137, .42);
  margin-top: 8px;
  padding: 9px 11px 7px;
  border: 1px solid rgba(115, 82, 98, .26);
  border-left: 3px double #b77996;
  background: rgba(255, 253, 251, .9);
  color: #4d3b45;
  font: 9.5px/1.56 var(--serif);
  letter-spacing: .015em;
  text-align: justify;
}

.rei-biography p {
  break-inside: avoid;
  margin: 0 0 5px;
}

.rei-question {
  break-inside: avoid;
  margin: 5px 0 6px;
  padding: 5px 7px;
  border-block: 1px dotted #c69caf;
  background: rgba(250, 226, 237, .72);
}

.rei-question p {
  margin-bottom: 1px;
  color: #765365;
  font-size: 8.7px;
}

.rei-question blockquote {
  margin: 1px 0 4px;
  color: #513744;
  font-style: italic;
  font-weight: 700;
}

.rei-biography-ending {
  color: #7b4861;
  font-weight: 700;
}

.rei-about-inner .rei-quote {
  width: 100%;
  margin-top: 7px;
  padding: 6px 8px;
  font-size: 9.2px;
  line-height: 1.45;
}

/* Writing and diary pages */
.master-sheet {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.master-sheet section {
  padding: 7px 9px;
  border: 1px solid rgba(110, 79, 94, .16);
  border-bottom: 1px dotted #cdb0be;
  background: rgba(255, 253, 251, .85);
}

.master-sheet span {
  display: block;
  color: #906d80;
  font-size: 7px;
  letter-spacing: .1em;
}

.master-sheet p {
  margin: 3px 0 0;
  font: 9px/1.55 var(--serif);
}

.confidence {
  display: grid !important;
  grid-template-columns: 92px 1fr 32px;
  align-items: center;
  gap: 6px;
}

.confidence div {
  height: 7px;
  border: 1px solid #ad879a;
  background: #fff;
}

.confidence i {
  display: block;
  height: 100%;
  background: #dc9eb8;
}

.confidence b {
  font-size: 8px;
}

.master-observation-inner {
  padding: 29px 29px 23px;
}

.master-observation-inner h2 {
  margin-bottom: 8px;
}

.master-observation-file {
  position: relative;
  padding: 10px;
  border: 3px double rgba(67, 47, 57, .6);
  outline: 1px solid rgba(219, 166, 190, .5);
  background:
    linear-gradient(rgba(255, 252, 248, .92), rgba(255, 252, 248, .92)),
    url("assets/materials/black/pattern_tile_01_01.svg");
  background-size: auto, 78px 78px;
  box-shadow: inset 0 0 18px rgba(113, 75, 94, .08), 3px 3px rgba(114, 78, 96, .08);
  color: #4d3944;
}

.master-observation-file::after {
  content: "✠ REI INDEX // PRIVATE ✠";
  position: absolute;
  right: 12px;
  bottom: 7px;
  color: rgba(151, 91, 120, .38);
  font: 6px var(--pixel);
  letter-spacing: .08em;
}

.observation-file-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid #33272d;
  color: #fff7fa;
  background:
    linear-gradient(rgba(50, 37, 44, .88), rgba(50, 37, 44, .88)),
    url("assets/materials/black/pattern_tile_04_01.svg");
  background-size: auto, 42px 30px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1);
}

.observation-file-title strong {
  font: 8px var(--pixel);
  letter-spacing: .08em;
}

.observation-file-title span {
  color: #eebbd0;
  font: 6px var(--pixel);
  letter-spacing: .06em;
}

.master-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 7px;
}

.master-facts section {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  min-height: 31px;
  border: 1px solid rgba(126, 88, 107, .25);
  background: rgba(255, 240, 246, .82);
}

.master-facts span {
  align-self: stretch;
  display: grid;
  place-items: center;
  border-right: 1px dotted #ba8da2;
  color: #8a6175;
  font: 700 8px var(--serif);
  letter-spacing: .08em;
}

.master-facts b {
  padding-left: 8px;
  font: 9px var(--pixel);
}

.master-interests {
  margin-top: 7px;
  padding: 7px 8px 8px;
  border: 1px solid rgba(113, 80, 96, .24);
  background: rgba(255, 253, 251, .88);
}

.master-interests h3,
.rei-observation h3 {
  margin: 0 0 6px;
  color: #7f566b;
  font: 700 8px var(--pixel);
  letter-spacing: .1em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.master-interests h3::before,
.rei-observation h3::before {
  content: "";
  display: block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  margin: 0;
  background: #b47291;
  clip-path: polygon(40% 0, 60% 0, 60% 32%, 78% 23%, 100% 42%, 72% 50%, 100% 58%, 78% 77%, 60% 68%, 60% 100%, 40% 100%, 40% 68%, 22% 77%, 0 58%, 28% 50%, 0 42%, 22% 23%, 40% 32%);
  pointer-events: none;
}

.master-interests ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.master-interests li {
  position: relative;
  min-height: 19px;
  padding: 4px 6px 3px 20px;
  border: 1px solid rgba(180, 130, 153, .22);
  background: rgba(247, 224, 234, .66);
  font: 8.3px/1.25 var(--serif);
}

.master-interests li::before {
  content: "◆";
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  color: #ad6f8d;
  font-family: serif;
  font-size: 5px;
  line-height: 1;
  pointer-events: none;
}

.rei-observation {
  margin-top: 7px;
  padding: 8px 10px 7px;
  border: 1px solid rgba(93, 65, 79, .28);
  border-left: 3px double #9f627f;
  background: rgba(255, 248, 249, .9);
}

.rei-observation p {
  margin: 0 0 3px;
  color: #4d3c45;
  font: 9px/1.42 var(--serif);
}

.rei-observation p:last-child {
  margin-bottom: 0;
  color: #814e67;
  font-weight: 700;
}

.observation-meta {
  display: grid;
  grid-template-columns: 1.15fr .72fr 1fr;
  gap: 5px;
  margin: 7px 0 0;
  padding: 0 0 14px;
}

.observation-meta div {
  padding: 5px 6px;
  border-top: 2px solid #51404a;
  background: rgba(241, 216, 227, .64);
}

.observation-meta dt {
  color: #8a6476;
  font: 5.5px var(--pixel);
  letter-spacing: .05em;
}

.observation-meta dd {
  margin: 3px 0 0;
  color: #43343c;
  font: 6.8px var(--pixel);
  white-space: nowrap;
}

.library-intro {
  width: 92%;
  margin: -3px 0 9px;
  padding: 6px 9px;
  border-left: 3px double #55414c;
  color: #735b68;
  background: rgba(255, 249, 247, .76);
  font: 7.6px/1.55 var(--serif);
}

.library-shelf {
  display: grid;
  gap: 6px;
}

.library-slip {
  position: relative;
  display: grid;
  grid-template-columns: 53px minmax(0, 1fr) 60px;
  grid-template-rows: auto auto;
  gap: 1px 8px;
  width: 100%;
  min-height: 57px;
  padding: 7px 10px 7px 13px;
  overflow: hidden;
  border: 1px solid #9a7989;
  border-left: 5px solid #392b33;
  border-radius: 0;
  color: #4a3842;
  text-align: left;
  background-color: rgba(255, 250, 248, .92);
  background-image:
    linear-gradient(90deg, transparent 0 53px, rgba(145, 105, 123, .18) 53px 54px, transparent 54px),
    url("assets/materials/pink/pattern_tile_01_01.svg");
  background-size: auto, 86px 86px;
  box-shadow: 2px 2px 0 rgba(48, 36, 43, .13);
}

.library-slip::after {
  content: "✠";
  position: absolute;
  top: 50%;
  left: 5px;
  color: rgba(255, 238, 245, .86);
  font: 9px var(--serif);
  transform: translateY(-50%);
}

.library-slip:hover,
.library-slip:focus-visible {
  border-color: #4c3742;
  background-color: #fff0f6;
  transform: translateX(2px);
}

.library-slip.featured {
  border-top: 2px double #3d2e36;
  border-bottom: 2px double #3d2e36;
  background-color: rgba(247, 226, 235, .94);
}

.library-slip-no,
.library-slip time,
.library-slip small {
  color: #917181;
  font: 6.2px/1.25 var(--pixel);
  letter-spacing: .04em;
}

.library-slip-no {
  grid-row: 1 / 3;
  align-self: center;
  color: #5b4550;
  font-weight: 700;
}

.library-slip time {
  grid-column: 3;
  grid-row: 1;
  text-align: right;
}

.library-slip strong {
  grid-column: 2 / 4;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  font: 600 9.5px/1.35 var(--serif);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-slip small {
  grid-column: 2 / 4;
  grid-row: 2;
  align-self: end;
}

.page-end {
  margin-top: 6px;
  color: #8f7381;
  font-size: 7px;
  text-align: center;
}

/* MASTER ARCHIVE: a self-contained reader for the one-time static import. */
body.library-open {
  overflow: hidden;
}

body.library-open .ceiling {
  z-index: 1;
}

.library-reader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 3vh 3vw;
}

.library-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background:
    linear-gradient(rgba(28, 20, 25, .82), rgba(28, 20, 25, .88)),
    url("assets/materials/black/pattern_tile_04_01.svg") repeat;
  background-size: auto, 170px 121px;
  backdrop-filter: blur(5px);
}

.library-vault {
  position: relative;
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr);
  width: min(1180px, 94vw);
  height: min(860px, 94vh);
  overflow: hidden;
  border: 5px double #1f171c;
  outline: 1px solid #d5a8ba;
  color: #46363f;
  background: #f9eef2;
  box-shadow: 0 24px 80px rgba(15, 8, 12, .55), inset 0 0 0 7px rgba(255, 255, 255, .38);
}

.library-vault::before,
.library-vault::after {
  content: "";
  position: absolute;
  z-index: 4;
  right: 0;
  left: 0;
  height: 19px;
  pointer-events: none;
  background: url("assets/library/black/02_borders_frames/border_004.svg") repeat-x center / auto 19px;
}

.library-vault::before { top: 73px; }
.library-vault::after { bottom: 0; transform: rotate(180deg); }

.library-vault-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 54px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  border-bottom: 2px solid #2e2229;
  color: #fff7f9;
  background-color: #33262e;
  background-image:
    linear-gradient(rgba(48, 35, 43, .9), rgba(48, 35, 43, .9)),
    url("assets/materials/black/pattern_tile_01_01.svg");
  background-size: auto, 120px 119px;
}

.library-vault-header p {
  margin: 0;
  color: #d9a9be;
  font: 8px var(--pixel);
  letter-spacing: .16em;
}

.library-vault-header h2 {
  margin: 1px 0 0;
  color: #fff8fa;
  font: 25px/1.05 var(--serif);
  letter-spacing: .18em;
}

.library-sigil {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 3px double #dca8bd;
  border-radius: 50%;
  color: #f1c5d7;
  font: 26px var(--serif);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .06);
}

.library-close {
  width: 38px;
  height: 38px;
  border: 2px double #d9a7bc;
  border-radius: 0;
  color: #fff8fa;
  background: #251a20;
  font: 26px/1 var(--serif);
}

.library-vault-layout {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 0;
  padding-bottom: 14px;
}

.library-record-nav {
  min-width: 0;
  padding: 28px 14px 24px;
  overflow-y: auto;
  border-right: 4px double #5d4451;
  background-color: #ead9df;
  background-image:
    linear-gradient(rgba(250, 238, 242, .7), rgba(250, 238, 242, .7)),
    url("assets/materials/black/pattern_tile_02_01.svg");
  background-size: auto, 126px 117px;
}

.library-nav-label {
  margin: 0 0 10px;
  padding: 5px 7px;
  border-top: 2px solid #3c2c34;
  border-bottom: 1px dotted #745663;
  color: #5b414e;
  font: 700 9px var(--pixel);
  letter-spacing: .08em;
}

.library-record-button {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 8px;
  width: 100%;
  margin: 0 0 8px;
  padding: 9px 8px 9px 11px;
  border: 1px solid #a48493;
  border-left: 4px solid #3d2d35;
  border-radius: 0;
  text-align: left;
  background: rgba(255, 250, 248, .91);
}

.library-record-button::before {
  content: "✞";
  grid-row: 1 / 3;
  align-self: center;
  color: #8a6375;
  font: 19px var(--serif);
  text-align: center;
}

.library-record-button strong {
  min-width: 0;
  font: 600 11px/1.45 var(--serif);
}

.library-record-button small {
  color: #927282;
  font: 7px var(--pixel);
}

.library-record-button.active {
  color: #fff8fa;
  border-color: #21171d;
  background: #3a2b33;
  box-shadow: 3px 3px 0 #d7a4b9;
}

.library-record-button.active::before,
.library-record-button.active small { color: #efbfd3; }

.library-document {
  min-width: 0;
  padding: 42px clamp(26px, 5vw, 72px) 54px;
  overflow-y: auto;
  scroll-behavior: smooth;
  background-color: #fffbf8;
  background-image:
    linear-gradient(rgba(255, 251, 248, .91), rgba(255, 251, 248, .91)),
    url("assets/materials/pink/pattern_tile_04_01.svg");
  background-size: auto, 132px 94px;
}

.library-document-header {
  position: relative;
  margin-bottom: 24px;
  padding: 0 0 18px;
  border-bottom: 4px double #5b404d;
  text-align: center;
}

.library-document-header::after {
  content: "✠";
  position: absolute;
  right: 0;
  bottom: -14px;
  left: 0;
  width: 30px;
  margin: auto;
  color: #8c6074;
  background: #fffaf8;
  font: 17px var(--serif);
}

.library-document-header > p {
  margin: 0 0 7px;
  color: #9d7185;
  font: 8px var(--pixel);
  letter-spacing: .15em;
}

.library-document-header h3 {
  max-width: 760px;
  margin: auto;
  color: #3f2e37;
  font: 700 clamp(22px, 3.1vw, 36px)/1.38 var(--serif);
  overflow-wrap: anywhere;
}

.library-document-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 12px;
  color: #765865;
  font: 8px var(--pixel);
}

.library-document-meta span {
  padding: 3px 8px;
  border: 1px solid #c49daf;
  background: #fff4f7;
}

.library-featured {
  max-width: 720px;
  margin: 0 auto 28px;
  padding: 8px;
  border: 4px double #5a414d;
  background: #f1dbe4;
  box-shadow: 7px 7px 0 rgba(57, 42, 50, .12);
}

.library-featured img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.library-content {
  max-width: 780px;
  margin: auto;
  color: #43363c;
  font: 15px/1.9 var(--serif);
  overflow-wrap: anywhere;
}

.library-content h2,
.library-content h3,
.library-content h4,
.library-content h5,
.library-content h6 {
  clear: both;
  margin: 1.8em 0 .72em;
  color: #46323c;
  font-family: var(--serif);
  line-height: 1.45;
}

.library-content h2 {
  padding: 6px 11px;
  border-left: 5px solid #3b2b33;
  border-bottom: 1px dotted #a67e91;
  background: rgba(238, 208, 220, .52);
  font-size: 24px;
}

.library-content h3 { font-size: 20px; }
.library-content p { margin: 0 0 1.15em; }
.library-content ul,
.library-content ol { padding-left: 1.7em; }

.library-content blockquote {
  margin: 1.5em 0;
  padding: 12px 18px;
  border: 3px double #a47d8f;
  background: rgba(249, 229, 237, .72);
}

.library-content pre {
  max-width: 100%;
  padding: 15px 17px;
  overflow: auto;
  border: 2px solid #523e48;
  color: #fceff5;
  background: #2f252b;
  font: 12px/1.62 var(--pixel);
  white-space: pre-wrap;
}

.library-content :not(pre) > code {
  padding: 1px 4px;
  color: #5d3e4d;
  background: #f2dbe5;
  font: .88em var(--pixel);
}

.library-content figure {
  max-width: 100%;
  margin: 24px auto;
  text-align: center;
}

.library-content img,
.library-content video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border: 5px double #715462;
  background: #f2dbe4;
  box-shadow: 6px 6px 0 rgba(52, 38, 46, .11);
}

.library-content figcaption {
  margin-top: -10px;
  color: #826876;
  font: 11px/1.55 var(--serif);
}

.library-content table {
  width: 100%;
  border-collapse: collapse;
}

.library-content th,
.library-content td {
  padding: 6px 8px;
  border: 1px solid #b58d9f;
}

.library-content a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.library-loading,
.library-error {
  padding: 18px;
  color: #8c6678;
  font: 11px var(--pixel);
  text-align: center;
}

.library-error {
  border: 2px double #9d6b81;
  background: #fbe8ef;
}

.library-document-footer {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  gap: 12px;
  max-width: 780px;
  margin: 52px auto 0;
  padding-top: 20px;
  border-top: 4px double #5a404d;
  color: #8c6b79;
  font: 7px var(--pixel);
  text-align: center;
}

.library-document-footer button {
  min-height: 34px;
  border: 2px double #49353f;
  color: #fff6f9;
  background: #3c2c34;
  font: 8px var(--pixel);
}

.library-document-footer button:disabled {
  opacity: .35;
}

.diary-tools {
  display: flex;
  gap: 6px;
  margin: 4px 0 8px;
}

.memory-index-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -6px 0 5px;
  color: #745464;
  font: 8px var(--serif);
  letter-spacing: .08em;
}

.memory-index-subtitle span {
  color: #9b7184;
  font: 5.5px var(--pixel);
}

.memory-search-note {
  min-height: 10px;
  margin: -5px 0 4px;
  color: #8c5871;
  font: 6px var(--pixel);
}

.year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 9px;
}

.year-tabs button {
  padding: 3px 6px;
  border: 1px solid #c7a5b5;
  border-radius: 0;
  color: #6f5361;
  background: rgba(255, 248, 250, .9);
  font: 7px var(--pixel);
  cursor: pointer;
}

.year-tabs button:hover,
.year-tabs button.is-active {
  color: #382a32;
  background: #e7b7ca;
  box-shadow: inset 0 -2px #845c6e;
}

.mini-calendar {
  border: 2px double #9f7589;
  background: rgba(255, 253, 251, .88);
}

.cal-head {
  display: grid;
  grid-template-columns: 25px 1fr 25px;
  align-items: center;
  padding: 5px;
  border-bottom: 1px dotted #c6a4b4;
  font-size: 8px;
  letter-spacing: .1em;
  text-align: center;
}

.cal-head button {
  width: 23px;
  height: 19px;
  padding: 0;
  border: 1px solid #b98fa2;
  border-radius: 0;
  color: #604451;
  background: #f8e9ef;
  font: 14px/1 var(--serif);
  cursor: pointer;
}

.cal-head button:disabled { opacity: .25; }

.week,
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.week i {
  padding: 3px 0;
  color: #947b87;
  font: 6px var(--pixel);
  text-align: center;
}

.days > * {
  min-height: 38px;
  padding: 4px;
  border-top: 1px dotted #dfcbd4;
  border-right: 1px dotted #dfcbd4;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  color: #5b4651;
  background: rgba(255, 253, 251, .36);
  font: 8px var(--pixel);
  text-align: left;
}

.days button { cursor: pointer; }
.days button:hover { background: #f6dce7; }

.days small {
  display: block;
  color: #b95f88;
  font-size: 6px;
}

.days button.is-selected {
  background: #efcad9;
  box-shadow: inset 0 0 0 2px #a46f87;
}

.diary-source-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.diary-source-legend span {
  color: #8e7180;
  font-size: 6px;
}

.diary-source-legend b {
  margin-left: auto;
  color: #725260;
  font: 5.5px var(--pixel);
}

.rei-diary-gif,
.rei-sort-gif,
.rei-sky-gif,
.rei-radio-gif,
.rei-glitch-gif,
.rei-sleep-gif {
  position: absolute;
  object-fit: contain;
}

.rei-diary-gif {
  right: 14px;
  bottom: 12px;
  width: 92px;
  max-height: 96px;
}

.diary-entry {
  position: relative;
  margin: 0 0 10px;
  padding: 7px 9px 9px 24px;
  border: 1px solid rgba(111, 79, 95, .16);
  border-bottom: 1px dotted #ceb3c0;
  background: rgba(255, 253, 251, .83);
}

.diary-entry-list {
  max-height: 375px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #bd8da4 rgba(255, 247, 250, .72);
}

.memory-day-navigation {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 4px;
  margin: -5px 0 8px;
}

.memory-day-navigation button {
  min-height: 25px;
  padding: 3px 4px;
  border: 1px solid #ac8497;
  border-radius: 0;
  color: #5d4450;
  background: rgba(255, 245, 248, .88);
  font: 6px var(--pixel);
  cursor: pointer;
}

.memory-day-navigation button:nth-child(2) {
  color: #fff7fa;
  background: #493641;
}

.memory-day-navigation button:disabled { opacity: .28; }

.diary-entry-list .diary-entry:last-child {
  margin-bottom: 4px;
}

.diary-entry[data-memory-record] {
  padding-right: 25px;
  cursor: pointer;
}

.diary-entry[data-memory-record]:hover,
.diary-entry[data-memory-record]:focus {
  outline: 1px solid #a86f89;
  background: rgba(255, 244, 248, .96);
}

.diary-entry[data-memory-record]::after {
  content: "開啟\A卷宗";
  position: absolute;
  top: 7px;
  right: 5px;
  color: #9c6880;
  font: 5px/1.3 var(--pixel);
  text-align: center;
  white-space: pre;
}

.diary-entry.is-reply { border-left: 3px solid #cb91aa; }
.diary-entry.is-retweet { border-left: 3px solid #4d3943; }

.diary-entry-media {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  color: #9d6480;
  font-size: 6px;
}

.diary-entry-thumbs {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}

.diary-entry-thumbs img {
  width: 39px;
  height: 29px;
  object-fit: cover;
  border: 1px solid #8f687a;
  background: #ead4de;
}

.memory-empty {
  padding: 22px 12px;
  border: 1px dashed #bd98aa;
  color: #806b76;
  background: rgba(255, 250, 252, .72);
  font: 9px/1.7 var(--serif);
  text-align: center;
}

.diary-entry::before {
  content: "✧";
  position: absolute;
  top: 6px;
  left: 7px;
  color: #bf6f94;
}

.diary-entry time {
  color: #8e7280;
  font-size: 7px;
}

.diary-entry p {
  margin: 3px 0;
  font: 9px/1.55 var(--serif);
}

.memory-mark {
  position: absolute;
  top: 0;
  right: 0;
  border: 0;
  color: #bf6e93;
  background: transparent;
  font-size: 15px;
}

.rei-linked aside {
  margin: 6px 0 0 15px;
  padding: 6px 8px;
  border-left: 2px solid #ca86a5;
  background: #fff0f6;
  font: 8px/1.5 var(--serif);
}

.related-memory {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #946c81;
  font-size: 7px;
}

.related-memory img {
  width: 22px;
  height: 22px;
}

/* A single memory opens as a vellum archive slip above the book. */
body.memory-open { overflow: hidden; }

.memory-reader {
  position: fixed;
  z-index: 260;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
}

.memory-reader[hidden] { display: none; }

.memory-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(27, 18, 23, .72);
  backdrop-filter: blur(4px);
}

.memory-vellum {
  position: relative;
  width: min(670px, calc(100vw - 34px));
  max-height: min(760px, calc(100vh - 44px));
  padding: 28px 38px 54px;
  overflow-y: auto;
  scroll-padding-bottom: 46px;
  border: 6px double #44313b;
  outline: 1px solid #d6aabd;
  outline-offset: -11px;
  color: #3f3037;
  background-color: #fbf1e8;
  background-image:
    linear-gradient(rgba(253, 246, 239, .91), rgba(253, 246, 239, .91)),
    url("assets/materials/pink/pattern_tile_03_01.svg");
  background-size: auto, 142px 110px;
  box-shadow: 0 22px 70px rgba(17, 10, 14, .48), inset 0 0 48px rgba(112, 73, 91, .08);
}

.memory-vellum::before,
.memory-vellum::after {
  content: "";
  position: absolute;
  right: 28px;
  left: 28px;
  height: 15px;
  pointer-events: none;
  background: url("assets/materials/black/border_004.svg") repeat-x center / auto 15px;
  z-index: 0;
  opacity: .72;
}

/* Keep the lace on the vellum edge, never over the archive contents. */
.memory-vellum > * { position: relative; z-index: 1; }
.memory-vellum::before { top: 6px; }
.memory-vellum::after { bottom: 8px; transform: rotate(180deg); }

.vellum-corner { position: absolute; z-index: 2; color: #785266; font: 18px var(--serif); }
.vellum-corner.tl { top: 13px; left: 15px; }
.vellum-corner.tr { top: 13px; right: 15px; }
.vellum-corner.bl { bottom: 13px; left: 15px; }
.vellum-corner.br { right: 15px; bottom: 13px; }

.memory-vellum-header {
  display: grid;
  grid-template-columns: 48px 1fr 34px;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 8px 0 15px;
  border-bottom: 4px double #745363;
}

.memory-vellum-header img { width: 43px; height: 43px; object-fit: contain; }
.memory-vellum-header p { margin: 0 0 4px; color: #966b80; font: 7px var(--pixel); letter-spacing: .12em; }
.memory-vellum-header h2 { margin: 0; font: 24px/1.2 var(--serif); letter-spacing: .1em; }
.memory-vellum-header button { width: 32px; height: 32px; padding: 0; border: 2px double #624653; border-radius: 0; color: #fff8fa; background: #36272f; font: 22px/1 var(--serif); cursor: pointer; }

.memory-vellum-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 15px; }
.memory-vellum-meta span { padding: 4px 7px; border: 1px solid #c09aaa; background: rgba(250, 224, 234, .64); color: #745260; font: 7px var(--pixel); }
.memory-vellum-body { min-height: 100px; padding: 18px 20px; border: 1px solid rgba(107, 73, 89, .27); border-left: 4px double #7b5366; background: rgba(255, 253, 248, .8); font: 15px/1.9 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.memory-vellum-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.memory-vellum-media img,
.memory-vellum-media video { display: block; width: 100%; max-height: 430px; object-fit: contain; border: 4px double #6e4e5d; background: #e9d6de; }
.memory-vellum footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 17px; padding-top: 10px; border-top: 1px dotted #a98596; color: #8c6678; font: 6px var(--pixel); }
.memory-vellum footer b { color: #674654; }

/* Collections */
.collection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.collection-grid figure,
.rei-collection-grid figure {
  margin: 0;
  padding: 7px;
  border: 1px dotted #b991a5;
  background: rgba(255, 253, 251, .86);
  text-align: center;
}

.collection-grid img {
  height: 78px;
  object-fit: contain;
}

.collection-grid figcaption {
  font-size: 7px;
}

.collection-note {
  padding: 8px;
  border: 1px solid rgba(111, 79, 95, .17);
  border-left: 3px double #9b7185;
  background: rgba(255, 251, 250, .88);
}

.collection-note span {
  color: #8c7080;
  font-size: 7px;
}

.collection-note p {
  margin: 3px 0;
  font: 9px/1.55 var(--serif);
}

.rei-collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.rei-collection-grid img {
  max-width: 58px;
  height: 44px;
  object-fit: contain;
}

.rei-collection-grid figcaption {
  display: flex;
  justify-content: space-between;
  font-size: 6px;
}

.item-card {
  width: 72%;
  margin-top: 11px;
  padding: 7px;
  border: 2px double #b88b9f;
  background: rgba(255, 239, 246, .9);
}

.item-card b,
.item-card span,
.item-card em {
  display: block;
}

.item-card b { font-size: 7px; }
.item-card span { font: 10px var(--serif); }
.item-card em { color: #917581; font-size: 6px; }
.item-card p { margin: 5px 0 0; font: italic 8px var(--serif); }

.rei-sort-gif {
  right: 12px;
  bottom: 10px;
  width: 105px;
  max-height: 112px;
}

/* Sky / radio / linked spaces */
.sky-window {
  position: relative;
  height: 224px;
  overflow: hidden;
  border: 3px double #806173;
  background: #29222b;
}

.sky-window > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.74) brightness(1.08);
}

.sky-status {
  position: absolute;
  top: 11px;
  left: 12px;
  display: grid;
  padding: 6px 8px;
  border: 1px solid #a67d91;
  background: rgba(255, 248, 251, .9);
  font-size: 7px;
}

.sky-status b {
  color: #57404e;
  font: 11px var(--serif);
}

.sky-status small { font-size: 6px; }

.plane-gif {
  position: absolute;
  top: 34px;
  right: 25px;
  width: 62px;
}

.receiver-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding: 7px;
  border: 1px dashed #a88194;
  background: rgba(255, 251, 250, .9);
}

.receiver-card div { display: grid; }
.receiver-card b { color: #81546c; font-size: 7px; }
.receiver-card span { font-size: 7px; }

.rei-sky-gif {
  right: 17px;
  bottom: 8px;
  width: 105px;
  max-height: 110px;
}

.radio-set {
  padding: 12px;
  border: 3px double #e3afc5;
  outline: 2px solid #4a3842;
  color: #f9e5ed;
  background-color: #352b33;
  background-image: url("assets/materials/black/pattern_tile_04_01.svg");
  background-size: 94px 67px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .1);
}

.radio-scale {
  display: flex;
  justify-content: space-between;
  padding-bottom: 4px;
  border-bottom: 1px solid #d49ab4;
  color: #d9b4c5;
  font-size: 7px;
}

.radio-set strong {
  display: block;
  margin: 16px 0 9px;
  color: #ffe1ed;
  font: 700 23px var(--pixel);
  text-align: center;
  text-shadow: 0 0 7px #c9789c;
}

.radio-set code {
  display: block;
  color: #eba9c6;
  font-size: 13px;
  text-align: center;
}

.radio-controls {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
}

.radio-controls button { background: #efd0dd; }


.rei-radio-gif {
  right: 20px;
  bottom: 12px;
  width: 100px;
  max-height: 105px;
}

/* v1.4 archive modules */
.module-title-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 4px double #735363; }
.module-title-line h2 { margin: 0; }
.module-title-line p { margin: 4px 0 0; color: #8c6b7b; font: 6px var(--pixel); letter-spacing: .13em; }
.module-title-line > b { flex: 0 0 auto; padding: 4px 6px; border: 1px solid #ab8395; background: rgba(255,249,251,.82); color: #725260; font: 6px var(--pixel); }
.live-gem { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border: 1px solid #956879; background: #f1dfe6; color: #744152; font: 6px var(--pixel); }
.live-gem::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #87576a; }
.live-gem.is-online { border-color: #587363; color: #405c4a; background: #e4ece6; }
.live-gem.is-online::before { background: #52735e; box-shadow: 0 0 6px #78a187; }

.cabinet-door-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.cabinet-door-grid button { position: relative; display: grid; align-content: center; min-height: 112px; padding: 14px 12px 12px 34px; overflow: hidden; border: 4px double #493741; outline: 1px solid #d5a9ba; outline-offset: -7px; color: #fbedf3; background-color: #352830; background-image: linear-gradient(rgba(46,34,41,.88),rgba(46,34,41,.93)),url("assets/materials/black/pattern_tile_01_01.svg"); background-size: auto,74px 74px; text-align: left; cursor: pointer; box-shadow: 3px 3px 0 rgba(204,151,174,.62); }
.cabinet-door-grid button:nth-child(even) { background-image: linear-gradient(rgba(54,40,48,.89),rgba(54,40,48,.94)),url("assets/materials/black/pattern_tile_04_01.svg"); }
.cabinet-door-grid button::after { content: "✠"; position: absolute; right: 9px; bottom: 5px; color: rgba(240,188,209,.24); font: 30px var(--serif); }
.cabinet-door-grid i { position: absolute; top: 8px; bottom: 8px; left: 8px; display: grid; place-items: center; width: 18px; border-right: 1px dotted #b78299; color: #dca9bd; font: 8px var(--pixel); }
.cabinet-door-grid strong { position: relative; z-index: 1; font: 12px/1.35 var(--serif); letter-spacing: .05em; }
.cabinet-door-grid span,.cabinet-door-grid small { position: relative; z-index: 1; display: block; }
.cabinet-door-grid span { margin-top: 5px; color: #d5aabd; font: 5px var(--pixel); letter-spacing: .08em; }
.cabinet-door-grid small { margin-top: 10px; color: #f1dbe4; font: 6px var(--pixel); }
.cabinet-door-grid button.has-relics small { color: #efb6ce; }
.master-collection-page .collection-note { margin-top: 12px; padding: 10px 11px; }

.reliquary-intro { margin: 0 0 10px; padding: 8px 9px; border-left: 3px double #96677c; background: rgba(255,250,249,.83); font: 9px/1.6 var(--serif); }
.reliquary-door-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; }
.reliquary-door-grid button { display: grid; grid-template-columns: 48px 1fr; align-items: center; min-height: 75px; padding: 7px; border: 2px double #947083; background: rgba(255,248,250,.9); color: #47333e; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 3px rgba(233,194,210,.25); }
.reliquary-door-grid button:nth-child(3n+1) { background: rgba(53,40,48,.92); color: #fff1f6; }
.reliquary-door-grid img { width: 44px; height: 48px; object-fit: contain; }
.reliquary-door-grid span { padding-left: 7px; border-left: 1px dotted #b58a9d; font: 9px/1.4 var(--serif); }
.reliquary-door-grid b { display: block; margin-top: 5px; color: #9b7184; font: 6px var(--pixel); }
.reliquary-door-grid button:nth-child(3n+1) b { color: #e2abc2; }
.rei-collection-page .tiny-handnote { margin-top: 10px; }

.sky-console { display: grid; grid-template-columns: 190px 1fr; gap: 10px; align-items: center; padding: 10px; border: 4px double #5c4350; color: #f6e7ee; background: #292129 url("assets/materials/black/pattern_tile_04_01.svg") repeat; background-size: 76px 54px; }
.gothic-radar { position: relative; width: 184px; height: 184px; overflow: hidden; border: 3px double #d7a5bb; border-radius: 50%; background: repeating-radial-gradient(circle,transparent 0 28px,rgba(223,164,190,.28) 29px 30px),linear-gradient(90deg,transparent 49.5%,rgba(226,171,195,.32) 50%,transparent 50.5%),linear-gradient(0deg,transparent 49.5%,rgba(226,171,195,.32) 50%,transparent 50.5%),radial-gradient(circle,#46323e,#1f181d); box-shadow: inset 0 0 20px #110d10,0 0 0 2px rgba(255,244,249,.35); }
.radar-center { position: absolute; z-index: 3; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #f0b7d0; font: 18px var(--serif); text-shadow: 0 0 8px #e99fbe; }
.radar-hand { position: absolute; z-index: 1; top: 50%; left: 50%; width: 46%; height: 1px; transform-origin: left; background: linear-gradient(90deg,#edb0c9,transparent); animation: radarSweep 5s linear infinite; }
@keyframes radarSweep { to { transform: rotate(360deg); } }
.radar-plane { position: absolute; z-index: 2; width: 7px; height: 7px; transform: translate(-50%,-50%); border: 1px solid #fff4f8; border-radius: 50%; background: #e9a9c4; box-shadow: 0 0 8px #f5afcc; }
.sky-metrics { display: grid; gap: 8px; margin: 0; }
.sky-metrics div { padding: 8px 7px; border: 1px solid #9c7184; background: rgba(255,246,250,.09); }
.sky-metrics dt { color: #d9a7bc; font: 5px var(--pixel); letter-spacing: .08em; }
.sky-metrics dd { margin: 4px 0 0; font: 13px var(--serif); }
.aircraft-mini-list { display: grid; margin-top: 9px; border-top: 3px double #6c4d5c; background: rgba(255,251,250,.87); }
.aircraft-mini-list > p { margin: 0; padding: 17px 8px; color: #816a75; font: italic 8px/1.5 var(--serif); text-align: center; }
.aircraft-mini-list button { display: grid; grid-template-columns: 70px 1fr auto; gap: 6px; padding: 6px 8px; border: 0; border-bottom: 1px dotted #b38c9e; color: #4a3641; background: transparent; text-align: left; cursor: pointer; }
.aircraft-mini-list button:last-child { border-bottom: 0; }
.aircraft-mini-list strong { font: 8px var(--pixel); }
.aircraft-mini-list span { overflow: hidden; color: #755b68; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.aircraft-mini-list b { font: 7px var(--pixel); }
.sky-page .receiver-card,.denpa-page .receiver-card { margin-top: 8px; }

.radio-console { overflow: hidden; border: 4px double #e1b0c4; outline: 2px solid #493641; color: #f9e8ef; background: #30252c url("assets/materials/black/pattern_tile_01_01.svg") repeat; background-size: 82px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.08); }
.radio-console-head { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px; padding: 12px 13px 9px; border-bottom: 1px solid #9b7083; }
.radio-console-head span { padding: 3px 5px; border: 1px solid #bc8da1; font: 6px var(--pixel); }
.radio-console-head strong { color: #ffddea; font: 18px var(--pixel); text-align: center; text-shadow: 0 0 8px #dc81a7; }
.radio-console-head small { color: #deb1c3; font: 5px var(--pixel); }
.signal-spectrum { display: flex; align-items: end; justify-content: center; gap: 3px; height: 70px; padding: 9px 14px 7px; border-bottom: 1px dotted #9a6d81; background: linear-gradient(rgba(22,16,20,.62),rgba(22,16,20,.28)); }
.signal-spectrum i { width: min(22px,8%); height: calc(var(--level,1) * 5px); min-height: 4px; background: linear-gradient(#f0aaca,#92556e); box-shadow: 0 0 4px #d785a8; transition: height .3s ease; }
.radio-now { padding: 10px 13px 12px; }
.radio-now b,.radio-now span { display: block; }
.radio-now b { font: 12px var(--serif); }
.radio-now span { margin-top: 3px; color: #dca9be; font: 5px var(--pixel); }
.radio-now p { margin: 7px 0 0; color: #ecd7e0; font: 8px/1.55 var(--serif); }
.radio-log-preview { display: grid; margin-top: 9px; border: 1px solid #a47c8e; background: rgba(255,251,250,.88); }
.radio-log-preview > p { margin: 0; padding: 13px 8px; color: #806a74; font: italic 8px var(--serif); text-align: center; }
.radio-log-preview article { display: grid; grid-template-columns: 68px 1fr; gap: 4px 8px; padding: 7px 9px; border-bottom: 1px dotted #b18b9c; }
.radio-log-preview article:last-child { border-bottom: 0; }
.radio-log-preview time { color: #8f6c7b; font: 5px var(--pixel); }
.radio-log-preview strong { font: 8px var(--pixel); }
.radio-log-preview p { grid-column: 1/-1; margin: 0; overflow: hidden; font: 7.5px/1.45 var(--serif); text-overflow: ellipsis; white-space: nowrap; }

.archive-overlay { position: fixed; z-index: 920; inset: 0; display: grid; place-items: center; padding: 22px; }
.archive-overlay[hidden] { display: none; }
.archive-backdrop { position: absolute; inset: 0; border: 0; background: rgba(30,19,25,.76); backdrop-filter: blur(4px); }
.archive-vault { position: relative; width: min(1120px,calc(100vw - 30px)); height: min(760px,calc(100vh - 34px)); overflow: hidden; border: 6px double #4f3844; outline: 3px solid #d1a1b4; outline-offset: -12px; color: #33262d; background: #f8efe9 url("assets/materials/pink/pattern_tile_01_01.svg") repeat; background-size: 124px; box-shadow: 0 22px 80px rgba(22,13,18,.55); }
.archive-vault::after { content: ""; position: absolute; pointer-events: none; inset: 13px; border: 1px dotted rgba(93,61,77,.35); }
.archive-vault-header { position: relative; z-index: 2; display: grid; grid-template-columns: 46px 1fr 38px; align-items: center; gap: 12px; min-height: 86px; padding: 18px 22px 12px; border-bottom: 4px double #684b59; background: rgba(250,241,236,.93); }
.archive-sigil { display: grid; place-items: center; width: 42px; height: 42px; border: 3px double #765563; font: 24px var(--serif); }
.archive-vault-header p { margin: 0 0 4px; color: #8c6678; font: 7px var(--pixel); letter-spacing: .1em; }
.archive-vault-header h2 { margin: 0; font: 24px var(--serif); letter-spacing: .1em; }
.archive-vault-header > button,.aircraft-vellum > button { width: 34px; height: 34px; border: 3px double #73515f; color: #fff8fa; background: #33242c; font: 21px/1 var(--serif); cursor: pointer; }
.archive-vault-layout { position: relative; z-index: 2; display: grid; grid-template-columns: 230px 1fr; height: calc(100% - 86px); }
.archive-category-nav { padding: 17px 13px; overflow: auto; border-right: 4px double #8f6c7b; background: rgba(48,36,43,.94) url("assets/materials/black/pattern_tile_04_01.svg") repeat; background-size: 78px 56px; }
.archive-category-nav button { display: grid; width: 100%; margin-bottom: 8px; padding: 11px; border: 1px solid #9e7386; color: #f2dfe7; background: rgba(255,255,255,.04); text-align: left; cursor: pointer; }
.archive-category-nav button.is-active { border-color: #e0a7c0; background: rgba(221,151,181,.2); box-shadow: inset 3px 0 #e2abc2; }
.archive-category-nav strong { font: 12px var(--serif); }
.archive-category-nav span { margin-top: 4px; color: #cf9db2; font: 6px var(--pixel); }
.archive-gallery-pane { padding: 22px 24px 28px; overflow: auto; background: linear-gradient(rgba(255,250,247,.82),rgba(255,250,247,.82)),url("assets/materials/pink/pattern_tile_02_02.svg") repeat; background-size: auto,120px; }
.archive-gallery-pane > header { margin-bottom: 16px; padding-bottom: 13px; border-bottom: 3px double #8c6878; }
.archive-gallery-pane > header > p:first-child { margin: 0; color: #956b7e; font: 7px var(--pixel); }
.archive-gallery-pane h3 { margin: 5px 0; font: 24px var(--serif); }
#collectionCabinetDescription { margin: 0; color: #705864; font: 12px/1.65 var(--serif); }
.relic-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 13px; }
.relic-card { padding: 8px; border: 3px double #896879; background: rgba(255,252,249,.92); cursor: pointer; box-shadow: 3px 4px 0 rgba(157,111,131,.18); }
.relic-card img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #e5d2da; }
.relic-card strong { display: block; margin: 8px 0 3px; font: 13px var(--serif); }
.relic-card span { color: #846674; font: 7px var(--pixel); }
.relic-empty { grid-column: 1/-1; padding: 70px 25px; border: 1px dotted #a78292; background: rgba(255,251,248,.75); color: #7c6170; font: 14px/1.8 var(--serif); text-align: center; }
.relic-detail { position: absolute; z-index: 4; inset: 0; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.85fr); gap: 24px; padding: 35px; overflow: auto; background: #f8efea url("assets/materials/pink/pattern_tile_03_02.svg") repeat; background-size: 120px; }
.relic-detail[hidden] { display: none; }
.relic-detail > button { position: absolute; z-index: 2; top: 12px; left: 16px; padding: 6px 10px; border: 1px solid #795867; background: #33252c; color: #fff4f8; cursor: pointer; font: 8px var(--pixel); }
.relic-detail-photos { display: grid; align-content: start; gap: 9px; padding-top: 23px; }
.relic-detail-photos img { width: 100%; max-height: 580px; object-fit: contain; border: 5px double #71505f; background: #e3cfd8; }
.relic-detail > div:last-child { align-self: center; padding: 27px; border: 4px double #795867; background: rgba(255,251,247,.9); }
.relic-detail > div > p:first-child { color: #93697b; font: 7px var(--pixel); }
.relic-detail h3 { margin: 8px 0 12px; font: 25px var(--serif); }
.relic-detail #collectionDetailDescription { white-space: pre-wrap; font: 13px/1.85 var(--serif); }
.relic-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.relic-meta span { padding: 4px 6px; border: 1px solid #b790a1; background: #f2dce5; font: 7px var(--pixel); }
.relic-detail small { display: block; margin-top: 20px; color: #8b6a79; font: 6px var(--pixel); }

.reliquary-vault-body { position: relative; z-index: 2; display: grid; grid-template-rows: auto 1fr; height: calc(100% - 86px); padding: 15px 20px 23px; }
.reliquary-category-tabs { display: flex; gap: 6px; padding-bottom: 12px; overflow-x: auto; }
.reliquary-category-tabs button { flex: 0 0 auto; padding: 7px 11px; border: 2px double #755463; background: #f5dfe8; cursor: pointer; font: 9px var(--serif); }
.reliquary-category-tabs button.is-active { color: #fff3f7; background: #362830; }
.asset-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(145px,1fr)); gap: 9px; align-content: start; overflow: auto; padding-right: 5px; }
.asset-card { min-height: 168px; padding: 8px; border: 1px dotted #a47d8f; background: rgba(255,252,249,.88); }
.asset-card img { display: block; width: 100%; height: 112px; object-fit: contain; background: linear-gradient(45deg,#eedde4 25%,transparent 25%,transparent 75%,#eedde4 75%),linear-gradient(45deg,#eedde4 25%,#fff9f6 25%,#fff9f6 75%,#eedde4 75%); background-position: 0 0,7px 7px; background-size: 14px 14px; }
.asset-card strong { display: block; margin-top: 7px; overflow: hidden; font: 10px var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.asset-card small { display: flex; justify-content: space-between; margin-top: 4px; color: #846774; font: 6px var(--pixel); }
.asset-card .is-used { color: #4f725d; }

.aircraft-vellum { position: relative; width: min(650px,calc(100vw - 28px)); max-height: calc(100vh - 32px); padding: 30px; overflow: auto; border: 6px double #5b414e; outline: 2px solid #d3a3b6; outline-offset: -12px; background: #f8efea url("assets/materials/pink/pattern_tile_04_02.svg") repeat; background-size: 120px 86px; box-shadow: 0 20px 70px rgba(22,13,18,.55); }
.aircraft-vellum > button { position: absolute; top: 17px; right: 17px; }
.aircraft-vellum > p { margin: 0; color: #946a7c; font: 7px var(--pixel); }
.aircraft-vellum h2 { margin: 7px 0 19px; padding-bottom: 10px; border-bottom: 4px double #6e4f5d; font: 27px var(--serif); }
.aircraft-detail-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.aircraft-detail-grid div { padding: 10px; border: 1px solid #af8a9a; background: rgba(255,251,248,.86); }
.aircraft-detail-grid span { display: block; color: #8a6978; font: 6px var(--pixel); }
.aircraft-detail-grid b { display: block; margin-top: 5px; font: 13px var(--serif); }
.aircraft-vellum footer { margin-top: 19px; padding-top: 10px; border-top: 1px dotted #a17c8d; color: #856776; font: 6px var(--pixel); }
body.archive-module-open { overflow: hidden; }

.lost-intro {
  width: 92%;
  margin: 0 auto 9px;
  padding: 6px 9px;
  border-top: 1px solid rgba(94, 65, 79, .44);
  border-bottom: 1px solid rgba(94, 65, 79, .44);
  color: #6d5360;
  background: rgba(255, 253, 251, .78);
  font: 8px/1.55 var(--serif);
  text-align: center;
}

.magic-reliquary {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 7px;
  padding: 15px 7px 9px;
  border: 3px double rgba(86, 58, 71, .82);
  outline: 1px solid rgba(202, 151, 175, .82);
  outline-offset: -7px;
  background-color: rgba(255, 249, 248, .86);
  background-image:
    linear-gradient(rgba(255, 249, 248, .88), rgba(255, 249, 248, .88)),
    url("assets/journal/04_background_tiles/tile_dark_rose_argyle.png");
  background-size: auto, 86px 88px;
  box-shadow: inset 0 0 18px rgba(91, 58, 75, .1), 0 4px 10px rgba(87, 57, 71, .08);
}

.magic-reliquary::before {
  content: "✦　✠　✦　✠　✦";
  position: absolute;
  top: 1px;
  left: 50%;
  padding: 0 7px;
  color: #7f5a6c;
  background: #faeef2;
  font: 7px/1 var(--serif);
  letter-spacing: .13em;
  transform: translateX(-50%);
  white-space: nowrap;
}

.magic-shrine {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: 0 4px 7px;
  border-right: 1px dotted rgba(117, 78, 97, .52);
  color: #4d3944;
  text-align: center;
  text-decoration: none;
}

.magic-shrine:last-child { border-right: 0; }
.magic-shrine:hover { color: #7b405c; text-decoration: none; }
.magic-shrine.is-unbound { cursor: not-allowed; }

.shrine-candle {
  position: relative;
  z-index: 4;
  display: block;
  width: 18px;
  height: 5px;
  margin: 0 auto -1px;
  border: 1px solid #65505a;
  border-radius: 50%;
  background: #5a5055;
  box-shadow: 0 2px 0 #30262b;
}

.shrine-candle::before {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 6px;
  width: 5px;
  height: 11px;
  border-radius: 70% 30% 60% 40%;
  background: #777075;
  transform: rotate(8deg);
  transform-origin: 50% 100%;
}

.magic-shrine.is-configured .shrine-candle {
  border-color: #bf809d;
  background: #f4c0d6;
  box-shadow: 0 0 8px #e9a3c1, 0 0 17px rgba(224, 129, 171, .65);
}

.magic-shrine.is-configured .shrine-candle::before {
  background: #ffd8e8;
  box-shadow: 0 0 7px #e588b1, 0 0 15px #f6aecb;
  animation: sealedFlame 1.55s ease-in-out infinite alternate;
}

.shrine-arch {
  position: relative;
  display: block;
  width: min(100%, 124px);
  aspect-ratio: 188 / 270;
  overflow: hidden;
}

.shrine-frame {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.shrine-collage {
  position: absolute;
  z-index: 2;
  top: 18%;
  right: 19%;
  bottom: 18%;
  left: 19%;
  overflow: hidden;
  border-radius: 46% 46% 3px 3px;
  background-color: #f4e5e9;
  background-image:
    linear-gradient(rgba(255, 249, 248, .48), rgba(255, 249, 248, .48)),
    url("assets/journal/04_background_tiles/tile_pale_lace_cross.png");
  background-size: auto, 72px 74px;
  box-shadow: inset 0 0 15px rgba(50, 34, 42, .22);
}

.shrine-collage img { position: absolute; object-fit: contain; }
.shrine-film { top: 26%; left: -22%; width: 145%; transform: rotate(-7deg); }
.shrine-rose { right: -4%; bottom: -11%; width: 48%; transform: rotate(8deg); }
.shrine-disc { top: 15%; left: 4%; width: 92%; filter: saturate(.76); }
.shrine-star { right: -5%; bottom: -19%; width: 51%; opacity: .64; transform: rotate(9deg); }
.shrine-navidrome .shrine-collage::after {
  content: "♫　✦";
  position: absolute;
  z-index: 2;
  top: 9%;
  right: 5%;
  color: #805a6d;
  font: 12px/1 var(--serif);
  text-shadow: 0 0 5px #fff4f8;
  transform: rotate(9deg);
}
.shrine-cross { top: 12%; left: 13%; width: 64%; opacity: .86; }
.shrine-key { right: 10%; bottom: 11%; width: 34%; transform: rotate(19deg); }

.archive-slip {
  position: absolute;
  bottom: 17%;
  left: 7%;
  padding: 3px 4px;
  border: 1px solid #8e687a;
  color: #694d5a;
  background: rgba(255, 248, 242, .88);
  font: 5px/1.3 var(--pixel);
  letter-spacing: .06em;
  transform: rotate(-7deg);
}

.shrine-wax {
  position: absolute;
  z-index: 5;
  right: 10%;
  bottom: 9%;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 3px double #887982;
  border-radius: 48% 52% 44% 55%;
  color: #d8cbd1;
  background: #50464b;
  box-shadow: 0 2px 5px rgba(41, 27, 34, .34);
  font: 12px/1 var(--serif);
  transform: rotate(-9deg);
}

.magic-shrine.is-configured .shrine-wax {
  border-color: #d493af;
  color: #fff4f8;
  background: #a45476;
  box-shadow: 0 0 8px rgba(198, 91, 137, .42);
}

.shrine-copy {
  display: flex;
  min-width: 0;
  width: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  margin-top: -3px;
}

.shrine-copy small {
  max-width: 100%;
  overflow: hidden;
  color: #9b6b80;
  font: 5px/1.2 var(--pixel);
  letter-spacing: .11em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shrine-copy b {
  display: block;
  margin: 2px 0;
  font: 700 11px/1.15 var(--gothic-title);
  letter-spacing: .08em;
}

.shrine-copy > span {
  min-height: 24px;
  color: #715966;
  font: 7px/1.45 var(--notebook-hand);
}

.shrine-copy em {
  display: block;
  width: calc(100% - 4px);
  margin-top: auto;
  padding: 4px 2px;
  border-top: 1px solid #8e6a7b;
  border-bottom: 1px solid #8e6a7b;
  color: #6d6267;
  background: rgba(74, 63, 68, .08);
  font: normal 5px/1 var(--pixel);
  letter-spacing: .06em;
}

.magic-shrine.is-configured .shrine-copy em {
  color: #8d3e61;
  background: rgba(240, 181, 207, .36);
}

@keyframes sealedFlame {
  from { transform: rotate(5deg) scale(.94); }
  to { transform: rotate(-5deg) scale(1.08); }
}

.last-known {
  margin-top: 9px;
  padding-top: 6px;
  border-top: 1px dotted #c7a7b6;
  font-size: 7px;
  text-align: center;
}

.last-known b { color: #617b65; }
.last-known.is-unbound b { color: #966074; }
.sealed-auth-link { display: block; margin: 7px auto 0; color: #704457; font: 7px var(--pixel); letter-spacing: .05em; text-align: center; text-decoration: none; }
.sealed-auth-link:hover { color: #a34e72; text-decoration: underline; }

/* Local dark devices are the exception inside the light notebook. */
.ai-reliquary {
  padding: 10px;
  border: 3px double #daa7be;
  outline: 2px solid #43333c;
  color: #f9e8ef;
  background: #342b33;
}

.ai-header {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  padding-bottom: 5px;
  border-bottom: 1px dotted #c389a4;
  font-size: 7px;
}

.ai-header img { width: 26px; }
.ai-header b { color: #dba8bd; font-size: 6px; }

.ai-log {
  height: 215px;
  margin: 8px 0;
  padding: 9px;
  overflow: auto;
  border: 1px solid #6e5663;
  color: #f8e7ee;
  background: #231e23;
  font: 8px/1.6 var(--pixel);
}

.ai-log p { margin: 0 0 8px; }
.ai-log b { color: #efaeca; }
.ai-reliquary form { display: grid; grid-template-columns: 1fr 48px; }
.ai-reliquary input { padding: 5px; border: 1px solid #8c687b; background: #fff8fa; }
.ai-reliquary button { border: 1px outset #c9a5b6; background: #edcddd; }

.rei-glitch-gif {
  right: 17px;
  bottom: 15px;
  width: 82px;
  opacity: .75;
}

/* Status / BBS / friends / badges */
.status-page .status-observation {
  position: relative;
  margin: 7px 0 0;
  padding: 12px 13px 13px;
  border: 4px double #443039;
  outline: 1px solid rgba(185, 129, 154, .44);
  outline-offset: -8px;
  background:
    linear-gradient(rgba(255, 251, 248, .91), rgba(255, 251, 248, .91)),
    url("assets/materials/pink/pattern_tile_03_01.svg") repeat;
  background-size: auto, 118px 96px;
  box-shadow: 3px 4px 0 rgba(64, 43, 53, .09);
}

.status-page .status-observation::before,
.status-page .status-observation::after {
  content: "";
  position: absolute;
  right: 13px;
  left: 13px;
  height: 9px;
  pointer-events: none;
  background: url("assets/materials/black/border_004.svg") repeat-x center / auto 9px;
  opacity: .52;
}

.status-page .status-observation::before { top: 2px; }
.status-page .status-observation::after { bottom: 2px; transform: rotate(180deg); }
.status-page .status-observation > * { position: relative; z-index: 1; }

.status-page .status-observation-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 3px 8px;
  border-bottom: 3px double #725160;
}

.status-page .status-observation-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-page .status-observation-title img {
  width: 38px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}

.status-page .status-observation-title span { display: grid; gap: 2px; }
.status-page .status-observation-title small { color: #9a7083; font: 5.5px/1.25 var(--pixel); letter-spacing: .08em; }
.status-page .status-observation-title b { color: #46343c; font: 14px/1.1 var(--serif); letter-spacing: .12em; }

.status-page .status-public-stamp {
  display: grid;
  place-items: center;
  min-width: 43px;
  min-height: 34px;
  padding: 3px 5px;
  border: 2px solid #7e4f64;
  color: #7e4f64;
  background: rgba(247, 215, 228, .58);
  font: 5.5px/1.18 var(--pixel);
  letter-spacing: .08em;
  text-align: center;
  transform: rotate(2deg);
}

.status-page .status-preface {
  margin: 7px 1px 8px;
  padding: 0 4px 6px;
  border-bottom: 1px dotted #c4a2b1;
  color: #67535c;
  font: 8px/1.55 var(--serif);
}

.status-page .status-ledger {
  display: grid;
  gap: 3px;
}

.status-page .status-ledger > div {
  display: grid;
  grid-template-columns: 19px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 4px 6px 4px 3px;
  border: 1px solid rgba(94, 65, 78, .18);
  border-left: 3px double #725160;
  background: rgba(255, 253, 249, .82);
}

.status-page .status-ledger > div:nth-child(even) { background: rgba(250, 228, 237, .62); }
.status-page .status-index { color: #9b7083; font: 5.5px var(--pixel); text-align: center; }

.status-page .status-ledger img {
  width: 30px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}

.status-page .status-copy { display: grid; min-width: 0; gap: 1px; }
.status-page .status-copy b { overflow: hidden; color: #45343c; font: 7px/1.3 var(--pixel); letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.status-page .status-copy small { overflow: hidden; color: #8f7482; font: 6.5px/1.3 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.status-page .status-ledger .ok { padding: 3px 4px; border-bottom: 1px solid currentColor; color: #58725e; font: 5.5px/1 var(--pixel); letter-spacing: .04em; white-space: nowrap; }

.status-page .telemetry-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 4px;
  color: #8d6879;
  font: 5px/1 var(--pixel);
  letter-spacing: .07em;
}
.status-page .telemetry-label i { flex: 1; border-top: 1px dotted #a98596; }

.status-page .telemetry-paper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 5px;
  border: 1px solid #ad8798;
  border-top: 3px double #725160;
  background: rgba(255, 239, 245, .82);
}

.status-page .telemetry-paper > div {
  display: grid;
  min-width: 0;
  padding: 5px 4px;
  border-right: 1px dotted #bea0ae;
  text-align: center;
}
.status-page .telemetry-paper > div:last-child { border-right: 0; }
.status-page .telemetry-paper span { color: #8e6b7b; font: 5px var(--pixel); }
.status-page .telemetry-paper b { margin: 2px 0; color: #47353e; font: 10px/1 var(--serif); }
.status-page .telemetry-paper small { color: #947787; font: 5.5px var(--serif); }

.status-page .status-footnotes {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(118px, .65fr);
  gap: 6px;
  margin-top: 7px;
  padding-bottom: 3px;
}

.status-page .world-note {
  margin: 0;
  padding: 6px 7px;
  border-left: 3px double #9b7084;
  background: rgba(255, 246, 248, .84);
  color: #5f4c55;
  font: italic 6.5px/1.45 var(--serif);
}

.status-page .status-rei-note {
  padding: 5px 7px;
  border: 1px dotted #bd98aa;
  background: rgba(247, 218, 230, .58);
  transform: rotate(-.35deg);
}
.status-page .status-rei-note small { color: #9b6e82; font: 5px var(--pixel); letter-spacing: .08em; }
.status-page .status-rei-note p { margin: 2px 0 0; color: #614b56; font: 6.5px/1.35 var(--serif); }

.status-page .tiny-server-gif {
  position: absolute;
  right: 18px;
  bottom: 17px;
  width: 58px;
  opacity: .82;
  filter: saturate(.72) contrast(.96);
}

.bbs-board {
  border-top: 2px double #9c7589;
  border-bottom: 2px double #9c7589;
  background: rgba(255, 253, 251, .8);
}

.bbs-board article {
  padding: 7px 8px;
  border-bottom: 1px dotted #ceb2bf;
}

.bbs-board header { color: #8e7280; font-size: 6.5px; }
.bbs-board p { margin: 3px 0; font: 9px/1.55 var(--serif); }

.bbs-form {
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed #ae8498;
  background: #fff0f6;
}

.bbs-form label {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: start;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 7px;
}

.bbs-form input,
.bbs-form textarea {
  padding: 4px;
  border: 1px solid #ad8598;
  background: #fff;
}

.bbs-form textarea { height: 58px; }
.bbs-pages { margin-top: 8px; font-size: 7px; text-align: center; }

.friend-garden {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.friend-garden a {
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: 105px 1fr;
  gap: 1px 9px;
  padding: 7px;
  border: 1px solid rgba(111, 79, 95, .15);
  border-bottom: 1px dotted #bfa0af;
  color: #59434f;
  background: rgba(255, 253, 251, .86);
}

.friend-garden b { font: 10px var(--serif); }
.friend-garden small { color: #907481; font-size: 7px; }

.site-badge {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 100px;
  height: 31px;
  border: 2px outset #8e697b;
  background: #fff0f6;
  font: 7px var(--pixel);
}

.site-badge.pink { background: #e9bcd0; }
.site-badge.dark { color: #fae5ed; background: #40323a; }

.friend-cage {
  position: absolute;
  right: 19px;
  bottom: 15px;
  width: 74px;
  opacity: .6;
}

.site-badges {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.site-badges figure {
  margin: 0;
  padding: 5px;
  border: 1px dotted #b98fa3;
  background: rgba(255, 253, 251, .88);
}

.site-badges img {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: contain;
}

.site-badges figcaption {
  color: #8f7180;
  font-size: 6px;
  text-align: center;
}

.mini-badge-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 9px 0;
}

.mini-badge-wall img,
.mini-badge-wall span { height: 26px; }
.mini-badge-wall img { width: auto; }

.mini-badge-wall span {
  display: grid;
  place-items: center;
  min-width: 55px;
  padding: 0 5px;
  border: 2px outset #a97c91;
  color: #44333c;
  background: #edc5d7;
  font-size: 6px;
}

.copy-status {
  margin-left: 6px;
  color: #805c6f;
  font-size: 7px;
}

/* Goodbye / back cover */
.goodbye-inner {
  padding-top: 46px;
  text-align: center;
}

.goodbye-cross {
  width: 70px;
  height: 100px;
  object-fit: contain;
}

.goodbye-copy {
  width: 78%;
  margin: 15px auto;
  padding: 12px;
  border-top: 2px double #a98295;
  border-bottom: 2px double #a98295;
  background: rgba(255, 253, 251, .82);
  font: 10px/1.7 var(--serif);
}

.goodbye-copy p { margin: 0; }
.goodbye-copy blockquote { margin: 8px 0 0; color: #825b71; font-style: italic; }

.rei-sleep-gif {
  right: 18px;
  bottom: 12px;
  width: 95px;
  max-height: 100px;
}

.back-cover-page {
  border: 2px solid #4a3741;
  outline: 4px double #f5d5e2;
  background: #e6c3d2;
}

.back-cover-inner {
  display: grid;
  place-items: center;
  text-align: center;
  background-color: #e9c8d6;
  background-image:
    linear-gradient(rgba(255, 246, 249, .28), rgba(255, 246, 249, .12)),
    url("assets/materials/pink/pattern_tile_01_05.svg"),
    repeating-linear-gradient(90deg, rgba(47, 35, 42, .1) 0 38px, rgba(242, 192, 213, .3) 38px 88px, rgba(255, 255, 255, .08) 88px 128px);
  background-repeat: repeat;
  background-size: auto, 156px 156px, 100% 100%;
}

.back-cover-inner::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 3px double #513b47;
  pointer-events: none;
}

.back-cover-stamp {
  padding: 8px 14px;
  transform: rotate(-2deg);
  border: 2px double #8c6678;
  color: #4c3742;
  background: #fff2f7;
  font: 700 16px var(--gothic);
}

.back-sticker-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  width: 70%;
  margin-top: -80px;
}

.back-sticker-wall span {
  padding: 4px 7px;
  border: 2px outset #9f7488;
  background: #f7dce7;
  font-size: 6px;
}

.back-cover-credit {
  display: grid;
  gap: 5px;
  width: min(330px, 82%);
  margin: 30px auto 0;
  padding: 10px 14px;
  color: #f8e9ef;
  border: 1px solid rgba(248, 233, 239, .72);
  outline: 1px solid rgba(248, 233, 239, .28);
  outline-offset: 3px;
  background: rgba(23, 16, 20, .46);
  text-align: center;
  letter-spacing: .04em;
}

.back-cover-credit strong {
  color: #f1bfd3;
  font-weight: 700;
}

.back-rose {
  position: absolute;
  bottom: 35px;
  left: 30px;
  width: 90px;
  opacity: .7;
}

.back-rei {
  position: absolute;
  right: 25px;
  bottom: 30px;
  width: 110px;
  max-height: 115px;
  object-fit: contain;
}

.back-cover-inner p {
  position: absolute;
  bottom: 70px;
  font: 8px var(--serif);
}

.back-cover-inner small {
  position: absolute;
  bottom: 48px;
  color: #806b76;
  font-size: 6px;
}

/* Page controls */
.book-controls {
  display: grid;
  grid-template-columns: 155px 1fr 155px;
  align-items: center;
  gap: 10px;
  width: min(var(--book-w), 100%);
  margin: 0 auto;
  padding: 7px 14px;
  border-top: 1px dotted #aa8295;
  background: rgba(255, 250, 250, .84);
}

.book-controls button {
  padding: 7px 10px;
  border: 2px outset #9e7488;
  background: #fff1f6;
  font-size: 8px;
}

.book-controls button:disabled,
.mobile-controls button:disabled {
  opacity: .34;
}

.book-controls div { text-align: center; }
.book-controls span { display: block; font: 8px var(--pixel); letter-spacing: .1em; }
.book-controls small { color: #907783; font-size: 6px; }

/* Gothic physical chapter ribbons attached to the right edge of the book. */
.chapter-tabs {
  position: absolute;
  top: 48px;
  right: -94px;
  z-index: 300;
  display: grid;
  gap: 3px;
  overflow: visible;
}

.chapter-tabs button {
  position: relative;
  width: 120px;
  height: 30px;
  padding: 0 19px 0 26px;
  overflow: visible;
  border: 2px double #21191d;
  border-left: 5px solid #21191d;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  color: #fff4f8;
  background-color: #34282f;
  background-image:
    linear-gradient(rgba(47, 35, 42, .78), rgba(47, 35, 42, .78)),
    url("assets/materials/black/pattern_tile_04_01.svg");
  background-size: auto, 40px 29px;
  box-shadow: 4px 3px #dda8be, inset 0 0 0 2px rgba(255, 255, 255, .13);
  font-size: 7px;
  text-align: left;
  filter: drop-shadow(1px 1px rgba(255, 255, 255, .65));
  transition: transform .16s steps(2, end), filter .16s;
}

.chapter-tabs button::before {
  content: "✞";
  position: absolute;
  top: 50%;
  left: 8px;
  color: #efbad0;
  font-size: 11px;
  text-shadow: 1px 1px #1d1519;
  transform: translateY(-53%);
}

.chapter-tabs button::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 19px;
  border-left: 1px dotted rgba(255, 244, 248, .45);
}

.chapter-tabs button:nth-child(even) {
  border-color: #3c2d35;
  color: #34272e;
  background-color: #efc6d7;
  background-image:
    linear-gradient(rgba(246, 216, 228, .83), rgba(246, 216, 228, .83)),
    url("assets/materials/black/pattern_tile_01_01.svg");
  box-shadow: 4px 3px #34282f, inset 0 0 0 2px rgba(255, 255, 255, .55);
}

.chapter-tabs button:nth-child(even)::before {
  color: #4e3743;
  text-shadow: none;
}

.chapter-tabs button:nth-child(3n + 1) { transform: rotate(.35deg); }
.chapter-tabs button:nth-child(3n + 2) { transform: rotate(-.45deg); }

.chapter-tabs button:hover,
.chapter-tabs button.active {
  z-index: 4;
  transform: translateX(13px);
  filter: brightness(1.1) drop-shadow(2px 2px #382a31);
}

.chapter-tabs span {
  position: relative;
  z-index: 2;
  font-weight: 700;
  font-family: var(--serif);
  letter-spacing: .04em;
  white-space: nowrap;
}

.reader-frame.book-closed .chapter-tabs,
.reader-frame.book-closed .book-controls,
body.notebook-closed .site-header,
body.notebook-closed .web-strip {
  display: none;
}

body.notebook-closed .site-shell {
  padding-top: 118px;
}

.site-footer {
  width: min(820px, 92vw);
  margin: 15px auto 0;
  color: #806a76;
  text-align: center;
}

.site-footer img {
  width: 100%;
  height: 27px;
  object-fit: fill;
  opacity: .55;
}

.site-footer p {
  margin: 2px 0;
  font-size: 6.5px;
  letter-spacing: .12em;
}

@keyframes twinkle {
  50% { opacity: .25; transform: scale(.88); }
}

@keyframes mobileTurnNext {
  0% { transform: perspective(1000px) rotateY(0); opacity: 1; }
  45% { transform: perspective(1000px) rotateY(-12deg) translateX(-10px); opacity: .55; }
  100% { transform: perspective(1000px) rotateY(0); opacity: 1; }
}

@keyframes mobileTurnPrev {
  0% { transform: perspective(1000px) rotateY(0); opacity: 1; }
  45% { transform: perspective(1000px) rotateY(12deg) translateX(10px); opacity: .55; }
  100% { transform: perspective(1000px) rotateY(0); opacity: 1; }
}

.mobile-page.turn-forward { animation: mobileTurnNext .48s ease; }
.mobile-page.turn-back { animation: mobileTurnPrev .48s ease; }

@media (max-width: 1120px) and (min-width: 821px) {
  :root {
    --book-w: 900px;
    --book-h: 590px;
    --page-w: 450px;
    --page-h: 590px;
  }

  .reader-frame {
    width: min(1035px, calc(100vw - 28px));
    padding-right: 47px;
    padding-left: 47px;
  }

  .reader-frame.book-closed {
    width: min(720px, calc(100vw - 28px));
  }

  .book-scene { height: 624px; }
  .page-inner { padding: 31px 28px 25px; }
  .chapter-tabs { right: -87px; }
  .chapter-tabs button { width: 111px; height: 28px; }
}

@media (max-width: 820px) {
  .memory-reader { padding: 12px; }

  .memory-vellum {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 20px);
    padding: 24px 20px 50px;
    border-width: 4px;
    outline-offset: -8px;
  }

  .memory-vellum-header {
    grid-template-columns: 39px 1fr 31px;
    gap: 8px;
    padding-top: 4px;
  }

  .memory-vellum-header img { width: 35px; height: 35px; }
  .memory-vellum-header h2 { font-size: 19px; }
  .memory-vellum-header button { width: 29px; height: 29px; }
  .memory-vellum-body { padding: 14px; font-size: 13px; line-height: 1.8; }
  .memory-vellum-media { grid-template-columns: 1fr; }
  .memory-vellum footer { display: grid; }

  body {
    background-size: auto, 112px 111px, 174px 124px;
  }

  body::after {
    inset: 4px;
    border-width: 2px;
  }

  .ceiling {
    height: 60px;
  }

  .ceiling-lace-band {
    height: 43px;
    background-size: auto 40px;
  }

  .ceiling-chain-band {
    top: 31px;
    height: 29px;
    background-size: auto 27px;
  }

  .ceiling-rose {
    display: none;
  }

  .site-shell,
  body.notebook-closed .site-shell {
    width: 100%;
    padding: 67px 5px 22px;
  }

  .site-header {
    grid-template-columns: 38px 1fr 38px;
    width: 95vw;
    min-height: 58px;
    margin-bottom: 4px;
  }

  .header-ornament img {
    max-width: 28px;
    max-height: 32px;
  }

  .site-title-wrap { padding: 5px; }
  .site-title-wrap h1 { font-size: 19px; }
  .eyebrow { font-size: 5px; }
  .jp-title { font-size: 8.5px; }
  .motto { font-size: 6px; }
  .web-strip { margin-bottom: 8px; }

  .reader-frame,
  .reader-frame.book-closed {
    width: calc(100vw - 12px);
    padding: 43px 5px 12px;
    border-width: 1px;
    outline-width: 2px;
  }

  .reader-frame::before,
  .reader-frame::after {
    right: 8px;
    left: 8px;
    height: 10px;
    background-size: auto 10px;
  }

  .reader-frame::before { top: 3px; }
  .reader-frame::after { bottom: 3px; }

  .frame-gothic-ornament,
  .frame-corner,
  .desktop-reader,
  .desktop-tabs {
    display: none;
  }

  .mobile-reader,
  .mobile-tab-strip {
    display: block;
  }

  .mobile-tab-strip {
    position: absolute;
    top: 6px;
    right: 5px;
    left: 5px;
    height: 31px;
    padding: 2px 2px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px dotted #ad8799;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .mobile-tab-strip::-webkit-scrollbar { display: none; }

  .mobile-tab-strip button {
    position: relative;
    min-width: 72px;
    height: 25px;
    margin-right: 3px;
    padding: 0 9px 0 16px;
    border: 2px double #271d22;
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
    color: #fff6f9;
    background-color: #352830;
    background-image: linear-gradient(rgba(51, 38, 46, .82), rgba(51, 38, 46, .82)), url("assets/materials/black/pattern_tile_04_01.svg");
    background-size: auto, 34px 25px;
    box-shadow: 2px 2px #dda9bf;
    font: 700 7.2px var(--serif);
  }

  .mobile-tab-strip button::before {
    content: "✞";
    position: absolute;
    left: 5px;
    color: #e9b5cb;
  }

  .mobile-tab-strip button:nth-child(even) {
    border-color: #3e2f37;
    color: #372a31;
    background-color: #ecc2d4;
    background-image: linear-gradient(rgba(244, 212, 224, .84), rgba(244, 212, 224, .84)), url("assets/materials/black/pattern_tile_01_01.svg");
    box-shadow: 2px 2px #382a31;
  }

  .reader-frame.mobile-cover .mobile-tab-strip {
    display: none;
  }

  .reader-frame.mobile-cover .mobile-controls,
  .reader-frame.mobile-cover .mobile-hint {
    display: none;
  }

  .reader-frame.mobile-cover {
    padding-top: 12px;
  }

  .mobile-book-shell {
    width: min(calc(100vw - 24px), 520px);
    margin: 0 auto;
    padding: 7px;
    border: 2px solid #58434e;
    outline: 3px double #f1c8d9;
    background: #e4c1d0;
    box-shadow: 0 8px 18px rgba(72, 49, 61, .18);
  }

  .mobile-page {
    min-height: 0;
    overflow: hidden;
    border: 1px solid #77606b;
    background: #fffaf7;
    transform-origin: center left;
  }

  .mobile-page > .page-inner {
    min-height: 650px !important;
    height: auto !important;
    padding: 24px 20px 26px;
    overflow: hidden;
    background-attachment: initial;
  }

  .mobile-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    width: min(calc(100vw - 24px), 520px);
    margin: 9px auto 0;
  }

  .mobile-controls button {
    padding: 8px 5px;
    border: 2px outset #986e82;
    background: #fff1f6;
    font-size: 7px;
  }

  .mobile-controls span {
    font-size: 7px;
    text-align: center;
  }

  .mobile-hint {
    margin: 5px 0 0;
    color: #856b79;
    font-size: 6.5px;
    text-align: center;
  }

  .mobile-page h2 {
    margin-bottom: 11px;
    font-size: 19px;
  }

  .mobile-page .cover-inner {
    min-height: 690px !important;
    padding: 21px 15px;
  }

  .mobile-page .cover-copy {
    width: min(286px, 78vw);
    margin-top: 74px;
    padding: 14px 8px 12px;
  }

  .mobile-page .cover-copy strong { font-size: 23px; }
  .mobile-page .cover-rei { right: 9px; bottom: 25px; width: 98px; }
  .mobile-page .cover-lace-top { left: 30px; width: calc(100% - 60px); }
  .mobile-page .cover-lace-bottom { right: 38px; left: 38px; width: calc(100% - 76px); }
  .mobile-page .cover-corner { width: 70px; height: 88px; }
  .mobile-page .cover-corner-left { left: 7px; }
  .mobile-page .cover-corner-right { right: 7px; }
  .mobile-page .cover-cathedral { top: 54px; width: 225px; height: 275px; }
  .mobile-page .cover-reliquary { top: 72px; width: 72px; height: 104px; }
  .mobile-page .cover-reliquary::before { right: 67px; width: 38px; }
  .mobile-page .cover-reliquary::after { left: 67px; width: 38px; }
  .mobile-page .cover-reliquary img { width: 48px; height: 78px; }
  .mobile-page .cover-key { bottom: 35px; left: 26px; width: 28px; height: 58px; }
  .mobile-page .visitor-counter { bottom: 78px; }
  .mobile-page .cover-inner > .web-button { bottom: 44px; }
  .mobile-page .cover-note { bottom: 17px; }
  .mobile-page .commission-inner,
  .mobile-page .goodbye-inner { min-height: 650px !important; }

  .portrait-collage { grid-template-columns: 1fr 122px; }
  .rei-frame { height: 192px; }
  .rei-frame > img:first-child { width: 124px; height: 188px; }
  .rei-avatar { width: 86px; }
  .page-material-sticker { opacity: .3; }
  .site-badges img { height: 66px; }
  .ai-log { height: 185px; }
}

@media (max-width: 430px) {
  .site-header {
    grid-template-columns: 1fr;
    width: 96vw;
  }

  .header-ornament { display: none; }
  .site-title-wrap h1 { font-size: 19px; }
  .eyebrow { font-size: 5.5px; }

  .mobile-page > .page-inner {
    min-height: 620px !important;
    padding: 21px 16px 24px;
  }

  .mobile-page .cover-inner { min-height: 650px !important; }
  .mobile-page .commission-inner,
  .mobile-page .goodbye-inner { min-height: 620px !important; }
  .mobile-page .cover-copy { width: min(264px, 76vw); }
  .mobile-page .cover-copy strong { font-size: 21px; }
  .mobile-page .cover-rei { width: 82px; }
  .mobile-page .cover-corner { width: 62px; }
  .mobile-page .cover-cathedral { width: 205px; }

  .portrait-collage {
    grid-template-columns: 1fr 94px;
    gap: 7px;
  }

  .portrait-copy { padding: 8px; font-size: 8px; }
  .rei-frame { height: 154px; }
  .rei-frame > img:first-child { width: 96px; height: 151px; }
  .rei-avatar { width: 70px; }
  .journal-index { gap: 4px; }
  .journal-index button { min-height: 26px; padding: 4px; }
  .collection-grid img { height: 58px; }
  .rei-collection-grid img { height: 36px; }
  .status-page .status-observation { padding: 11px 9px 12px; }
  .status-page .status-observation-title b { font-size: 12px; }
  .status-page .status-ledger > div { grid-template-columns: 17px 29px minmax(0, 1fr) auto; gap: 4px; }
  .status-page .status-ledger img { width: 27px; height: 25px; }
  .status-page .status-footnotes { grid-template-columns: 1fr; }
  .status-page .telemetry-paper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-page .telemetry-paper > div:nth-child(2) { border-right: 0; }
  .status-page .telemetry-paper > div:nth-child(-n+2) { border-bottom: 1px dotted #bea0ae; }
  .status-page .tiny-server-gif { width: 48px; right: 13px; bottom: 13px; }
  .sky-window { height: 192px; }
  .site-badges img { height: 56px; }
  .sealed-paper { min-height: 1080px !important; }
  .sealed-paper .lost-intro { width: 100%; margin-bottom: 14px; font-size: 10px; }
  .sealed-paper .magic-reliquary { grid-template-columns: 1fr; gap: 13px; padding: 20px 14px 15px; }
  .sealed-paper .magic-shrine { display: grid; grid-template-columns: minmax(132px, 42%) 1fr; grid-template-rows: auto 1fr; column-gap: 12px; min-height: 276px; padding: 0 6px 12px; border-right: 0; border-bottom: 1px dotted rgba(117, 78, 97, .52); }
  .sealed-paper .magic-shrine:last-child { border-bottom: 0; }
  .sealed-paper .shrine-candle { grid-column: 1; grid-row: 1; }
  .sealed-paper .shrine-arch { grid-column: 1; grid-row: 1 / 3; align-self: start; width: 142px; max-width: 100%; }
  .sealed-paper .shrine-copy { grid-column: 2; grid-row: 1 / 3; align-self: center; justify-content: center; min-height: 162px; margin: 0; padding: 12px 0; }
  .sealed-paper .shrine-copy small { font-size: 6px; }
  .sealed-paper .shrine-copy b { margin: 5px 0; font-size: 15px; }
  .sealed-paper .shrine-copy > span { min-height: 38px; font-size: 10px; }
  .sealed-paper .shrine-copy em { margin-top: 13px; padding: 6px 3px; font-size: 6px; }
  .goodbye-inner { padding-top: 34px; }
}

@media (max-width: 820px) {
  .archive-overlay { padding: 7px; }
  .archive-vault { width: calc(100vw - 12px); height: calc(100vh - 14px); border-width: 4px; outline-offset: -8px; }
  .archive-vault-header { grid-template-columns: 38px 1fr 32px; min-height: 70px; padding: 12px 14px 9px; }
  .archive-sigil { width: 34px; height: 34px; font-size: 19px; }
  .archive-vault-header h2 { font-size: 18px; }
  .archive-vault-header > button { width: 30px; height: 30px; }
  .archive-vault-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: calc(100% - 70px); }
  .archive-category-nav { display: flex; gap: 5px; padding: 9px 10px; overflow-x: auto; border-right: 0; border-bottom: 3px double #8f6c7b; }
  .archive-category-nav button { width: auto; min-width: 138px; margin: 0; padding: 8px; }
  .archive-gallery-pane { padding: 14px 13px 20px; }
  .archive-gallery-pane h3 { font-size: 19px; }
  .relic-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .relic-detail { grid-template-columns: 1fr; gap: 12px; padding: 42px 16px 20px; }
  .relic-detail-photos img { max-height: 45vh; }
  .relic-detail > div:last-child { padding: 17px; }
  .reliquary-vault-body { height: calc(100% - 70px); padding: 10px 11px 16px; }
  .asset-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .asset-card { min-height: 144px; }
  .asset-card img { height: 90px; }
  .aircraft-vellum { padding: 24px 19px; }
  .aircraft-detail-grid { grid-template-columns: repeat(2,1fr); }

  .mobile-page .master-facts section {
    display: block;
    min-height: 43px;
    text-align: center;
  }

  .mobile-page .master-facts span {
    display: grid;
    height: 18px;
    border-right: 0;
    border-bottom: 1px dotted #ba8da2;
  }

  .mobile-page .master-facts b {
    display: block;
    padding: 5px 2px 0;
    font-size: 7.6px;
    white-space: nowrap;
  }

  .mobile-page .rei-about-inner {
    padding: 21px 18px 22px;
  }

  .mobile-page .rei-about-inner .portrait-collage {
    grid-template-columns: 1fr 74px;
    min-height: 86px;
    padding: 5px 7px;
  }

  .mobile-page .rei-about-inner .portrait-copy {
    padding: 4px 2px;
    font-size: 8px;
  }

  .mobile-page .rei-about-inner .mini-profile {
    gap: 3px;
  }

  .mobile-page .rei-about-inner .mini-profile div {
    padding: 3px;
  }

  .mobile-page .rei-about-inner .mini-profile dt {
    font-size: 5.5px;
  }

  .mobile-page .rei-about-inner .mini-profile dd {
    font-size: 6.3px;
  }

  .mobile-page .rei-about-inner .rei-frame {
    height: 74px;
  }

  .mobile-page .rei-about-inner .rei-frame > img:first-child {
    width: 65px;
    height: 72px;
  }

  .mobile-page .rei-about-inner .rei-avatar {
    width: 47px;
    max-height: 59px;
  }

  .mobile-page .rei-biography {
    column-count: 1;
    margin-top: 7px;
    padding: 8px 10px 6px;
    font-size: 9.2px;
    line-height: 1.5;
  }

  .mobile-page .rei-biography p {
    margin-bottom: 3px;
  }

  .mobile-page .rei-question {
    margin: 4px 0 5px;
    padding: 4px 6px;
  }

  .mobile-page .rei-about-inner .rei-quote {
    margin-top: 6px;
    font-size: 8px;
  }

  .mobile-page .library-intro {
    width: 100%;
    font-size: 7px;
  }

  .mobile-page .library-shelf {
    gap: 5px;
  }

  .mobile-page .library-slip {
    grid-template-columns: 47px minmax(0, 1fr) 55px;
    min-height: 54px;
    padding: 6px 7px 6px 11px;
  }

  .mobile-page .library-slip strong {
    font-size: 8.7px;
  }

  .library-reader {
    padding: 0;
  }

  .library-vault {
    grid-template-rows: 64px minmax(0, 1fr);
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border-width: 0;
    outline: 0;
  }

  .library-vault::before { top: 59px; }

  .library-vault-header {
    grid-template-columns: 39px 1fr 36px;
    gap: 8px;
    padding: 7px 10px;
  }

  .library-sigil {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }

  .library-vault-header p { font-size: 6px; }
  .library-vault-header h2 { font-size: 19px; }

  .library-close {
    width: 32px;
    height: 32px;
    font-size: 22px;
  }

  .library-vault-layout {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: 1fr;
  }

  .library-record-nav {
    padding: 21px 10px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 3px double #5d4451;
  }

  .library-nav-label {
    display: none;
  }

  #libraryRecordList {
    display: flex;
    gap: 7px;
    width: max-content;
  }

  .library-record-button {
    grid-template-columns: 24px 1fr;
    width: 188px;
    min-height: 54px;
    margin: 0;
    padding: 6px;
  }

  .library-record-button::before { font-size: 15px; }
  .library-record-button strong { font-size: 8.5px; }
  .library-record-button small { font-size: 6px; }

  .library-document {
    padding: 32px 18px 44px;
  }

  .library-document-header {
    margin-bottom: 19px;
  }

  .library-document-header h3 {
    font-size: clamp(20px, 6vw, 27px);
  }

  .library-content {
    font-size: 14px;
    line-height: 1.82;
  }

  .library-content h2 {
    font-size: 20px;
  }

  .library-content h3 { font-size: 18px; }
  .library-content pre { font-size: 10.5px; }

  .library-document-footer {
    grid-template-columns: 1fr 1fr;
    margin-top: 38px;
  }

  .library-document-footer span {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .mobile-page .module-title-line { margin-bottom: 10px; }
  .mobile-page .module-title-line h2 { margin-bottom: 0; }
  .mobile-page .cabinet-door-grid button { min-height: 118px; }
  .mobile-page .reliquary-door-grid button { min-height: 80px; }
  .mobile-page .sky-console { grid-template-columns: 210px 1fr; }
  .mobile-page .gothic-radar { width: 204px; height: 204px; }
  .mobile-page .radio-console-head strong { font-size: 17px; }
}

@media (max-width: 430px) {
  .mobile-page .cabinet-door-grid { gap: 7px; }
  .mobile-page .cabinet-door-grid button { min-height: 108px; padding: 11px 8px 10px 31px; }
  .mobile-page .cabinet-door-grid strong { font-size: 10px; }
  .mobile-page .reliquary-door-grid button { grid-template-columns: 40px 1fr; min-height: 72px; }
  .mobile-page .reliquary-door-grid img { width: 36px; height: 42px; }
  .mobile-page .sky-console { grid-template-columns: 174px 1fr; padding: 7px; }
  .mobile-page .gothic-radar { width: 168px; height: 168px; }
  .mobile-page .sky-metrics div { padding: 6px; }
  .mobile-page .sky-metrics dd { font-size: 11px; }
  .aircraft-detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* PAGE 11 machine-status retirement: unnumbered inside back cover only. */
.back-endpaper-inner {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,250,248,.88),rgba(255,250,248,.88)),
    url("assets/materials/pink/pattern_tile_03_01.svg") repeat;
  background-size: auto, 126px 104px;
}
.back-endpaper-inner::before,
.back-endpaper-inner::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 13px;
  background: url("assets/materials/black/border_004.svg") repeat-x center / auto 13px;
  opacity: .42;
}
.back-endpaper-inner::before { top: 19px; }
.back-endpaper-inner::after { bottom: 19px; transform: rotate(180deg); }
.back-endpaper-mark {
  width: min(68%, 260px);
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 18px 20px;
  border-top: 3px double rgba(82,57,69,.52);
  border-bottom: 3px double rgba(82,57,69,.52);
  color: #725160;
  text-align: center;
  opacity: .78;
}
.back-endpaper-mark img:first-child { width: 76px; max-height: 54px; object-fit: contain; }
.back-endpaper-mark img:last-child { width: 100%; max-height: 28px; object-fit: contain; opacity: .58; }
.back-endpaper-mark span { font: 24px/1 var(--serif); }
.back-endpaper-mark small { font: 6px/1.4 var(--pixel); letter-spacing: .18em; }
@media (max-width:820px) {
  .back-endpaper-mark { width: min(74%, 250px); }
}
/* Page-editor presets replace only the paper collage. Protected layout and
   interactions remain in the authored page templates. */
.page-inner[data-editor-theme] {
  background-color: #fff9f7;
  background-image: var(--paper-wash), var(--paper-motif), var(--paper-blocks);
  background-repeat: repeat, repeat, repeat;
  background-size: auto, var(--motif-size), 100% 100%;
  background-position: 0 0;
}
.page-inner[data-editor-theme="rose-grid"] {
  --paper-wash: linear-gradient(rgba(255, 250, 250, .74), rgba(255, 250, 250, .74));
  --paper-motif: url("assets/materials/pink/pattern_tile_01_01.svg");
  --motif-size: 104px 104px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(230,161,191,.34) 0 52px, rgba(255,255,255,.12) 52px 91px, rgba(54,40,47,.12) 91px 100px, rgba(247,216,228,.28) 100px 151px);
}
.page-inner[data-editor-theme="black-cross"] {
  --paper-wash: linear-gradient(rgba(255, 251, 249, .82), rgba(255, 251, 249, .82));
  --paper-motif: url("assets/materials/black/pattern_tile_04_01.svg");
  --motif-size: 132px 132px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(49,37,44,.15) 0 34px, rgba(242,207,220,.27) 34px 82px, rgba(255,255,255,.12) 82px 116px, rgba(65,49,58,.1) 116px 127px);
}
.page-inner[data-editor-theme="ribbon-stripe"] {
  --paper-wash: linear-gradient(rgba(255, 251, 249, .76), rgba(255, 251, 249, .76));
  --paper-motif: url("assets/materials/black/pattern_tile_02_01.svg");
  --motif-size: 126px 126px;
  --paper-blocks: repeating-linear-gradient(90deg, rgba(43,32,38,.18) 0 30px, rgba(232,169,195,.34) 30px 72px, rgba(255,255,255,.1) 72px 105px, rgba(48,36,43,.14) 105px 114px, rgba(244,211,224,.3) 114px 157px);
}
.page-inner[data-editor-theme="pale-checker"] {
  --paper-wash: linear-gradient(rgba(255, 252, 250, .8), rgba(255, 252, 250, .8));
  --paper-motif: url("assets/journal/09_bottom_tiles/bottom_01_checkers.png");
  --motif-size: 76px 76px;
  --paper-blocks: repeating-linear-gradient(0deg, rgba(235,179,202,.26) 0 46px, rgba(255,255,255,.1) 46px 83px, rgba(53,40,47,.11) 83px 92px, rgba(242,215,225,.27) 92px 138px);
}
.rei-component-layer {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}
.rei-component {
  position: relative;
  max-width: 100%;
  margin: 0;
  color: #604b56;
}
.rei-component-full { width: 100%; }
.rei-component-compact { width: 74%; }
.rei-component-align-left { justify-self: start; text-align: left; }
.rei-component-align-center { justify-self: center; text-align: center; }
.rei-component-align-right { justify-self: end; text-align: right; }
.rei-component-tone-rose, .rei-component-tone-paper, .rei-component-tone-dark { padding: 8px 10px; }
.rei-component-tone-rose { border: 1px solid rgba(141,92,112,.4); background: rgba(240,202,218,.72); box-shadow: 2px 2px rgba(75,52,63,.14); }
.rei-component-tone-paper { border: 1px solid rgba(134,105,116,.32); background: rgba(255,251,245,.82); box-shadow: 2px 2px rgba(75,52,63,.1); }
.rei-component-tone-dark { border: 3px double #a98291; color: #fff4f7; background: rgba(44,31,38,.92); }
.rei-component h3, .rei-component p, .rei-component figcaption { margin: 0; }
.rei-component h3 { font-size: 15px; line-height: 1.35; letter-spacing: .08em; }
.rei-component p { white-space: pre-line; font-size: 9px; line-height: 1.65; }
.rei-component-quote { padding: 7px 10px 7px 15px; border-left: 3px solid #a76682; background: rgba(255,250,247,.54); }
.rei-component-quote::before { content: "“"; position: absolute; top: -9px; left: 2px; color: #b77591; font: 24px/1 var(--serif); opacity: .6; }
.rei-component-note { transform: rotate(-.35deg); border: 1px solid #bc8fa1; background: rgba(244,211,224,.84); box-shadow: 2px 3px rgba(69,48,58,.14); }
.rei-component-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; min-height: 15px; color: #7c5365; }
.rei-component-divider::before, .rei-component-divider::after { content: ""; height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.rei-component-divider::after { background: linear-gradient(90deg, currentColor, transparent); }
.rei-component-divider span { font-size: 12px; }
.rei-component-image img { display: block; max-width: 100%; max-height: 190px; margin-inline: auto; border: 4px solid #fff8f3; outline: 1px solid #967482; object-fit: contain; box-shadow: 3px 4px rgba(58,41,49,.18); }
.rei-component-image figcaption { margin-top: 6px; color: #79626e; font-size: 8px; line-height: 1.45; }
.rei-component-tone-dark figcaption { color: #ead6de; }
.rei-decoration-layer { position: absolute; z-index: 6; inset: 0; overflow: hidden; pointer-events: none; }
.rei-decoration-layer img { position: absolute; display: block; max-width: none; max-height: none; object-fit: contain; filter: drop-shadow(1px 2px 1px rgba(45,31,38,.18)); transform-origin: center; }
.editor-preview-mode .rei-component { outline: 1px dashed rgba(132,75,99,.35); outline-offset: 2px; }
.editor-preview-mode .rei-decoration-layer img { filter: drop-shadow(0 0 2px rgba(120,61,85,.7)); }
.editor-preview-mode .rei-decoration-layer img { pointer-events: auto; cursor: grab; touch-action: none; }
.editor-preview-mode .rei-decoration-layer img.is-dragging { cursor: grabbing; filter: drop-shadow(0 0 4px rgba(120,61,85,.95)); }
.editor-preview-mode .site-footer { opacity: .45; }

/* Embedded web fonts. Keep this final in the cascade because many original
   notebook components set their family through the `font` shorthand. */
.book .page,
.book .page :where(*),
.mobile-page,
.mobile-page :where(*) {
  font-family: var(--notebook-hand) !important;
}

.site-title-wrap h1,
.book .page h1,
.book .page h2,
.book .page .rei-component h3,
.mobile-page h1,
.mobile-page h2,
.mobile-page .rei-component h3,
.cover-copy strong,
.library-document-header h3 {
  font-family: var(--gothic-title) !important;
}

/* Hand帳編纂 2.0 editor affordances. Public rendering remains passive. */
.rei-component-free-layer {
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.rei-component-free-layer .rei-component-free {
  position: absolute;
  margin: 0;
  max-width: none;
  transform-origin: center;
  pointer-events: auto;
}
.rei-decoration-layer { overflow: visible; }
.rei-decoration-item {
  position: absolute;
  display: block;
  transform-origin: center;
  pointer-events: none;
}
.rei-decoration-item > img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: none;
  max-height: none;
  filter: drop-shadow(1px 2px 1px rgba(45,31,38,.18));
  user-select: none;
  -webkit-user-drag: none;
}
.editor-preview-mode [data-editor-field-key][contenteditable="true"],
.editor-preview-mode [data-editor-component-text][contenteditable="true"] {
  cursor: text;
  outline: 1px dashed rgba(126,70,94,.28);
  outline-offset: 2px;
}
.editor-preview-mode [data-editor-field-key][contenteditable="true"]:hover,
.editor-preview-mode [data-editor-component-text][contenteditable="true"]:hover {
  outline-color: rgba(126,70,94,.72);
  background: rgba(255,239,246,.18);
}
.editor-preview-mode .rei-decoration-item,
.editor-preview-mode .rei-component-free {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.editor-preview-mode .rei-decoration-item:hover,
.editor-preview-mode .rei-component-free:hover,
.editor-preview-mode .rei-editor-selected {
  outline: 2px solid rgba(125,66,92,.78) !important;
  outline-offset: 3px !important;
}
.editor-preview-mode .rei-editor-selected::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px dashed rgba(255,246,250,.95);
  pointer-events: none;
}
.editor-preview-mode .is-dragging { cursor: grabbing !important; }
.rei-editor-resize-handle {
  display: none;
}
.editor-preview-mode .rei-editor-resize-handle {
  position: absolute;
  z-index: 100;
  right: -7px;
  bottom: -7px;
  display: block;
  width: 13px;
  height: 13px;
  border: 2px solid #fff8fb;
  background: #6c4557;
  box-shadow: 0 0 0 1px #6c4557;
  cursor: nwse-resize;
  pointer-events: auto;
}


/* Hand帳編纂 2.2 Native Object Layer + CSS pseudo materialization */
[data-rei-native-id] { transform-origin: center; }
.rei-native-free {
  position: absolute !important;
  margin: 0 !important;
  max-width: none !important;
  box-sizing: border-box;
}
.rei-native-free img,
img.rei-native-free { object-fit: contain; }
.editor-preview-mode [data-rei-native-id] {
  cursor: pointer;
}
.editor-preview-mode [data-rei-native-id][data-rei-native-editable-text="1"][contenteditable="true"] {
  cursor: text;
  outline: 1px dashed rgba(97,76,87,.26);
  outline-offset: 2px;
}
.editor-preview-mode [data-rei-native-id][data-rei-native-editable-text="1"][contenteditable="true"]:hover {
  outline-color: rgba(126,70,94,.72);
  background: rgba(255,239,246,.15);
}
.editor-preview-mode [data-rei-native-role="dynamic"] {
  outline: 1px dotted rgba(99,109,132,.32);
  outline-offset: 2px;
}
.editor-preview-mode [data-rei-native-role="dynamic"]:hover {
  outline-color: rgba(82,94,122,.78);
}
.editor-preview-mode [data-rei-native-id].rei-editor-selected {
  outline: 2px solid rgba(125,66,92,.84) !important;
  outline-offset: 3px !important;
}
.editor-preview-mode [data-rei-native-role="dynamic"].rei-editor-selected {
  outline-color: rgba(73,88,120,.9) !important;
}
.rei-native-resize-handle { display:none; }
.editor-preview-mode .rei-native-free > .rei-native-resize-handle {
  position:absolute;
  z-index:999;
  right:-7px;
  bottom:-7px;
  display:block;
  width:13px;
  height:13px;
  border:2px solid #fff8fb;
  background:#6c4557;
  box-shadow:0 0 0 1px #6c4557;
  cursor:nwse-resize;
  pointer-events:auto;
}


/* Editor 2.2: materialized CSS pseudo decorations */
[data-rei-pseudo-before-materialized]::before,
[data-rei-pseudo-after-materialized]::after {
  content: none !important;
  display: none !important;
}
.rei-native-pseudo-decoration {
  display: block;
  margin: 0;
  max-width: none;
  max-height: none;
  box-sizing: border-box;
  pointer-events: none;
  transform-origin: center;
}
.editor-preview-mode .rei-native-pseudo-decoration[data-rei-native-id] {
  pointer-events: auto;
  cursor: grab;
}
.editor-preview-mode .rei-native-pseudo-decoration[data-rei-native-id]:hover {
  outline: 2px dotted rgba(162, 93, 124, .72) !important;
  outline-offset: 3px !important;
}
.editor-preview-mode .rei-native-pseudo-decoration[data-rei-native-id].rei-editor-selected {
  outline: 2px solid rgba(162, 74, 115, .92) !important;
  outline-offset: 4px !important;
}

/* Editor 2.3 / data-driven collection + reliquary index pages */
.archive-index-pager {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 7px;
  width: min(210px, 76%);
  margin: 8px auto 0;
  padding: 3px 5px;
  border-top: 1px dotted rgba(104,72,88,.45);
  border-bottom: 1px dotted rgba(104,72,88,.45);
  text-align: center;
}
.archive-index-pager button {
  min-height: 24px;
  border: 1px outset #c9a5b6;
  background: #f4dce7;
  color: #493641;
  cursor: pointer;
  font: 12px var(--serif);
}
.archive-index-pager button:disabled { opacity: .35; cursor: default; }
.archive-index-pager span { color: #765568; font: 6px var(--pixel); letter-spacing: .12em; }
.archive-index-empty {
  grid-column: 1 / -1;
  margin: 8px 0;
  padding: 24px 14px;
  border: 1px dashed #b88da1;
  background: rgba(255,249,251,.7);
  color: #705565;
  text-align: center;
  font: 9px/1.6 var(--serif);
}
.cabinet-door-grid button,
.reliquary-door-grid button { min-width: 0; }
.cabinet-door-grid strong,
.reliquary-door-grid span { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .archive-index-pager { width: min(190px, 82%); margin-top: 7px; }
}

/* Editor 2.4 collection cabinet cover */
.cabinet-door-grid .cabinet-index-cover {
  position:absolute;
  inset:0;
  z-index:0;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:.16;
  filter:grayscale(.65) contrast(.9);
  pointer-events:none;
}
.cabinet-door-grid button.has-cover::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  background:linear-gradient(90deg,rgba(35,25,31,.88),rgba(45,31,39,.68));
  pointer-events:none;
}
.cabinet-door-grid button.has-cover i,
.cabinet-door-grid button.has-cover strong,
.cabinet-door-grid button.has-cover span,
.cabinet-door-grid button.has-cover small { position:relative; z-index:1; }

/* ============================================================
   REI Editor 2.5 · MEMORY DIARY 2.0
   Public presentation layer for MASTER MEMORY ARCHIVE
   ============================================================ */
.memory-diary-index-v2,
.memory-diary-day-v2 {
  isolation: isolate;
}

.memory-diary-heading,
.memory-day-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.memory-diary-heading > b {
  flex: 0 0 auto;
  margin-top: 5px;
  padding: 4px 6px 3px;
  border: 1px solid #9b7487;
  box-shadow: 2px 2px 0 rgba(89, 57, 72, .16);
  color: #5f4250;
  background: rgba(255, 242, 247, .86);
  font: 5.5px var(--pixel);
  letter-spacing: .04em;
}

.memory-diary-index-v2 .memory-index-subtitle {
  display: block;
  margin-top: -7px;
}

.memory-diary-index-v2 .memory-index-subtitle span {
  display: block;
  margin-top: 2px;
}

.memory-source-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 2px 0 7px;
}

.memory-source-summary span {
  min-width: 0;
  padding: 5px 6px 4px;
  border: 1px solid rgba(118, 80, 98, .28);
  background: rgba(255, 248, 250, .76);
}

.memory-source-summary i,
.memory-source-summary b {
  display: block;
  font-style: normal;
}

.memory-source-summary i {
  overflow: hidden;
  color: #8b6b7a;
  font: 5px var(--pixel);
  letter-spacing: .05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-source-summary b {
  margin-top: 2px;
  color: #4f3843;
  font: 8px var(--pixel);
}

.memory-diary-index-v2 .year-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.memory-diary-index-v2 .year-tabs button {
  min-width: 43px;
  padding: 3px 4px 2px;
}

.memory-diary-index-v2 .year-tabs button span,
.memory-diary-index-v2 .year-tabs button small {
  display: block;
}

.memory-diary-index-v2 .year-tabs button small {
  margin-top: 1px;
  color: #9f7187;
  font-size: 4.5px;
}

.memory-diary-index-v2 .year-tabs button.is-active small {
  color: #624352;
}

.memory-diary-index-v2 .mini-calendar {
  position: relative;
  box-shadow: 3px 3px 0 rgba(83, 56, 68, .08);
}

.memory-diary-index-v2 .days > * {
  position: relative;
  min-height: 33px;
}

.memory-diary-index-v2 .days button.has-memory {
  background-image: linear-gradient(145deg, rgba(255,255,255,.58), rgba(239,207,220,.42));
}

.memory-diary-index-v2 .days small {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 13px;
  padding: 1px 2px;
  border: 1px solid rgba(166, 101, 131, .35);
  color: #8d506d;
  background: rgba(255, 241, 247, .9);
  font-size: 5px;
  line-height: 1.1;
  text-align: center;
}

.memory-month-ledger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 5px 7px;
  border-top: 1px dotted #caa8b8;
  border-bottom: 1px dotted #caa8b8;
  background: rgba(255, 247, 250, .54);
}

.memory-month-ledger span,
.memory-month-ledger b {
  font: 5.5px var(--pixel);
}

.memory-month-ledger span { color: #9a7385; }
.memory-month-ledger b { color: #5c4250; text-align: right; }

.memory-diary-index-v2 .diary-source-legend em {
  margin-left: auto;
  color: #99818c;
  font: 5px var(--pixel);
  font-style: normal;
}

.memory-day-heading {
  align-items: center;
  margin-bottom: 5px;
}

.memory-day-heading h2 { margin-bottom: 1px; }

.memory-day-heading p {
  margin: 0;
  color: #8c6d7b;
  font: 5.5px var(--pixel);
  letter-spacing: .04em;
}

.memory-day-heading > span {
  max-width: 98px;
  padding: 4px 6px;
  border: 1px solid #7a5667;
  transform: rotate(1.5deg);
  color: #5d3f4d;
  background: rgba(248, 223, 233, .62);
  font: 5px var(--pixel);
  text-align: center;
}

.memory-card-v2 {
  padding: 7px 8px 8px 9px;
  border-left-width: 3px;
  box-shadow: 2px 2px 0 rgba(84, 57, 69, .06);
}

.memory-card-v2::before { display: none; }
.memory-card-v2[data-memory-record] { padding-right: 24px; }

.memory-card-head {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 4px;
  border-bottom: 1px dotted rgba(132, 91, 111, .26);
}

.memory-card-head .memory-source-stamp {
  padding: 2px 4px;
  border: 1px solid currentColor;
  color: #704b5d;
  background: rgba(255, 235, 244, .72);
  font: 5px var(--pixel);
  letter-spacing: .03em;
}

.memory-card-head time {
  color: #654b58;
  font: 6px var(--pixel);
}

.memory-card-head i {
  color: #9b7285;
  font: 5px var(--pixel);
  font-style: normal;
}

.memory-card-head small {
  margin-left: auto;
  color: #a38995;
  font: 4.5px var(--pixel);
}

.memory-card-text {
  margin: 6px 0 3px !important;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.memory-card-v2.source-x-archive { border-left-color: #7b5969; }
.memory-card-v2.source-x-sync { border-left-color: #b07992; }
.memory-card-v2.source-direct { border-left-color: #c899ad; }
.memory-card-v2.source-rei { border-left-color: #d18caf; }
.memory-card-v2.is-reply { border-left-style: double; }
.memory-card-v2.is-retweet { opacity: .91; }

.memory-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}

.memory-relations.compact { margin: 4px 0 2px; }

.memory-relations span {
  padding: 2px 4px;
  border: 1px dotted #b68ca0;
  color: #805f6f;
  background: rgba(255, 245, 249, .74);
  font: 4.8px var(--pixel);
}

.memory-media-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 5px;
}

.memory-media-preview.count-1 { grid-template-columns: minmax(0, 1fr); }
.memory-media-preview.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.memory-media-preview.count-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.memory-media-preview img,
.memory-video-tile {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #957083;
  background: #ead6df;
}

/* Page 06 should show the whole photograph before the archive is opened.
   Preserve the source aspect ratio instead of cropping it into a thumbnail. */
.memory-media-preview img {
  display: block;
  height: auto;
  max-height: 190px;
  object-fit: contain;
}

.memory-media-preview.count-2 img,
.memory-media-preview.count-3 img,
.memory-media-preview.count-4 img { max-height: 145px; }

.memory-video-tile {
  display: grid;
  min-height: 64px;
  max-height: 145px;
  place-items: center;
  color: #684a58;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 5px, rgba(224,194,207,.55) 5px 10px);
  font: 5px var(--pixel);
}

.memory-card-v2 .diary-entry-media {
  justify-content: flex-end;
  margin-top: 3px;
  font: 4.8px var(--pixel);
}

.memory-record-relations[hidden],
.memory-record-provenance[hidden] { display: none; }

.memory-record-relations {
  margin: 11px 0 2px;
  padding-top: 7px;
  border-top: 1px dotted #c4a1b1;
}

.memory-record-provenance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 13px 0 4px;
  padding: 9px;
  border: 1px solid rgba(104, 73, 87, .24);
  background: rgba(255, 247, 242, .72);
}

.memory-record-provenance div {
  min-width: 0;
}

.memory-record-provenance b,
.memory-record-provenance span {
  display: block;
}

.memory-record-provenance b {
  color: #9a7083;
  font: 5px var(--pixel);
}

.memory-record-provenance span {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: #513c46;
  font: 7px/1.35 var(--serif);
}

.memory-vellum-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.memory-vellum-media[hidden] { display: none; }

.memory-vellum-media img,
.memory-vellum-media video {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid #8a6677;
  background: rgba(238, 218, 225, .58);
}

@media (max-width: 720px) {
  .memory-source-summary { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .memory-diary-heading > b { font-size: 4.8px; }
  .memory-diary-index-v2 .days > * { min-height: 36px; }
  .memory-day-heading > span { max-width: 86px; }
  .memory-record-provenance { grid-template-columns: 1fr; }
  .memory-vellum-media { grid-template-columns: 1fr; }
  .memory-media-preview,
  .memory-media-preview.count-2,
  .memory-media-preview.count-3,
  .memory-media-preview.count-4 { grid-template-columns: 1fr; }
  .memory-media-preview img { max-height: 260px; }
}

.memory-vellum-media audio,
.memory-vellum-media a {
  width: 100%;
  box-sizing: border-box;
}

.memory-vellum-media a {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid #8a6677;
  color: #5d4250;
  background: rgba(250, 231, 239, .7);
  font: 6px var(--pixel);
  text-decoration: none;
}

/* ================================================================
   REI Editor 2.5.2 — Memory Diary true-flow lace footer
   The bottom lace is a real final flex item, not an overlay.
   ================================================================ */
.memory-vellum {
  display: flex;
  flex-direction: column;
  min-height: min(520px, calc(100vh - 44px));
  padding-bottom: 10px;
  scroll-padding-bottom: 0;
}

/* Keep only the upper lace absolutely attached to the top edge. */
.memory-vellum::before {
  position: absolute;
  top: 6px;
  right: 28px;
  left: 28px;
}

/* The lower lace participates in normal document flow.
   Its auto top margin pushes it to the bottom when the record is short;
   when the record is long it naturally follows all content and media. */
.memory-vellum::after {
  position: static;
  right: auto;
  bottom: auto;
  left: auto;
  display: block;
  align-self: stretch;
  flex: 0 0 31px;
  width: auto;
  height: 31px;
  margin-top: auto;
  background-position: center top;
  background-size: auto 15px;
  transform: scaleY(-1);
  z-index: auto;
}

@media (max-width: 820px) {
  .memory-vellum {
    min-height: min(520px, calc(100vh - 20px));
    padding-bottom: 8px;
  }

  .memory-vellum::before {
    right: 18px;
    left: 18px;
  }
}


/* Editor 2.5.3 title-cross anchoring safety net. */
.page h2::after,
.mobile-page h2::after {
  position: static !important;
  inset: auto !important;
  float: none !important;
}


/* ================================================================
   REI Editor 2.5.4 — compact bow cursor
   Normal-sized pointer with icon_033 bow attached at lower-right.
   Keeps functional text/drag/resize cursors where they matter.
   ================================================================ */
html, body {
  cursor: url("assets/journal/03_cursors_small_icons/cursor_bow.png") 1 1, auto !important;
}

a, button, [role="button"], summary, label[for], select,
input[type="button"], input[type="submit"], input[type="reset"],
input[type="checkbox"], input[type="radio"], input[type="file"] {
  cursor: url("assets/journal/03_cursors_small_icons/cursor_bow.png") 1 1, pointer !important;
}

input:not([type]), input[type="text"], input[type="search"],
input[type="email"], input[type="url"], input[type="tel"],
input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="time"], textarea,
[contenteditable="true"] {
  cursor: text !important;
}

button:disabled, [aria-disabled="true"] { cursor: not-allowed !important; }

/* ================================================================
   REI Editor 2.5.5 — Badge Sanctum / data-driven 88×31 archive
   ================================================================ */
.badges-page .badge-paper {
  display:flex;
  flex-direction:column;
  min-height:100%;
}
.badge-sanctum-summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:8px 0 7px;
  padding:5px 7px;
  border-top:1px dotted #a97f92;
  border-bottom:1px dotted #a97f92;
  color:#6f5260;
  background:rgba(255,249,249,.62);
  font:6px var(--pixel);
}
.badge-sanctum-summary b { color:#3f3038; font-size:7px; }
.badge-sanctum-tabs {
  display:flex;
  gap:4px;
  min-height:24px;
  padding:0 0 7px;
  overflow-x:auto;
  scrollbar-width:thin;
}
.badge-sanctum-tabs button {
  flex:0 0 auto;
  min-height:22px;
  padding:3px 6px;
  border:1px solid #a47b8e;
  color:#5f4451;
  background:#f7e3eb;
  font:5.5px var(--pixel);
  cursor:pointer;
}
.badge-sanctum-tabs button.is-active {
  color:#fff2f7;
  background:#3d2d35;
  box-shadow:inset 0 0 0 1px #d69bb4;
}
.badge-sanctum-wall {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px 5px;
  align-content:start;
  min-height:190px;
  padding:9px 7px;
  border:3px double #9b7386;
  background:
    linear-gradient(rgba(255,252,250,.91),rgba(255,252,250,.91)),
    repeating-linear-gradient(0deg,transparent 0 30px,rgba(191,143,165,.14) 30px 31px),
    repeating-linear-gradient(90deg,transparent 0 96px,rgba(191,143,165,.1) 96px 97px);
  box-shadow:inset 0 0 0 4px rgba(231,197,211,.28);
}
.badge-sanctum-item {
  display:grid;
  grid-template-rows:40px auto auto;
  justify-items:center;
  align-content:start;
  min-width:0;
  padding:4px 2px 5px;
  border:0;
  color:#4e3a44;
  background:transparent;
  cursor:pointer;
}
.badge-sanctum-item:hover,
.badge-sanctum-item:focus-visible {
  outline:1px dotted #9d6f84;
  background:rgba(234,200,215,.24);
}
.badge-wall-slot {
  display:grid;
  place-items:center;
  width:94px;
  height:38px;
  overflow:hidden;
  background:rgba(255,255,255,.58);
}
.badge-wall-slot img {
  display:block;
  width:auto;
  height:auto;
  max-width:88px;
  max-height:31px;
  object-fit:contain;
}
.badge-sanctum-item strong {
  display:block;
  max-width:100%;
  margin-top:3px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font:6px/1.25 var(--pixel);
}
.badge-sanctum-item small { margin-top:2px; color:#987487; font:5.5px var(--pixel); }
.badge-sanctum-empty { grid-column:1 / -1; align-self:center; margin:auto; color:#806676; font:8px/1.7 var(--serif); text-align:center; }
.badge-sanctum-pager {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  min-height:28px;
  margin-top:6px;
  font:6px var(--pixel);
}
.badge-sanctum-pager button {
  width:25px;
  height:21px;
  border:1px solid #8d6678;
  background:#efd4df;
  cursor:pointer;
}
.badge-sanctum-pager button:disabled { opacity:.35; }
.badge-sanctum-footnote { margin:auto 0 0; color:#9b7b89; font:5px/1.35 var(--pixel); text-align:center; letter-spacing:.04em; }

.badge-reader { z-index:980; }
.badge-vellum {
  position:relative;
  width:min(520px,calc(100vw - 28px));
  max-height:calc(100vh - 32px);
  padding:31px 34px 28px;
  overflow:auto;
  border:7px double #6c4a5a;
  color:#433039;
  background:
    linear-gradient(rgba(255,249,246,.93),rgba(255,249,246,.93)),
    repeating-linear-gradient(0deg,transparent 0 25px,rgba(179,133,153,.12) 25px 26px),
    #f7eee8;
  box-shadow:0 22px 80px rgba(31,17,24,.48),inset 0 0 0 5px rgba(221,176,195,.22);
}
.badge-vellum::before,
.badge-vellum::after {
  content:"✠　✧　✠　✧　✠";
  display:block;
  color:#c487a2;
  font:11px/1 var(--serif);
  letter-spacing:.22em;
  text-align:center;
}
.badge-vellum::before { margin:-13px 0 17px; }
.badge-vellum::after { margin:20px 0 0; }
.badge-reader-close {
  position:absolute;
  top:9px;
  right:10px;
  width:29px;
  height:29px;
  border:2px double #71505f;
  color:#fff3f7;
  background:#3c2b34;
  cursor:pointer;
}
.badge-vellum-kicker { margin:0 0 9px; color:#956f80; font:6px var(--pixel); letter-spacing:.13em; }
.badge-vellum-specimen {
  display:grid;
  place-items:center;
  min-height:86px;
  margin:0 0 15px;
  padding:16px;
  border:2px dotted #b78e9f;
  background:
    linear-gradient(45deg,#efdee5 25%,transparent 25%,transparent 75%,#efdee5 75%),
    linear-gradient(45deg,#efdee5 25%,#fffaf8 25%,#fffaf8 75%,#efdee5 75%);
  background-position:0 0,8px 8px;
  background-size:16px 16px;
}
.badge-vellum-specimen img { display:block; width:auto; height:auto; max-width:176px; max-height:62px; object-fit:contain; image-rendering:auto; }
.badge-vellum h2 { margin:0 0 8px; font:24px/1.1 var(--serif); text-align:center; }
.badge-vellum-description { margin:0 auto 16px; max-width:390px; color:#725966; font:10px/1.75 var(--serif); text-align:center; }
.badge-vellum-meta { display:grid; grid-template-columns:1fr 1fr; gap:1px; margin:0; border:1px solid #b495a2; background:#b495a2; }
.badge-vellum-meta div { min-width:0; padding:8px 9px; background:#fffaf7; }
.badge-vellum-meta dt { color:#9b7586; font:5.5px var(--pixel); }
.badge-vellum-meta dd { margin:4px 0 0; overflow-wrap:anywhere; font:8px/1.45 var(--serif); }
.badge-vellum-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:6px; margin-top:16px; }
.badge-vellum-actions a,.badge-vellum-actions button { padding:6px 9px; border:2px outset #ad8395; color:#493641; background:#f0d5df; font:6px var(--pixel); text-decoration:none; cursor:pointer; }
.badge-vellum .copy-status { display:block; min-height:15px; margin:8px 0 0; text-align:center; }
.badge-vellum footer { margin-top:18px; color:#977482; font:5px var(--pixel); text-align:center; }

@media (max-width:760px) {
  .mobile-page .badge-sanctum-wall { grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px 3px; padding:8px 4px; }
  .mobile-page .badge-wall-slot { width:88px; }
  .badge-vellum { padding:28px 18px 23px; }
}
@media (max-width:420px) {
  .badge-sanctum-wall,.mobile-page .badge-sanctum-wall { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .badge-vellum-meta { grid-template-columns:1fr; }
}

/* ================================================================
   REI Editor 2.5.6 — Badge Sanctum dense collage wall
   Keep 88×31 badges close together, with a slightly hand-pasted rhythm.
   ================================================================ */
.badge-sanctum-wall {
  grid-template-columns:repeat(auto-fit,minmax(88px,1fr));
  column-gap:1px;
  row-gap:2px;
  padding:5px 4px;
}
.badge-sanctum-item {
  grid-template-rows:33px auto auto;
  padding:1px 0 2px;
  transform-origin:50% 50%;
}
.badge-wall-slot {
  width:90px;
  height:33px;
  background:transparent;
}
.badge-sanctum-item strong {
  margin-top:1px;
  font-size:5.5px;
  line-height:1.15;
}
.badge-sanctum-item small {
  margin-top:0;
  font-size:5px;
  line-height:1.1;
}
/* A restrained scrapbook irregularity without moving the actual grid cells. */
.badge-sanctum-item:nth-child(6n + 1) .badge-wall-slot { transform:rotate(-0.8deg) translateY(1px); }
.badge-sanctum-item:nth-child(6n + 2) .badge-wall-slot { transform:rotate(0.55deg); }
.badge-sanctum-item:nth-child(6n + 3) .badge-wall-slot { transform:rotate(-0.35deg) translateY(-1px); }
.badge-sanctum-item:nth-child(6n + 4) .badge-wall-slot { transform:rotate(0.75deg) translateY(1px); }
.badge-sanctum-item:nth-child(6n + 5) .badge-wall-slot { transform:rotate(-0.5deg); }
.badge-sanctum-item:nth-child(6n) .badge-wall-slot { transform:rotate(0.3deg) translateY(-1px); }

@media (max-width:760px) {
  .mobile-page .badge-sanctum-wall {
    grid-template-columns:repeat(auto-fit,minmax(88px,1fr));
    column-gap:0;
    row-gap:2px;
    padding:4px 2px;
  }
  .mobile-page .badge-sanctum-item { padding:1px 0; }
  .mobile-page .badge-wall-slot { width:88px; height:33px; }
}
@media (max-width:420px) {
  .badge-sanctum-wall,
  .mobile-page .badge-sanctum-wall {
    grid-template-columns:repeat(3,88px);
    justify-content:center;
    column-gap:1px;
    row-gap:2px;
  }
  .badge-sanctum-item strong,
  .badge-sanctum-item small { max-width:86px; }
}
@media (max-width:320px) {
  .badge-sanctum-wall,
  .mobile-page .badge-sanctum-wall {
    grid-template-columns:repeat(2,88px);
  }
}


/* ================================================================
   REI Editor 2.5.7 — Badge Sanctum pure 88×31 collage wall
   Badge labels leave the layout; hover/focus reveals a tiny archive tag.
   ================================================================ */
.badge-sanctum-wall {
  grid-template-columns:repeat(auto-fit,88px);
  justify-content:center;
  column-gap:1px;
  row-gap:1px;
  padding:4px 3px;
}
.badge-sanctum-item {
  position:relative;
  display:block;
  width:88px;
  height:31px;
  min-width:88px;
  padding:0;
  overflow:visible;
  border:0;
  background:transparent;
  line-height:0;
}
.badge-sanctum-item:hover,
.badge-sanctum-item:focus-visible {
  z-index:12;
  outline:none;
  background:transparent;
}
.badge-wall-slot {
  display:block;
  width:88px;
  height:31px;
  overflow:hidden;
  background:transparent;
  box-shadow:0 1px 1px rgba(67,43,54,.14);
}
.badge-wall-slot img {
  width:auto;
  height:auto;
  max-width:88px;
  max-height:31px;
  margin:auto;
}
/* Old label nodes may still exist in a cached DOM. They no longer consume wall space. */
.badge-sanctum-item > strong,
.badge-sanctum-item > small {
  display:none !important;
}
.badge-sanctum-item::after {
  content:attr(data-badge-info);
  position:absolute;
  left:50%;
  bottom:calc(100% + 4px);
  z-index:20;
  width:max-content;
  max-width:180px;
  padding:4px 6px;
  border:1px solid #9f7789;
  color:#4d3943;
  background:rgba(255,245,249,.96);
  box-shadow:2px 2px 0 rgba(84,57,69,.14);
  font:5.5px/1.45 var(--pixel);
  letter-spacing:.02em;
  white-space:normal;
  text-align:center;
  pointer-events:none;
  opacity:0;
  transform:translate(-50%,3px);
  transition:opacity .10s ease,transform .10s ease;
}
.badge-sanctum-item:hover::after,
.badge-sanctum-item:focus-visible::after {
  opacity:1;
  transform:translate(-50%,0);
}
/* Filtering remains available but visually recedes behind the badge wall. */
.badge-sanctum-tabs {
  gap:2px;
  min-height:18px;
  padding-bottom:4px;
  opacity:.66;
}
.badge-sanctum-tabs:hover,
.badge-sanctum-tabs:focus-within { opacity:1; }
.badge-sanctum-tabs button {
  min-height:17px;
  padding:2px 4px;
  border-color:rgba(164,123,142,.58);
  background:rgba(247,227,235,.48);
  font-size:5px;
}
.badge-sanctum-tabs button.is-active {
  background:#4a3740;
}
.badge-sanctum-summary {
  margin:5px 0 4px;
  padding:3px 5px;
  opacity:.72;
}
/* Keep the scrapbook tilt, but only on the visible 88×31 specimen. */
.badge-sanctum-item:nth-child(6n + 1) .badge-wall-slot { transform:rotate(-0.7deg) translateY(1px); }
.badge-sanctum-item:nth-child(6n + 2) .badge-wall-slot { transform:rotate(0.45deg); }
.badge-sanctum-item:nth-child(6n + 3) .badge-wall-slot { transform:rotate(-0.3deg) translateY(-1px); }
.badge-sanctum-item:nth-child(6n + 4) .badge-wall-slot { transform:rotate(0.6deg) translateY(1px); }
.badge-sanctum-item:nth-child(6n + 5) .badge-wall-slot { transform:rotate(-0.4deg); }
.badge-sanctum-item:nth-child(6n) .badge-wall-slot { transform:rotate(0.25deg) translateY(-1px); }
@media (max-width:760px) {
  .mobile-page .badge-sanctum-wall {
    grid-template-columns:repeat(auto-fit,88px);
    justify-content:center;
    column-gap:1px;
    row-gap:1px;
    padding:4px 2px;
  }
  .mobile-page .badge-sanctum-item,
  .mobile-page .badge-wall-slot { width:88px; height:31px; }
}
@media (hover:none) {
  .badge-sanctum-item::after { display:none; }
}

/* ================================================================
   REI Editor 2.5.8 — Badge pack wall / strict aligned native sizes
   Dense wall without scrapbook tilt. 88×31, 150×20 and 200×40 retain
   their native display boxes instead of being squeezed into one shape.
   ================================================================ */
.badge-sanctum-wall,
.mobile-page .badge-sanctum-wall {
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:flex-start !important;
  align-content:flex-start !important;
  justify-content:center !important;
  gap:1px !important;
  padding:4px 3px !important;
}
.badge-sanctum-item,
.badge-sanctum-item:nth-child(n) {
  position:relative !important;
  display:block !important;
  flex:0 0 var(--badge-w,88px) !important;
  width:var(--badge-w,88px) !important;
  height:var(--badge-h,31px) !important;
  min-width:0 !important;
  min-height:0 !important;
  max-width:none !important;
  max-height:none !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  line-height:0 !important;
  background:transparent !important;
  transform:none !important;
  translate:none !important;
  rotate:none !important;
  vertical-align:top !important;
}
.badge-sanctum-item .badge-wall-slot,
.badge-sanctum-item:nth-child(n) .badge-wall-slot {
  display:block !important;
  width:100% !important;
  height:100% !important;
  min-width:0 !important;
  min-height:0 !important;
  max-width:none !important;
  max-height:none !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
  background:transparent !important;
  transform:none !important;
  translate:none !important;
  rotate:none !important;
  box-shadow:none !important;
  line-height:0 !important;
}
.badge-sanctum-item .badge-wall-slot img,
.badge-sanctum-item:nth-child(n) .badge-wall-slot img {
  display:block !important;
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  max-height:none !important;
  margin:0 !important;
  padding:0 !important;
  object-fit:contain !important;
  object-position:center !important;
  transform:none !important;
  translate:none !important;
  rotate:none !important;
  vertical-align:top !important;
}
.badge-sanctum-item.is-standard { --badge-w:88px; --badge-h:31px; }
.badge-sanctum-item.is-blinkie { --badge-w:150px; --badge-h:20px; }
.badge-sanctum-item.is-banner { --badge-w:200px; --badge-h:40px; }
@media (hover:none) {
  .badge-sanctum-item::after { display:none !important; }
}

/* ============================================================
   REI Editor 2.5.9 — Anonymous Visitor Board 2.0
   ============================================================ */
.bbs-page .pale-paper {
  display: flex;
  flex-direction: column;
}

.bbs-statusline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 6px;
  min-height: 14px;
  color: #8d7480;
  font: 6.5px/1.2 var(--pixel, monospace);
  letter-spacing: .04em;
}

.bbs-statusline b {
  color: #bb6f93;
  font-weight: 500;
  text-align: right;
}

.bbs-board {
  max-height: 330px;
  overflow: auto;
  border-top: 2px double #9c7589;
  border-bottom: 2px double #9c7589;
  background:
    repeating-linear-gradient(0deg, rgba(185,135,157,.035) 0 1px, transparent 1px 19px),
    rgba(255,253,251,.88);
  scrollbar-width: thin;
  scrollbar-color: #c997ad #fff7fa;
}

.bbs-board article {
  position: relative;
  padding: 7px 8px 8px;
  border-bottom: 1px dotted #ceb2bf;
}

.bbs-board article:last-child { border-bottom: 0; }
.bbs-board article:hover { background: rgba(255,235,244,.42); }

.bbs-board header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #8e7280;
  font: 6.5px/1.35 var(--pixel, monospace);
}

.bbs-board header span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bbs-board p {
  margin: 4px 0 0;
  color: #4f3d46;
  font: 9px/1.55 var(--serif);
  overflow-wrap: anywhere;
  white-space: normal;
}

.bbs-quote-line {
  color: #a65f83;
  font-family: var(--mono, monospace);
}

.bbs-reply-ref {
  display: inline-block;
  margin-top: 3px;
  color: #a36e87;
  font: 6.5px var(--pixel, monospace);
}

.bbs-reply-button {
  flex: 0 0 auto;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: #c06f94;
  font: 8px var(--pixel, monospace);
  cursor: pointer;
}
.bbs-reply-button:hover,
.bbs-reply-button:focus-visible { color: #75475e; text-decoration: underline; }

.bbs-empty,
.bbs-loading {
  padding: 28px 12px;
  color: #927a85;
  text-align: center;
  font: 8px/1.6 var(--serif);
}

.bbs-new-post {
  align-self: flex-start;
  margin-top: 7px;
}

.bbs-form {
  position: relative;
  margin-top: 7px;
  padding: 8px;
  border: 1px dashed #ae8498;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.68);
  background: #fff0f6;
}

.bbs-form label {
  display: grid;
  grid-template-columns: 58px minmax(0,1fr);
  align-items: start;
  gap: 6px;
  margin-bottom: 5px;
  color: #745c68;
  font: 7px/1.4 var(--pixel, monospace);
}

.bbs-form input,
.bbs-form textarea {
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid #ad8598;
  border-radius: 0;
  outline: 0;
  color: #4c3b44;
  background: #fff;
  font: 9px/1.45 var(--serif);
}
.bbs-form input:focus,
.bbs-form textarea:focus { border-color: #c96f9a; box-shadow: 0 0 0 1px rgba(201,111,154,.16); }
.bbs-form textarea { height: 72px; resize: vertical; }

.bbs-reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px -1px 7px;
  padding: 4px 6px;
  border-left: 3px solid #d58dab;
  color: #895f72;
  background: rgba(255,255,255,.65);
  font: 6.5px var(--pixel, monospace);
}
.bbs-reply-banner button { border: 0; background: transparent; color: #9c607c; cursor: pointer; }

.bbs-form-foot,
.bbs-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bbs-form-foot {
  min-height: 13px;
  margin: -1px 0 5px 64px;
  color: #9a7c8a;
  font: 6.5px var(--pixel, monospace);
}
.bbs-form-foot [data-bbs-counter].is-near { color: #b24d7b; }
.bbs-form-foot [data-bbs-form-status] { color: #a55378; text-align: right; }
.bbs-form-actions { justify-content: flex-end; }
.bbs-form-actions button {
  min-width: 58px;
  padding: 4px 8px;
  border: 1px solid #ad8598;
  background: #fffafd;
  color: #684f5b;
  font: 7px var(--pixel, monospace);
  cursor: pointer;
}
.bbs-form-actions button:first-child { background: #f7d9e6; }
.bbs-form-actions button:disabled { opacity: .5; cursor: wait; }

.bbs-trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.bbs-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 7px;
  min-height: 17px;
  font: 7px var(--pixel, monospace);
}
.bbs-pages button {
  min-width: 24px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: #8b6778;
  font: inherit;
  cursor: pointer;
}
.bbs-pages button::before { content: '[ '; }
.bbs-pages button::after { content: ' ]'; }
.bbs-pages button:hover:not(:disabled),
.bbs-pages button.is-current { color: #b55382; text-decoration: underline; }
.bbs-pages button.is-current { font-weight: 700; }
.bbs-pages button:disabled { opacity: .35; cursor: default; }

@media (max-width: 820px) {
  #mobilePage .bbs-board { max-height: none; overflow: visible; }
  #mobilePage .bbs-form { padding: 10px; }
  #mobilePage .bbs-form label { grid-template-columns: 54px minmax(0,1fr); }
  #mobilePage .bbs-form-foot { margin-left: 60px; }
}


/* REI Editor 2.6.0 — Friend Link Garden 2.0 */
.friend-garden-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0 5px;font:7px var(--pixel);color:#8e7280}.friend-garden-head .web-button{padding:3px 7px;font-size:6.5px}.friend-garden{display:grid;gap:4px;margin-top:5px}.friend-link-entry{display:grid!important;grid-template-columns:96px minmax(0,1fr)!important;grid-template-rows:auto!important;align-items:center;gap:7px!important;padding:5px 6px!important;min-height:43px;text-decoration:none;border:1px solid rgba(111,79,95,.13)!important;border-bottom:1px dotted #bfa0af!important;background:rgba(255,253,251,.78)!important}.friend-link-entry:hover{background:#fff4f8!important;border-color:#c99fb2!important}.friend-link-media{display:flex;align-items:center;justify-content:center;width:92px;min-height:33px}.friend-badge-image{display:block;width:auto;max-width:88px;height:auto;max-height:31px;image-rendering:auto}.friend-avatar-image{display:block;width:42px;height:42px;object-fit:cover;border:1px solid #b892a3;background:#fff}.friend-text-mark{display:grid;place-items:center;width:88px;height:31px;padding:0 4px;overflow:hidden;border:2px outset #8e697b;background:#fff0f6;font:6px/1 var(--pixel);text-align:center}.friend-link-copy{display:grid;gap:2px;min-width:0}.friend-link-copy b{font:9px var(--serif);overflow-wrap:anywhere}.friend-link-copy small{font-size:6.5px;line-height:1.35;color:#8c7180}.friend-link-copy i{font:5.5px var(--pixel);font-style:normal;color:#aa8798}.friend-empty{margin:7px 0;padding:8px;border:1px dashed #c4a0b1;background:rgba(255,244,248,.62);font:7px/1.5 var(--serif);color:#8e7280}.notebook-info{position:relative;margin-top:9px;padding:7px 9px 8px;border:1px dashed #b98fa3;background:rgba(255,249,246,.84)}.friend-section-label{margin:0 0 6px;font:6px var(--pixel);letter-spacing:.08em;color:#9b7184}.notebook-info dl{margin:0;display:grid;gap:2px;font:7px/1.4 var(--serif)}.notebook-info dl div{display:grid;grid-template-columns:54px 1fr;border-bottom:1px dotted rgba(185,143,163,.35)}.notebook-info dt{color:#987888}.notebook-info dd{margin:0;overflow-wrap:anywhere}.notebook-info a{color:#6d5360}.notebook-badge{display:flex;align-items:center;gap:7px;margin-top:6px;font:6px var(--pixel)}.notebook-badge img{display:block;width:auto;max-width:88px;height:auto;max-height:31px}.tiny-copy{margin-top:6px;padding:3px 6px;border:1px outset #a77e92;background:#fff0f6;font:6px var(--pixel);color:#604955}.friend-apply-form{position:relative;margin-top:8px;padding:8px;border:1px solid #b98fa3;background:#fff1f6;z-index:2}.friend-apply-form label{display:grid;grid-template-columns:76px 1fr;gap:5px;align-items:start;margin:0 0 5px;font:6.5px var(--serif)}.friend-apply-form input,.friend-apply-form textarea{width:100%;box-sizing:border-box;padding:4px;border:1px solid #ad8598;background:#fff;font:7px var(--serif)}.friend-rule{margin:0 0 7px;padding:5px;border-left:2px solid #c491a9;background:rgba(255,255,255,.55);font:6.5px/1.45 var(--serif);color:#795f6c}.friend-form-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.friend-form-actions button{padding:3px 8px;border:1px outset #9f778b;background:#f9dce8;font:6px var(--pixel)}.friend-form-actions span{font:6px/1.35 var(--serif);color:#8a596f}.friend-trap{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;overflow:hidden!important}.friends-page .friend-cage{opacity:.25;pointer-events:none;z-index:0}.friends-page .friend-garden,.friends-page .notebook-info,.friends-page .friend-garden-head{position:relative;z-index:1}
@media(max-width:820px){.friend-link-entry{grid-template-columns:94px minmax(0,1fr)!important}.friend-apply-form label{grid-template-columns:1fr}.friends-page .friend-cage{display:none}.notebook-info dl div{grid-template-columns:50px 1fr}}


/* REI Editor 2.6.1 — Lost Magic external gateway directory */
.lost-magic-directory{
  position:relative;
  overflow:hidden;
  background:
    linear-gradient(rgba(255,255,255,.36),rgba(255,255,255,.36)),
    repeating-linear-gradient(0deg,transparent 0 24px,rgba(116,72,91,.055) 24px 25px),
    #f8efe9;
}
.lost-magic-directory::before{
  content:none !important;
  display:none !important;
}
.lost-magic-directory>h2{margin-bottom:5px}
.lost-magic-directory .lost-intro{
  width:min(92%,470px);
  margin:0 auto 13px;
  text-align:center;
  color:#6d5360;
  font-size:12px;
  line-height:1.65;
}
.lost-magic-ledger{
  width:min(94%,510px);
  margin:0 auto;
  border-top:1px solid rgba(43,29,36,.68);
}
.lost-magic-door{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 58px;
  align-items:center;
  gap:9px;
  min-height:61px;
  padding:7px 8px 7px 4px;
  border-bottom:1px solid rgba(43,29,36,.5);
  color:#2c2227;
  text-decoration:none;
  background:linear-gradient(90deg,rgba(255,255,255,.3),transparent 65%);
}
.lost-magic-door:hover,.lost-magic-door:focus-visible{
  background:rgba(226,188,203,.2);
  outline:none;
}
.lost-magic-door[aria-disabled="true"]{cursor:default;opacity:.56}
.lost-magic-door[aria-disabled="true"]:hover{background:linear-gradient(90deg,rgba(255,255,255,.3),transparent 65%)}
.lost-magic-sigil{
  display:grid;
  place-items:center;
  width:27px;height:27px;
  border:1px solid rgba(57,40,48,.72);
  color:#7c4f63;
  font-size:15px;
  background:rgba(255,248,244,.7);
}
.lost-magic-copy{display:flex;min-width:0;flex-direction:column;gap:1px}
.lost-magic-copy small{font:700 8px/1.25 monospace;letter-spacing:.08em;color:#8a7180}
.lost-magic-copy b{font-family:var(--serif,serif);font-size:16px;line-height:1.1;color:#30232a}
.lost-magic-copy span{font-size:10px;line-height:1.35;color:#785f6b;white-space:normal}
.lost-magic-door>em{
  justify-self:end;
  font:700 9px/1 monospace;
  letter-spacing:.08em;
  color:#713f56;
  font-style:normal;
  border:1px solid rgba(80,49,63,.62);
  padding:5px 5px 4px;
  background:#fff8f7;
}
.lost-magic-footnote{
  margin:10px 0 0;
  text-align:center;
  font:700 8px/1.4 monospace;
  letter-spacing:.12em;
  color:#9a7e8b;
}
@media(max-width:820px){
  .lost-magic-directory{padding-bottom:28px!important}
  .lost-magic-ledger{width:96%}
  .lost-magic-door{grid-template-columns:31px minmax(0,1fr) 56px;min-height:58px;padding:7px 5px 7px 3px}
  .lost-magic-copy b{font-size:15px}
}

/* Editor 2.6.3 // MASTER Library dynamic binding + archive pagination */
.library-shelf-empty {
  margin: 8px 0;
  padding: 18px 12px;
  border: 1px dashed #a88696;
  color: #806573;
  background: rgba(255, 250, 248, .72);
  font: 8px/1.6 var(--pixel);
  text-align: center;
}

.library-archive-tools {
  display: grid;
  gap: 8px;
  margin: 0 0 9px;
  padding: 8px;
  border: 1px solid rgba(92, 65, 79, .34);
  background: rgba(255, 249, 247, .66);
}

.library-archive-tools label {
  display: grid;
  gap: 4px;
  color: #765968;
  font: 6.4px/1.2 var(--pixel);
  letter-spacing: .05em;
}

.library-date-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.library-archive-tools select {
  width: 100%;
  min-width: 0;
  height: 29px;
  padding: 3px 22px 3px 7px;
  border: 1px solid #9c7b8a;
  border-radius: 0;
  color: #4b3741;
  background: #fffaf8;
  font: 8px var(--pixel);
}

.library-archive-tools select:disabled {
  opacity: .48;
}

.library-filter-reset {
  min-height: 27px;
  border: 1px solid #6a4f5c;
  border-radius: 0;
  color: #604652;
  background: #f2dfe7;
  font: 6.5px var(--pixel);
  letter-spacing: .04em;
}

.library-filter-reset:hover,
.library-filter-reset:focus-visible {
  color: #fff8fa;
  background: #5a404d;
}

.library-filter-status {
  margin: 0 0 8px;
  padding: 5px 7px;
  border-bottom: 1px dotted #987383;
  color: #826272;
  font: 6.2px var(--pixel);
  letter-spacing: .04em;
}

.library-empty-results {
  margin: 10px 0;
  padding: 16px 8px;
  border: 1px dashed #aa8998;
  color: #7d6370;
  background: rgba(255, 250, 248, .7);
  font: 8px/1.55 var(--serif);
  text-align: center;
}

.library-list-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 3px double #836270;
}

.library-list-pagination button {
  min-height: 27px;
  padding: 4px 6px;
  border: 1px solid #856775;
  border-radius: 0;
  color: #58414c;
  background: #fff8f8;
  font: 6.5px var(--pixel);
}

.library-list-pagination button:disabled {
  opacity: .32;
}

.library-list-pagination span {
  min-width: 46px;
  color: #765665;
  font: 7px var(--pixel);
  text-align: center;
}

@media (max-width: 820px) {
  .library-archive-tools {
    gap: 7px;
    padding: 7px;
  }

  .library-date-filters {
    grid-template-columns: 1fr;
  }

  .library-archive-tools select {
    height: 31px;
    font-size: 7px;
  }

  .library-filter-status {
    font-size: 5.8px;
  }
}

/* Editor 2.6.3-r1.1 // Artificial Mind live-window hotfix
   Strict scope: existing .ai-reliquary device only. */
.ai-reliquary { position: relative; }

.ai-reliquary .ai-header {
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  gap: 5px;
}

.ai-reliquary .ai-header > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-reliquary .ai-owner-link {
  min-width: 0;
  padding: 2px 4px;
  border: 0;
  border-left: 1px dotted #9e7186;
  color: #eab3ca;
  background: transparent;
  box-shadow: none;
  font: 6px var(--pixel);
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
}

.ai-reliquary .ai-owner-link:hover,
.ai-reliquary .ai-owner-link:focus-visible {
  color: #fff4f8;
  background: #493642;
  outline: 1px dotted #d9a6bc;
}

.ai-reliquary .ai-owner-panel {
  position: absolute;
  z-index: 8;
  inset: 43px 10px 10px;
  display: grid;
  align-content: center;
  padding: 18px;
  border: 1px solid #8f687b;
  outline: 1px solid #211a1f;
  color: #f9e8ef;
  background: rgba(35, 30, 35, .98);
  box-shadow: inset 0 0 0 2px rgba(218, 167, 190, .08);
  font: 7px/1.55 var(--pixel);
}

.ai-reliquary .ai-owner-panel[hidden] { display: none !important; }

.ai-reliquary .ai-owner-panel-title {
  margin-bottom: 12px;
  padding-bottom: 5px;
  border-bottom: 1px dotted #8f687b;
  color: #efb5cd;
  letter-spacing: .08em;
}

.ai-reliquary .ai-owner-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.ai-reliquary .ai-owner-form label {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 7px;
  color: #d6a9bd;
}

.ai-reliquary .ai-owner-form input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px;
  color: #332630;
  background: #fff8fa;
}

.ai-reliquary .ai-owner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.ai-reliquary .ai-owner-actions button {
  min-width: 54px;
  padding: 4px 6px;
  color: #513b47;
  background: #edcddd;
  font: 6px var(--pixel);
}

.ai-reliquary .ai-owner-status {
  min-height: 12px;
  margin: 0;
  color: #cda2b5;
  font: 6px/1.4 var(--pixel);
  text-align: right;
}

.ai-reliquary .ai-owner-status[data-kind="ok"] { color: #dcb2c4; }
.ai-reliquary .ai-owner-status[data-kind="error"] { color: #e2a0b2; }
.ai-reliquary .ai-log .ai-mind-pending { opacity: .62; }
.ai-reliquary .ai-log .ai-mind-pending b { animation: reiMindPulse 1s steps(2, end) infinite; }
.ai-reliquary .ai-log .ai-mind-system { color: #bfa6b1; }
.ai-reliquary .ai-log .ai-mind-system b { color: #c58ba5; }
.ai-reliquary #aiForm button:disabled,
.ai-reliquary [data-source-id="aiForm"] button:disabled,
.ai-reliquary #aiForm input:disabled,
.ai-reliquary [data-source-id="aiForm"] input:disabled { opacity: .58; cursor: wait; }

@keyframes reiMindPulse {
  0%, 45% { opacity: .48; }
  46%, 100% { opacity: 1; }
}

@media (max-width: 820px) {
  .ai-reliquary .ai-header {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }
  .ai-reliquary .ai-header b {
    grid-column: 2 / 3;
    grid-row: 2;
  }
  .ai-reliquary .ai-owner-link {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: stretch;
  }
  .ai-reliquary .ai-owner-panel { inset: 54px 10px 10px; padding: 14px; }
}

/* REI_LONG_PAGE_OVERFLOW_HOTFIX1_START
   Desktop physical-book pages remain fixed-size for the page-turn engine.
   The Friends / Neighbouring Worlds sheet gets an internal vertical scroll
   surface when dynamic content (especially the application form) exceeds
   the physical paper height. Mobile keeps its existing auto-height layout. */
@media (min-width: 821px) {
  .friends-page > .garden-paper {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 52px;
    scroll-padding-top: 18px;
    scroll-padding-bottom: 42px;
  }

  .friends-page > .garden-paper .friend-apply-form {
    scroll-margin-top: 18px;
    scroll-margin-bottom: 42px;
  }

  .friends-page > .garden-paper::-webkit-scrollbar {
    width: 8px;
  }

  .friends-page > .garden-paper::-webkit-scrollbar-track {
    background: rgba(255, 247, 250, .44);
    border-left: 1px dotted rgba(158, 116, 136, .28);
  }

  .friends-page > .garden-paper::-webkit-scrollbar-thumb {
    min-height: 34px;
    border: 2px solid rgba(255, 247, 250, .75);
    background: rgba(166, 119, 142, .62);
  }

  .friends-page > .garden-paper {
    scrollbar-width: thin;
    scrollbar-color: rgba(166, 119, 142, .62) rgba(255, 247, 250, .44);
  }

  /* When the long application form is open, the decorative cage should not
     sit on top of the editable fields. */
  .friends-page > .garden-paper:has(.friend-apply-form:not([hidden])) .friend-cage {
    opacity: .08;
    pointer-events: none;
  }
}
/* REI_LONG_PAGE_OVERFLOW_HOTFIX1_END */

/* =========================================================
   REI TEXT CONTRAST HOTFIX
   Only text colors are changed.
   ========================================================= */

body {
  color: #3e3239;
}

/* Normal readable text */
p,
li,
dd,
dt,
article,
section,
.content,
.text,
.description,
.article-body,
.entry-body,
.library-record-body,
.memory-entry-body,
.collection-card,
.friend-card {
  color: #3e3239;
}

/* Secondary information */
small,
.meta,
.caption,
.description,
.note-meta,
.date,
.time,
.timestamp {
  color: #5f4c57;
}

/* Muted UI labels */
.muted,
.subtle,
.hint,
.label,
.kicker {
  color: #78616d;
}

/* Links stay pink, but are easier to read */
a {
  color: #8f5772;
}

a:hover,
a:focus {
  color: #6f4057;
}

/* Form text */
input,
textarea,
select,
button {
  color: #3e3239;
}

input::placeholder,
textarea::placeholder {
  color: #806a75;
  opacity: 1;
}

/* REI notes keep their style, only become darker */
.rei-note,
.REI-note,
.note,
.handwritten-note,
.margin-note {
  color: #493a43;
}

/* END REI TEXT CONTRAST HOTFIX */

/* REI AI CHAT TEXT COLOR SYNC */
.ai-reliquary .ai-log p:not(.ai-mind-system) {
  color: #efaeca;
}
/* END REI AI CHAT TEXT COLOR SYNC */
