:root {
  color-scheme: light;
  --ink: #1f2521;
  --muted: #67716a;
  --line: #d5d2c7;
  --paper: #fbfaf6;
  --panel: #f0eee7;
  --forest: #243b32;
  --forest-2: #31584d;
  --forest-3: #172b25;
  --clay: #9a5949;
  --gold: #c7a15a;
  --gold-light: #ead6a3;
  --ivory: #fffdf6;
  --cover: #7b4a38;
  --cover-dark: #4b2c24;
  --book-pad-x: 24px;
  --book-pad-y: 18px;
  --ui-font: "Aptos", "Segoe UI", Arial, sans-serif;
  --display-font: "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --script-font: "Segoe Script", "Lucida Handwriting", "Brush Script MT", cursive;
  --focus-ring: 0 0 0 3px rgba(234, 214, 163, 0.32);
  --shadow: 0 22px 60px rgba(12, 15, 13, 0.32);
  --soft-shadow: 0 10px 28px rgba(26, 27, 22, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  position: relative;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 28%),
    linear-gradient(180deg, #1d372f, var(--forest-3));
  color: var(--ink);
  font-family: var(--ui-font);
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.background-video,
.background-scrim {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background-video {
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.36;
  filter: brightness(0.55) saturate(0.9) sepia(0.12);
  transition: opacity 420ms ease, filter 420ms ease;
}

.background-scrim {
  z-index: 1;
  background:
    radial-gradient(circle at 50% 36%, rgba(28, 58, 48, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(9, 21, 17, 0.5), rgba(7, 13, 11, 0.72));
  transition: background 420ms ease;
}

body.book-is-away .background-video {
  opacity: 1;
  filter: brightness(0.82) saturate(1.05);
}

body.book-is-away .background-scrim {
  background:
    radial-gradient(circle at 50% 40%, rgba(10, 16, 14, 0.05), rgba(5, 9, 8, 0.34) 74%),
    linear-gradient(180deg, rgba(7, 12, 10, 0.18), rgba(5, 8, 7, 0.42));
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.library {
  height: 100vh;
  overflow-y: auto;
  scrollbar-color: rgba(154, 89, 73, 0.42) rgba(31, 37, 33, 0.08);
  border-right: 1px solid rgba(64, 44, 32, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 251, 240, 0.94)),
    var(--paper);
  padding: 30px 22px;
  transition: transform 180ms ease, opacity 180ms ease;
  z-index: 12;
}

.app-shell.index-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-shell.index-collapsed .library {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
}

.app-shell.book-away {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-shell.book-away .library {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
}

.library-header {
  position: relative;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(123, 74, 56, 0.22);
}

.library-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 76px;
  height: 2px;
  background: linear-gradient(90deg, var(--clay), var(--gold));
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--clay);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: var(--script-font);
  font-size: 2.62rem;
  font-weight: 600;
  line-height: 1.12;
  color: #25372f;
}

.recipe-count {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.field-label {
  display: block;
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: rgba(36, 59, 50, 0.64);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(36, 59, 50, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #fffaf0);
  color: var(--ink);
  padding: 0 14px 0 42px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 9px 20px rgba(36, 59, 50, 0.08);
}

.search-input:focus {
  border-color: rgba(49, 88, 77, 0.72);
  box-shadow:
    var(--focus-ring),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 11px 22px rgba(36, 59, 50, 0.12);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 22px;
}

.category-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgba(36, 59, 50, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #fbf4e5);
  color: #263a32;
  padding: 6px 8px 6px 10px;
  font-size: 0.81rem;
  font-weight: 800;
  box-shadow: 0 7px 14px rgba(36, 59, 50, 0.08);
}

.category-tabs button:hover,
.category-tabs button:focus {
  border-color: rgba(154, 89, 73, 0.45);
  background: #fff;
  transform: translateY(-1px);
}

.tab-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(154, 89, 73, 0.11);
  color: #7f493d;
  font-size: 0.74rem;
  font-weight: 900;
}

.category-tabs button[aria-selected="true"] {
  border-color: rgba(36, 59, 50, 0.72);
  background:
    linear-gradient(180deg, #385f53, var(--forest-2));
  color: #fff;
  box-shadow:
    0 10px 20px rgba(36, 59, 50, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.category-tabs button[aria-selected="true"] .tab-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff3d4;
}

.recipe-list {
  display: grid;
  gap: 12px;
}

.recipe-group {
  display: grid;
  gap: 7px;
}

.recipe-group-title {
  position: sticky;
  top: -30px;
  z-index: 1;
  margin-top: 10px;
  color: #865145;
  background:
    linear-gradient(180deg, rgba(251, 250, 246, 0.96), rgba(251, 250, 246, 0.86));
  padding: 7px 0 5px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recipe-item {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(36, 59, 50, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  padding: 9px 11px;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 4px 12px rgba(31, 37, 33, 0.04);
}

.recipe-item:hover,
.recipe-item:focus {
  border-color: rgba(154, 89, 73, 0.3);
  background: #fff;
  outline: none;
  transform: translateX(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 18px rgba(31, 37, 33, 0.08);
}

.recipe-item.is-active {
  border-color: rgba(154, 89, 73, 0.58);
  background:
    linear-gradient(90deg, rgba(154, 89, 73, 0.13), #fff 18%);
  box-shadow:
    inset 3px 0 0 var(--clay),
    0 10px 20px rgba(154, 89, 73, 0.1);
}

.recipe-title {
  display: block;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.25;
}

.recipe-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.reading-room {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  height: 100vh;
  min-height: 0;
  padding: 22px 26px 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 68px),
    linear-gradient(120deg, rgba(255, 255, 255, 0.06), transparent 38%),
    linear-gradient(180deg, rgba(8, 17, 14, 0.14), rgba(8, 17, 14, 0.34)),
    rgba(23, 43, 37, 0.82);
  color: #fff;
  transition: background 420ms ease;
}

body.book-is-away .reading-room {
  background:
    linear-gradient(180deg, rgba(8, 14, 12, 0.1), rgba(8, 14, 12, 0.22));
}

.book-toolbar,
.book-footer {
  width: min(100%, 1240px);
  margin: 0 auto;
}

.book-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 48px;
}

.current-recipe {
  min-width: 0;
}

.current-recipe p {
  color: var(--gold-light);
  font-size: 0.77rem;
  font-weight: 900;
  text-transform: uppercase;
}

.current-recipe h2 {
  margin-top: 4px;
  overflow: hidden;
  font-family: var(--script-font);
  font-size: 1.96rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ivory);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button,
.nav-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 24px rgba(8, 17, 14, 0.18);
}

.icon-button svg,
.nav-button svg,
.lightbox-close svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.icon-button {
  width: 44px;
  height: 44px;
}

.icon-button:hover,
.icon-button:focus,
.nav-button:hover,
.nav-button:focus {
  border-color: rgba(234, 214, 163, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.12));
  outline: none;
  transform: translateY(-1px);
}

.icon-button:disabled,
.nav-button:disabled {
  cursor: default;
  opacity: 0.34;
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.icon-button.is-active,
.icon-button[aria-pressed="true"] {
  border-color: rgba(234, 214, 163, 0.64);
  background:
    linear-gradient(180deg, rgba(234, 214, 163, 0.3), rgba(199, 161, 90, 0.16));
  color: #fff5d5;
}

@media (hover: hover) {
  .icon-button[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 9px);
    left: 50%;
    z-index: 20;
    width: max-content;
    max-width: 150px;
    transform: translateX(-50%) translateY(-3px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(20, 35, 30, 0.96);
    color: #fff;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
  }

  .icon-button[data-tooltip]:hover::after,
  .icon-button[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%);
  }
}

.book-stage {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 18px;
  width: min(100%, 1240px);
  height: 100%;
  margin: 0 auto;
  min-height: 0;
  padding: clamp(12px, 2vh, 26px) 0 clamp(10px, 2vh, 22px);
  perspective: 2600px;
  perspective-origin: 50% 42%;
  transition: opacity 360ms ease, transform 420ms ease, filter 420ms ease;
}

.nav-button {
  width: 58px;
  height: 76px;
}

.nav-button svg {
  width: 34px;
  height: 34px;
}

.nav-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.book {
  --book-pad-x: clamp(16px, 2.4vw, 30px);
  --book-pad-y: clamp(12px, 2vh, 22px);
  position: relative;
  display: block;
  justify-self: center;
  width: min(100%, calc((100vh - 132px) * 1.5), 1180px) !important;
  max-width: min(100%, 1180px) !important;
  min-width: min(100%, 600px) !important;
  min-height: 0 !important;
  padding: var(--book-pad-y) var(--book-pad-x) clamp(16px, 2vh, 26px);
  border-radius: 11px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 10%, transparent 90%, rgba(255, 255, 255, 0.07)),
    linear-gradient(90deg, var(--cover-dark), var(--cover) 11%, #8b5941 50%, var(--cover) 89%, var(--cover-dark));
  box-shadow:
    0 30px 60px rgba(5, 7, 6, 0.46),
    inset 0 0 0 1px rgba(255, 235, 196, 0.18),
    inset 0 -12px 24px rgba(39, 19, 13, 0.38);
  filter: drop-shadow(0 28px 34px rgba(9, 10, 8, 0.28));
  isolation: isolate;
  transform-style: preserve-3d;
  transform: rotateX(1.1deg) translateZ(0);
  overflow: visible;
}

.book::before,
.book::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.book::before {
  inset: auto 7% -20px;
  z-index: -2;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.34);
  filter: blur(15px);
}

.book::after {
  inset: calc(var(--book-pad-y) + 7px) calc(var(--book-pad-x) + 6px) 15px;
  z-index: 1;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(67, 39, 21, 0.18), transparent 8%, transparent 92%, rgba(67, 39, 21, 0.18)),
    repeating-linear-gradient(0deg, rgba(98, 67, 37, 0.14) 0 1px, transparent 1px 5px),
    #e4d0a8;
  box-shadow:
    inset 0 0 0 1px rgba(107, 80, 48, 0.32),
    0 3px 0 rgba(94, 57, 33, 0.28);
}

.book.stf__parent {
  touch-action: pan-y;
}

.book .stf__wrapper {
  position: relative;
  z-index: 4;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  border-radius: 8px;
  filter: drop-shadow(0 14px 22px rgba(23, 15, 9, 0.24));
  transform: translateZ(8px);
  will-change: filter;
}

.book .stf__wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 31;
  width: 50px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(42, 25, 13, 0.25) 43%, rgba(255, 249, 232, 0.22) 50%, rgba(42, 25, 13, 0.24) 57%, transparent),
    radial-gradient(ellipse at 50% 50%, rgba(33, 19, 10, 0.24), transparent 65%);
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.book.is-cover-spread .stf__wrapper::before {
  opacity: 0;
}

.book .stf__block {
  overflow: visible;
  border-radius: 8px;
}

.book .stf__outerShadow,
.book .stf__innerShadow,
.book .stf__hardShadow,
.book .stf__hardInnerShadow {
  pointer-events: none;
  mix-blend-mode: multiply;
}

.book.is-renderer-turning .stf__wrapper {
  filter: drop-shadow(0 20px 34px rgba(18, 11, 7, 0.34));
}

.flip-page {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(77, 55, 31, 0.42);
  background:
    linear-gradient(90deg, rgba(75, 43, 22, 0.08), transparent 13%, transparent 87%, rgba(75, 43, 22, 0.09)),
    radial-gradient(ellipse at 50% 2%, rgba(255, 255, 255, 0.35), transparent 40%),
    #f4e5c8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 230, 0.46),
    inset 0 0 22px rgba(82, 50, 26, 0.12);
  backface-visibility: hidden;
  cursor: grab;
  transform-style: preserve-3d;
  user-select: none;
  will-change: transform, clip-path;
  -webkit-backface-visibility: hidden;
}

.flip-page.--left {
  border-radius: 6px 1px 1px 6px;
}

.flip-page.--right {
  border-radius: 1px 6px 6px 1px;
}

.flip-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.cover-page {
  border-color: rgba(47, 24, 16, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 229, 175, 0.12), transparent 34%),
    linear-gradient(90deg, #341b15, #6d3b2d 48%, #28150f);
  box-shadow:
    inset 0 0 0 2px rgba(238, 197, 122, 0.18),
    inset 0 0 34px rgba(22, 10, 7, 0.38),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

.cover-page img {
  object-fit: cover;
  background: #2c1813;
}

.cover-page::before {
  background:
    linear-gradient(90deg, rgba(18, 10, 7, 0.18), transparent 22%, rgba(255, 239, 198, 0.1) 50%, transparent 76%, rgba(18, 10, 7, 0.18)),
    radial-gradient(ellipse at 50% 12%, rgba(255, 255, 255, 0.12), transparent 52%);
  opacity: 0.34;
}

.cover-page::after {
  inset: 12px;
  border: 1px solid rgba(238, 197, 122, 0.38);
  border-radius: 3px;
  background: transparent;
  opacity: 1;
}

.flip-page::before,
.flip-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.flip-page::before {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(40, 24, 12, 0.16), transparent 17%, transparent 83%, rgba(255, 255, 255, 0.1)),
    radial-gradient(ellipse at 50% 14%, rgba(255, 255, 255, 0.22), transparent 44%);
  mix-blend-mode: multiply;
  opacity: 0.22;
}

.flip-page.--left::before {
  background:
    linear-gradient(90deg, rgba(40, 24, 12, 0.1), transparent 18%, transparent 82%, rgba(33, 19, 10, 0.25)),
    radial-gradient(ellipse at 50% 14%, rgba(255, 255, 255, 0.2), transparent 44%);
}

.flip-page.--right::before {
  background:
    linear-gradient(90deg, rgba(33, 19, 10, 0.25), transparent 18%, transparent 82%, rgba(40, 24, 12, 0.1)),
    radial-gradient(ellipse at 50% 14%, rgba(255, 255, 255, 0.2), transparent 44%);
}

.flip-page::after {
  z-index: 3;
  opacity: 0.36;
}

.flip-page.--left::after {
  background: linear-gradient(90deg, transparent 91%, rgba(255, 255, 255, 0.46));
}

.flip-page.--right::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.44), transparent 9%);
}

.page-edge {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow:
    inset 0 -2px 0 rgba(111, 77, 40, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.16);
}

.blank-page {
  display: grid;
  place-items: center;
  color: rgba(56, 39, 24, 0.62);
  font-family: var(--script-font);
  font-size: 1.45rem;
  line-height: 1.25;
  text-align: center;
}

.blank-page div {
  max-width: 14ch;
}

.book-footer {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  transition: opacity 360ms ease, transform 420ms ease, filter 420ms ease;
}

.app-shell.book-away .book-stage,
.app-shell.book-away .book-footer {
  opacity: 0;
  pointer-events: none;
  transform: translateY(28px) scale(0.985);
  filter: blur(3px);
}

.app-shell.book-away #libraryToggle,
.app-shell.book-away #openCurrent {
  opacity: 0;
  pointer-events: none;
}

.app-shell.book-away .current-recipe {
  opacity: 0;
  pointer-events: none;
}

.background-pickup {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: end center;
  padding: 0 20px 54px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 260ms ease, transform 320ms ease;
}

.app-shell.book-away .background-pickup {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.pickup-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1));
  color: #fffdf6;
  padding: 0 16px 0 14px;
  font-weight: 800;
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.pickup-button:hover,
.pickup-button:focus {
  border-color: rgba(234, 214, 163, 0.62);
  background:
    linear-gradient(180deg, rgba(234, 214, 163, 0.28), rgba(255, 255, 255, 0.12));
  outline: none;
  transform: translateY(-1px);
}

.pickup-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.page-status {
  min-width: 116px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  padding: 7px 10px;
  font-weight: 800;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.page-slider {
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: pointer;
}

.page-slider:disabled {
  cursor: default;
  opacity: 0.5;
}

.page-slider::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(234, 214, 163, 0.7), rgba(199, 161, 90, 0.82)),
    rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

.page-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 2px solid rgba(255, 251, 240, 0.92);
  border-radius: 50%;
  background:
    linear-gradient(180deg, #ead6a3, #b98d45);
  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.page-slider::-moz-range-track {
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(199, 161, 90, 0.82);
}

.page-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 251, 240, 0.92);
  border-radius: 50%;
  background: #c7a15a;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(17, 21, 18, 0.9), rgba(10, 13, 11, 0.94));
  padding: 24px;
  backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox figure {
  display: grid;
  gap: 12px;
  max-width: min(96vw, 1080px);
  max-height: 94vh;
  margin: 0;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(94vh - 48px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox figcaption {
  color: var(--ivory);
  font-family: var(--script-font);
  font-size: 1.35rem;
  font-weight: 600;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 18px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .reading-room {
    padding-inline: 18px;
  }

  .book-stage {
    grid-template-columns: 48px minmax(0, auto) 48px;
    gap: 12px;
  }

  .nav-button {
    width: 46px;
    height: 64px;
  }
}

@media (max-width: 920px) {
  .app-shell,
  .app-shell.index-collapsed {
    grid-template-columns: 1fr;
  }

  .library,
  .app-shell.index-collapsed .library {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 360px);
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-105%);
    box-shadow: var(--shadow);
  }

  .app-shell.index-open .library {
    transform: translateX(0);
  }

  .reading-room {
    min-height: 100vh;
    padding: 16px 14px 18px;
  }

  .book-toolbar {
    gap: 10px;
  }

  .current-recipe h2 {
    font-size: 1.22rem;
  }

  .book-stage {
    grid-template-columns: 42px minmax(0, auto) 42px;
    gap: 8px;
    padding: 18px 0;
  }

  .nav-button {
    width: 40px;
    height: 58px;
    font-size: 2.45rem;
  }

  .book {
    --book-pad-x: 16px;
    --book-pad-y: 12px;
    width: min(100%, calc((100vh - 142px) * 1.44), 680px) !important;
    max-width: 100% !important;
    min-width: min(100%, 460px) !important;
  }

  .book-footer {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .reading-room {
    padding-inline: 10px;
  }

  .book-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .book-stage {
    grid-template-areas:
      "book book"
      "prev next";
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .nav-button {
    background: rgba(36, 59, 50, 0.78);
  }

  .nav-prev {
    grid-area: prev;
    justify-self: end;
  }

  .nav-next {
    grid-area: next;
    justify-self: start;
  }

  .book {
    --book-pad-x: 10px;
    --book-pad-y: 8px;
    grid-area: book;
    justify-self: center;
    width: min(calc(100vw - 20px), calc((100vh - 190px) * 1.44)) !important;
    min-width: 0 !important;
  }

  .current-recipe h2 {
    font-size: 1.05rem;
  }
}
