:root {
  --brand-blue: #27336b;
  --brand-dark: #1b2450;
  --brand-yellow: #fcd617;
  --brand-green: #2fb34a;
  --accent: #0b67b6;
  --page-turn-duration: 600ms;
  --page: #ffffff;
  --paper: #fdfaf4;
  --ink: #1c2333;
  --muted: #5a667a;
  --line: #e3e8f1;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 8.4rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-kerning: normal;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at top, #f8fbff 0%, #eef3fb 45%, #e6eef9 100%);
  color: var(--ink);
  line-height: 1.6;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--brand-blue);
  color: #f7f9ff;
  border-bottom: 4px solid var(--brand-dark);
  box-shadow: 0 10px 24px rgba(20, 24, 45, 0.22);
}

.site-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.5rem 1.05rem 0.7rem;
}

.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  min-width: 0;
  flex: 1 1 auto;
}

.brand strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.brand span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.82;
}

.brand-logo {
  width: 132px;
  height: auto;
  background: #ffffff;
  padding: 0.25rem 0.42rem;
  border-radius: 10px;
}

.site-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.84rem;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-utility {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.site-nav a {
  color: #f7f9ff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.22rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.site-header .ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
  padding: 0.45rem 0.86rem;
}

.header-download {
  text-decoration: none;
}

.reader-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem 1.25rem;
  padding-top: 0.65rem;
  margin-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.reader-toolbar-copy {
  min-width: 0;
}

.reader-toolbar .kicker {
  color: rgba(255, 255, 255, 0.74);
  letter-spacing: 0.19em;
  font-size: 0.62rem;
}

.reader-toolbar .current-section-label {
  color: #ffffff;
  font-size: 0.94rem;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header .nav,
.site-header .ghost {
  border-color: rgba(255, 255, 255, 0.36);
  color: #ffffff;
}

.site-header .nav:hover,
.site-header .nav:focus,
.site-header .ghost:hover,
.site-header .ghost:focus {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.site-header .nav:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
}

.site-header .indicator {
  color: rgba(255, 255, 255, 0.9);
}

.site-header .progress {
  width: 116px;
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
}

.site-header .progress span {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96), #d4eb67);
}

.site-header .ghost:hover,
.site-header .ghost:focus {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.book-wrapper {
  max-width: 1180px;
  margin: 0.95rem auto 3rem;
  padding: 0 1.2rem;
}

.book-shell {
  background: var(--page);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-top: 5px solid var(--brand-blue);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 8.8rem;
}

.hero-panel {
  display: grid;
  gap: 0;
  margin: 0;
}

.hero-stage,
.overview-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 226, 241, 0.96);
  border-radius: 24px;
  box-shadow: 0 22px 48px rgba(16, 24, 40, 0.09);
  overflow: hidden;
}

.hero-stage {
  display: grid;
  grid-template-columns: minmax(258px, 286px) minmax(0, 1fr);
  align-items: center;
  column-gap: 1.15rem;
  padding: 0.9rem 1.1rem 0.95rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid rgba(205, 216, 236, 0.92);
  background:
    radial-gradient(circle at top left, rgba(47, 179, 74, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 255, 0.96));
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  min-width: 0;
  max-width: 26rem;
  justify-self: end;
}

.hero-copy h1 {
  margin: 0;
  font-family: "DM Serif Display", "Times New Roman", serif;
  font-size: clamp(1.72rem, 2.45vw, 2.6rem);
  line-height: 1.02;
  color: var(--brand-dark);
  max-width: 9ch;
}

.hero-sub {
  max-width: 40ch;
  font-size: 0.92rem;
  line-height: 1.72;
}

.hero-visual {
  display: grid;
  grid-column: 2;
  width: 100%;
  justify-items: flex-start;
  min-width: 0;
}

.hero-cover-card {
  position: relative;
  width: min(100%, 436px);
  aspect-ratio: 0.72;
  border-radius: 30px;
  overflow: hidden;
  background: #f6f9ff;
  box-shadow: 0 28px 56px rgba(24, 38, 72, 0.2);
  isolation: isolate;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
}

.hero-orb-green {
  width: 78%;
  height: 78%;
  top: -18%;
  left: -26%;
  background: #2f6918;
}

.hero-orb-yellow {
  width: 84%;
  height: 84%;
  top: -10%;
  right: -22%;
  background: var(--brand-yellow);
}

.hero-orb-blue {
  width: 120%;
  height: 58%;
  left: -14%;
  bottom: -18%;
  border-radius: 48% 52% 0 0;
  background: #223e7d;
}

.hero-cover-brand {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 2;
}

.hero-cover-brand img {
  width: 118px;
  height: auto;
  display: block;
}

.hero-cover-text {
  position: absolute;
  inset: auto 1.35rem 1.35rem 1.35rem;
  z-index: 2;
  display: grid;
  gap: 0.3rem;
  color: #ffffff;
}

.hero-cover-text span {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.hero-cover-text strong {
  display: block;
  font-family: "DM Serif Display", "Times New Roman", serif;
  font-size: 2.85rem;
  line-height: 0.92;
}

.hero-cover-text small {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.overview-panel {
  padding: 0.85rem 1rem 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
}

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.55rem;
}

.overview-head h2 {
  margin: 0.1rem 0 0;
  font-family: "DM Serif Display", "Times New Roman", serif;
  font-size: 1.38rem;
  line-height: 1.05;
  color: var(--brand-dark);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem 0.7rem;
}

.overview-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem;
  border: 1px solid rgba(214, 223, 239, 0.95);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-radius: 16px;
  padding: 0.72rem 0.78rem;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  box-shadow: 0 8px 18px rgba(30, 41, 59, 0.05);
}

.overview-card:hover,
.overview-card:focus-visible,
.overview-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(39, 51, 107, 0.45);
  box-shadow: 0 20px 36px rgba(24, 38, 72, 0.14);
  outline: none;
}

.overview-card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 12px;
  background:
    radial-gradient(circle at top, rgba(252, 214, 23, 0.24), transparent 58%),
    linear-gradient(160deg, #f4fff1 0%, #deefd3 100%);
  color: #2f6918;
  font-size: 1.08rem;
  line-height: 1;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(47, 105, 24, 0.1);
}

.overview-card-title {
  display: block;
  color: var(--brand-blue);
  font-weight: 700;
  line-height: 1.22;
  font-size: 0.86rem;
  align-self: center;
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
}

.sub {
  margin: 0;
  color: var(--muted);
  max-width: 58ch;
  font-size: 0.94rem;
}

.nav,
.ghost {
  border: 1px solid var(--brand-blue);
  background: transparent;
  color: var(--brand-blue);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.nav:hover,
.ghost:hover {
  background: var(--brand-blue);
  color: #ffffff;
}

.book-body {
  display: grid;
  grid-template-columns: minmax(258px, 286px) minmax(0, 1fr);
  gap: 1.15rem;
  padding: 1.02rem 1.35rem 1.72rem;
  background: linear-gradient(180deg, #f4f8ff 0%, #f9fbff 44%);
}

.book-stage {
  min-width: 0;
  display: grid;
}

.current-section-label {
  max-width: none;
  font-size: 0.98rem;
  color: var(--brand-dark);
}

.chapter-rail {
  position: sticky;
  top: 8.5rem;
  align-self: start;
  padding: 0.82rem 0.82rem 0.88rem;
  border: 1px solid rgba(214, 223, 239, 0.95);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.98));
  box-shadow: 0 14px 30px rgba(24, 38, 72, 0.08);
}

.chapter-rail-label {
  margin: 0 0 0.78rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.chapter-rail-list {
  display: grid;
  gap: 0.5rem;
  max-height: calc(100vh - 12.6rem);
  overflow: auto;
  padding-right: 0.1rem;
}

.chapter-pill {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.66rem;
  align-items: start;
  width: 100%;
  border: 1px solid rgba(214, 223, 239, 0.96);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  padding: 0.72rem 0.76rem;
  cursor: pointer;
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.chapter-pill:hover,
.chapter-pill:focus-visible,
.chapter-pill.is-active {
  transform: translateX(2px);
  border-color: rgba(39, 51, 107, 0.42);
  box-shadow: 0 16px 28px rgba(24, 38, 72, 0.12);
  outline: none;
}

.chapter-pill-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  min-height: 2.15rem;
  border-radius: 10px;
  background:
    radial-gradient(circle at top, rgba(252, 214, 23, 0.24), transparent 58%),
    linear-gradient(160deg, #f4fff1 0%, #deefd3 100%);
  box-shadow: inset 0 0 0 1px rgba(47, 105, 24, 0.1);
  color: #2f6918;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
}

.chapter-pill-title {
  color: var(--brand-dark);
  font-size: 0.82rem;
  line-height: 1.3;
  font-weight: 600;
}

.toc-panel {
  margin: 0;
  padding: 0 1.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}

.toc-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-blue);
  list-style: none;
  padding: 1rem 0 0.5rem;
}

.toc-panel summary::-webkit-details-marker {
  display: none;
}

.toc-list {
  display: grid;
  gap: 0.6rem;
  padding: 0.5rem 0 1rem;
}

.toc-empty {
  margin: 0.4rem 0 0.8rem;
  color: var(--muted);
}

.toc-item {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
  text-align: left;
}

.toc-item:hover,
.toc-item:focus {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(39, 51, 107, 0.15);
  outline: none;
}

.book-pages {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 0;
  perspective: 2400px;
  transform-style: preserve-3d;
  scroll-margin-top: 9.2rem;
}

.book-pages:not(.continuous) {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.book-pages.continuous {
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.book-pages.double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page {
  position: relative;
  padding: 1.65rem 1.85rem 2.15rem;
  background: #ffffff;
  color: var(--ink);
  border-radius: 12px;
  border: 1px solid #dfe6f1;
  box-shadow: 0 18px 30px rgba(32, 50, 92, 0.1);
  min-height: 420px;
  overflow: visible;
  opacity: 0;
  transform: translateX(26px) rotateY(-5deg);
  transform-origin: center center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, box-shadow 0.45s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  text-rendering: optimizeLegibility;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-yellow), var(--brand-green));
}

.page::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 24, 58, 0.08), transparent 11%, transparent 89%, rgba(10, 24, 58, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 18%);
  opacity: 0.7;
}

.full-book-page {
  min-height: auto;
}

.continuous-spread-page {
  padding: 0;
  border: none;
  box-shadow: 0 8px 24px rgba(32, 50, 92, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.continuous-spread-page::before,
.continuous-spread-page::after {
  display: none;
}

.continuous-spread-frame {
  width: 100%;
  line-height: 0;
  overflow: hidden;
}

.continuous-spread-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Half-page clip: the image is 200% wide so each half fills the container */
.continuous-half-clip {
  overflow: hidden;
}

.continuous-spread-page .continuous-half-clip img {
  width: 200%;
  height: auto;
  display: block;
}

.continuous-spread-page .continuous-half-clip.is-right img {
  margin-left: -100%;
}

.continuous-spread-single {
  max-width: var(--page-width, 680px);
  margin-left: auto;
  margin-right: auto;
}

.continuous-spread-half {
  max-width: var(--page-width, 680px);
  margin-left: auto;
  margin-right: auto;
}

.book-pages.continuous .continuous-spread-page {
  max-width: var(--page-width, 680px);
  margin-left: auto;
  margin-right: auto;
  transition: max-width 200ms ease;
}

.page-measure-rig {
  position: absolute;
  left: -99999px;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-measure {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 420px !important;
  opacity: 1 !important;
  visibility: hidden !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
  filter: none !important;
}

.page-turn-stage {
  position: relative;
  min-height: 420px;
  perspective: 3400px;
  transform-style: preserve-3d;
  overflow: visible;
  transform-origin: center center;
  background:
    radial-gradient(circle at 50% 54%, rgba(16, 24, 40, 0.08) 0%, rgba(16, 24, 40, 0.03) 24%, transparent 60%);
}

.page-turn-stage::before,
.page-turn-stage::after {
  content: "";
  position: absolute;
  inset: 20px 18px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(211, 220, 235, 0.85);
  box-shadow: 0 14px 28px rgba(18, 32, 68, 0.08);
  pointer-events: none;
}

.page-turn-stage::before {
  transform: translateY(10px) scale(0.992);
  opacity: 0.72;
}

.page-turn-stage::after {
  transform: translateY(5px) scale(0.996);
  opacity: 0.86;
}

.page-turn-stage-next {
  animation: stageDriftNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-turn-stage-prev {
  animation: stageDriftPrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-turn-spine {
  position: absolute;
  top: 18px;
  bottom: 12px;
  width: 76px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  filter: blur(1px);
}

.page-turn-spine-next {
  left: -10px;
  background:
    linear-gradient(90deg, rgba(10, 18, 38, 0.42) 0%, rgba(10, 18, 38, 0.2) 22%, rgba(10, 18, 38, 0.06) 46%, transparent 100%),
    radial-gradient(ellipse at left center, rgba(255, 255, 255, 0.24), transparent 48%);
}

.page-turn-spine-prev {
  right: -10px;
  background:
    linear-gradient(270deg, rgba(10, 18, 38, 0.42) 0%, rgba(10, 18, 38, 0.2) 22%, rgba(10, 18, 38, 0.06) 46%, transparent 100%),
    radial-gradient(ellipse at right center, rgba(255, 255, 255, 0.24), transparent 48%);
}

.page-turn-current,
.page-turn-next {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.page-turn-current {
  z-index: 3;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.page-turn-next {
  z-index: 1;
  opacity: 0;
  transform: scale(0.992) translateY(6px);
  filter: brightness(0.94) saturate(0.94);
}

.page-turn-decor {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.page-turn-decor-outgoing {
  z-index: 5;
  opacity: 0;
}

.page-turn-sheen {
  z-index: 6;
  opacity: 0;
  filter: blur(1px);
}

.page-turn-corner {
  top: 0;
  bottom: auto;
  width: 176px;
  height: 176px;
  inset-inline: auto 0;
  border-radius: 0 12px 0 0;
  opacity: 0;
  z-index: 7;
  clip-path: polygon(36% 0, 100% 0, 100% 70%, 64% 56%);
}

.page-turn-decor-incoming {
  z-index: 1;
  opacity: 0;
}

.page-turn-decor-next.page-turn-decor-outgoing {
  background:
    linear-gradient(90deg, rgba(9, 18, 43, 0.18) 0%, rgba(9, 18, 43, 0.06) 18%, transparent 38%, transparent 100%);
}

.page-turn-decor-prev.page-turn-decor-outgoing {
  background:
    linear-gradient(270deg, rgba(9, 18, 43, 0.18) 0%, rgba(9, 18, 43, 0.06) 18%, transparent 38%, transparent 100%);
}

.page-turn-sheen.page-turn-decor-next {
  background:
    linear-gradient(90deg, transparent 54%, rgba(255, 255, 255, 0.05) 70%, rgba(255, 255, 255, 0.68) 90%, rgba(255, 255, 255, 0.18) 100%);
}

.page-turn-sheen.page-turn-decor-prev {
  background:
    linear-gradient(270deg, transparent 54%, rgba(255, 255, 255, 0.05) 70%, rgba(255, 255, 255, 0.68) 90%, rgba(255, 255, 255, 0.18) 100%);
}

.page-turn-corner.page-turn-decor-next {
  right: 0;
  left: auto;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99) 0%, rgba(252, 253, 255, 0.94) 24%, rgba(230, 236, 246, 0.88) 46%, rgba(157, 170, 196, 0.56) 68%, rgba(32, 45, 76, 0.28) 100%);
  filter: drop-shadow(-18px 16px 20px rgba(17, 26, 46, 0.18));
  transform-origin: top right;
}

.page-turn-corner.page-turn-decor-prev {
  left: 0;
  right: auto;
  background:
    linear-gradient(225deg, rgba(255, 255, 255, 0.99) 0%, rgba(252, 253, 255, 0.94) 24%, rgba(230, 236, 246, 0.88) 46%, rgba(157, 170, 196, 0.56) 68%, rgba(32, 45, 76, 0.28) 100%);
  filter: drop-shadow(18px 16px 20px rgba(17, 26, 46, 0.18));
  transform-origin: top left;
  clip-path: polygon(0 0, 64% 0, 36% 56%, 0 70%);
}

.page-turn-decor-next.page-turn-decor-incoming {
  background:
    linear-gradient(90deg, rgba(10, 24, 58, 0.38) 0%, rgba(10, 24, 58, 0.18) 12%, rgba(255, 255, 255, 0.14) 28%, transparent 46%, transparent 100%),
    radial-gradient(circle at 0% 50%, rgba(255, 255, 255, 0.34), transparent 28%);
}

.page-turn-decor-prev.page-turn-decor-incoming {
  background:
    linear-gradient(270deg, rgba(10, 24, 58, 0.38) 0%, rgba(10, 24, 58, 0.18) 12%, rgba(255, 255, 255, 0.14) 28%, transparent 46%, transparent 100%),
    radial-gradient(circle at 100% 50%, rgba(255, 255, 255, 0.34), transparent 28%);
}

.book-pages.is-animating .page {
  transition: none;
}

.page-turn-current > :not(.page-turn-decor),
.page-turn-next > :not(.page-turn-decor) {
  position: relative;
  will-change: transform, opacity;
}

.page-flip-next {
  transform-origin: left center;
  animation: pageFlipNext var(--page-turn-duration) cubic-bezier(0.2, 0.82, 0.28, 0.98) forwards;
}

.page-flip-prev {
  transform-origin: right center;
  animation: pageFlipPrev var(--page-turn-duration) cubic-bezier(0.2, 0.82, 0.28, 0.98) forwards;
}

.page-reveal-next {
  animation: pageRevealNext var(--page-turn-duration) cubic-bezier(0.2, 0.82, 0.28, 0.98) forwards;
}

.page-reveal-prev {
  animation: pageRevealPrev var(--page-turn-duration) cubic-bezier(0.2, 0.82, 0.28, 0.98) forwards;
}

.page-flip-next .page-turn-decor-outgoing {
  animation: pageExitShadowNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-reveal-next .page-turn-decor-incoming {
  animation: pageCurlShadowNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-reveal-next .page-turn-sheen {
  animation: pageCurlSheenNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-reveal-next .page-turn-corner {
  animation: pageCornerNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-flip-prev .page-turn-decor-outgoing {
  animation: pageExitShadowPrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-reveal-prev .page-turn-decor-incoming {
  animation: pageCurlShadowPrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-reveal-prev .page-turn-sheen {
  animation: pageCurlSheenPrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-reveal-prev .page-turn-corner {
  animation: pageCornerPrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-turn-stage-next .page-turn-spine {
  animation: spinePulseNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-turn-stage-prev .page-turn-spine {
  animation: spinePulsePrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-flip-next > :not(.page-turn-decor) {
  animation: pageContentOutNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-reveal-next > :not(.page-turn-decor) {
  animation: pageContentInNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-flip-prev > :not(.page-turn-decor) {
  animation: pageContentOutPrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-reveal-prev > :not(.page-turn-decor) {
  animation: pageContentInPrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.cover-page::after {
  content: "";
}

.cover-page {
  padding: 0;
  background: #ffffff;
}

.page-number {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 0.78rem;
  color: #7a879b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page p {
  margin: 0 0 0.8rem;
  color: #1f242d;
  text-wrap: pretty;
}

.heading-anchor {
  position: relative;
  margin: 1.8rem 0 1rem;
  scroll-margin-top: 1.5rem;
}

.heading-anchor:first-child {
  margin-top: 0;
}

.heading-anchor-primary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 0.95rem;
  margin: 2.2rem 0 1.25rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid rgba(203, 214, 235, 0.96);
}

.heading-anchor-primary::before {
  content: attr(data-section-number);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.8rem;
  min-height: 3.8rem;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(252, 214, 23, 0.28), transparent 56%),
    linear-gradient(160deg, #f4fff1 0%, #d8efcf 54%, #b4df9d 100%);
  box-shadow:
    0 18px 34px rgba(47, 105, 24, 0.16),
    inset 0 0 0 1px rgba(47, 105, 24, 0.12);
  color: #2f6918;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}

.section-title {
  margin: 0 0 1rem;
  font-family: "DM Serif Display", "Times New Roman", serif;
  font-size: 1.3rem;
  color: var(--brand-blue);
  position: relative;
  clear: both;
  padding-bottom: 0.5rem;
}

.heading-anchor-primary .section-title {
  margin: 0;
  padding-bottom: 0.45rem;
  font-size: clamp(1.7rem, 2.1vw, 2.35rem);
  line-height: 0.98;
  color: var(--brand-dark);
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  background: var(--brand-yellow);
  border-radius: 999px;
}

.heading-anchor-primary .section-title::after {
  width: 88px;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-yellow), #86c54a);
}

.doc-list {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: #1f242d;
}

.doc-list li {
  margin-bottom: 0.4rem;
  text-align: justify;
  hyphens: auto;
}

.doc-paragraph {
  font-size: 0.98rem;
  line-height: 1.75;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.figure-caption {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1.45rem 0 0.55rem;
  padding: 0.55rem 0.9rem 0.55rem 0.75rem;
  border: 1px solid rgba(203, 214, 235, 0.95);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 255, 0.96));
  box-shadow: 0 12px 22px rgba(27, 36, 80, 0.08);
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}

.figure-caption::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand-yellow), #ffeb7a);
  box-shadow: 0 0 0 4px rgba(252, 214, 23, 0.18);
}

.source-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(210, 219, 235, 0.95);
  background: rgba(248, 250, 255, 0.95);
  box-shadow: 0 8px 16px rgba(27, 36, 80, 0.05);
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
}

.figure-caption + .doc-figure,
.figure-caption + .doc-table {
  margin-top: 0.5rem;
}

.doc-figure + .source-note,
.doc-table + .source-note {
  display: table;
  margin: -0.15rem 0 1.25rem auto;
}

.doc-figure {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 1rem 0 1.6rem;
  padding: 1.15rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.94), transparent 34%),
    radial-gradient(circle at bottom right, rgba(11, 103, 182, 0.08), transparent 30%),
    linear-gradient(165deg, #f8fbff 0%, #eef4fd 58%, #edf3ff 100%);
  border: 1px solid rgba(210, 221, 240, 0.95);
  box-shadow: 0 24px 44px rgba(27, 36, 80, 0.12);
}

.doc-figure::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.3)),
    radial-gradient(circle at 50% 100%, rgba(39, 51, 107, 0.06), transparent 42%);
  z-index: 0;
}

.doc-figure::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  z-index: 0;
  pointer-events: none;
}

.doc-figure img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 500px;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 0.95rem;
  border: 1px solid rgba(223, 232, 245, 0.98);
  box-shadow:
    0 18px 34px rgba(22, 34, 64, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.92);
}

.doc-figure img.is-zoomable {
  cursor: zoom-in;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
  touch-action: manipulation;
}

.doc-figure:hover img.is-zoomable,
.doc-figure img.is-zoomable:focus-visible {
  transform: translateY(-3px) scale(1.012);
  border-color: rgba(136, 168, 226, 0.98);
  box-shadow:
    0 24px 42px rgba(22, 34, 64, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.96);
  outline: none;
}

.doc-figure figcaption {
  position: relative;
  z-index: 1;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.superintendent-portrait {
  float: right;
  width: min(34%, 290px);
  min-width: 220px;
  max-width: 290px;
  margin: 0.15rem 0 1rem 1.35rem;
  padding: 0.72rem;
  background:
    radial-gradient(circle at top right, rgba(252, 214, 23, 0.18), transparent 28%),
    linear-gradient(165deg, #fdfefe 0%, #f2f6fd 58%, #eef4ff 100%);
  shape-outside: margin-box;
}

.superintendent-portrait::after {
  inset: 10px;
}

.superintendent-portrait .portrait-stage {
  position: relative;
  z-index: 1;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.28), transparent 40%),
    linear-gradient(180deg, #f5f7fb 0%, #edf2fb 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.82),
    0 18px 34px rgba(22, 34, 64, 0.14);
}

.superintendent-portrait .portrait-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 35%, rgba(19, 28, 54, 0.12) 100%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 30%);
  pointer-events: none;
}

.superintendent-portrait img {
  width: 100%;
  height: 100%;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: 69% center;
  background: transparent;
  box-shadow: none;
  filter: contrast(1.04) saturate(1.06) brightness(1.02);
}

.doc-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 0.74rem;
  margin: 0 0 1.35rem;
  word-break: normal;
  overflow-wrap: anywhere;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98));
  border: 1px solid rgba(214, 224, 241, 0.96);
  border-radius: 22px;
  box-shadow:
    0 24px 40px rgba(27, 36, 80, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  scrollbar-width: thin;
  scrollbar-color: rgba(39, 51, 107, 0.35) rgba(227, 232, 241, 0.9);
}

.doc-table th,
.doc-table td {
  border: 1px solid rgba(218, 227, 241, 0.92);
  padding: 0.45rem 0.52rem;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.9);
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 280px;
  min-width: 50px;
}

.doc-table tr:nth-child(even) td,
.doc-table tr:nth-child(even) th {
  background: rgba(245, 249, 255, 0.92);
}

.doc-table tr:hover td,
.doc-table tr:hover th {
  background: rgba(236, 244, 255, 0.96);
}

.doc-table tr:first-child:has(strong) td,
.doc-table tr:first-child:has(strong) th {
  background: linear-gradient(180deg, #e8f0ff 0%, #dbe8ff 100%);
  color: var(--brand-dark);
  font-weight: 700;
  border-color: rgba(194, 209, 236, 0.95);
}

.doc-table tr:first-child:has(strong) > :first-child {
  border-top-left-radius: 16px;
}

.doc-table tr:first-child:has(strong) > :last-child {
  border-top-right-radius: 16px;
}

.doc-table tr:last-child > :first-child {
  border-bottom-left-radius: 16px;
}

.doc-table tr:last-child > :last-child {
  border-bottom-right-radius: 16px;
}

.doc-table td strong,
.doc-table th strong {
  color: var(--brand-dark);
  font-weight: 700;
}

.doc-table p {
  margin: 0;
  line-height: 1.5;
}

.doc-table p + p {
  margin-top: 0.22rem;
}

.doc-table::-webkit-scrollbar {
  height: 10px;
}

.doc-table::-webkit-scrollbar-track {
  background: rgba(227, 232, 241, 0.92);
  border-radius: 999px;
}

.doc-table::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(39, 51, 107, 0.58), rgba(11, 103, 182, 0.42));
  border-radius: 999px;
}

.doc-table::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(39, 51, 107, 0.72), rgba(11, 103, 182, 0.56));
}

.panel-dashboard-block {
  margin: 1.25rem 0 1.8rem;
}

.panel-dashboard {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(47, 179, 74, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(252, 214, 23, 0.18), transparent 30%),
    linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
  border: 1px solid rgba(206, 219, 241, 0.95);
  box-shadow:
    0 28px 48px rgba(27, 36, 80, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.panel-dashboard-hero {
  display: grid;
  gap: 0.4rem;
}

.panel-dashboard-hero h3 {
  margin: 0;
  font-family: "DM Serif Display", "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  line-height: 1.08;
  color: var(--brand-dark);
}

.panel-dashboard-hero p:last-child {
  margin: 0;
  color: var(--muted);
}

.panel-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.panel-summary-card {
  display: grid;
  gap: 0.28rem;
  padding: 0.9rem 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(213, 223, 241, 0.96);
}

.panel-summary-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7891;
}

.panel-summary-value {
  font-size: 1.7rem;
  color: var(--brand-dark);
}

.panel-dashboard-toolbar {
  display: grid;
  gap: 0.8rem;
  align-items: end;
}

.panel-search-field {
  display: grid;
  gap: 0.45rem;
}

.panel-search-field span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-dark);
}

.panel-search-field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(194, 209, 236, 0.98);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.panel-search-field input:focus {
  outline: none;
  border-color: rgba(11, 103, 182, 0.7);
  box-shadow: 0 0 0 4px rgba(11, 103, 182, 0.12);
}

.panel-search-status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.panel-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.panel-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 0.88rem;
  border-radius: 999px;
  border: 1px solid rgba(194, 209, 236, 0.98);
  background: rgba(255, 255, 255, 0.86);
  color: var(--brand-dark);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.panel-filter-chip:hover,
.panel-filter-chip:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(11, 103, 182, 0.38);
  outline: none;
}

.panel-filter-chip.is-active {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
}

.panel-filter-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.15rem 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  letter-spacing: 0.08em;
  font-size: 0.68rem;
}

.panel-risk-grid {
  display: grid;
  gap: 1rem;
}

.panel-risk-group {
  display: grid;
  gap: 0.95rem;
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(214, 224, 241, 0.98);
}

.panel-risk-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.panel-risk-copy {
  display: grid;
  gap: 0.25rem;
}

.panel-risk-copy h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--brand-dark);
}

.panel-risk-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-risk-code {
  display: inline-flex;
  width: fit-content;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  background: rgba(39, 51, 107, 0.08);
  color: var(--brand-blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.panel-risk-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-risk-badge.is-risco-alto {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.panel-risk-badge.is-risco-medio {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.panel-risk-actions {
  display: grid;
  gap: 0.85rem;
}

.panel-action-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.96));
  border: 1px solid rgba(216, 226, 242, 0.98);
  box-shadow: 0 14px 28px rgba(27, 36, 80, 0.08);
}

.panel-action-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: #60708c;
}

.panel-action-label,
.panel-action-period {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-action-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--brand-dark);
}

.panel-action-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  margin: 0;
}

.panel-action-meta div {
  display: grid;
  gap: 0.15rem;
}

.panel-action-meta dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7891;
}

.panel-action-meta dd {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink);
}

.panel-metric-list {
  display: grid;
  gap: 0.7rem;
}

.panel-metric-row {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(221, 229, 241, 0.96);
}

.panel-metric-title,
.panel-metric-copy {
  margin: 0;
}

.panel-metric-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7891;
}

.panel-metric-copy {
  color: var(--ink);
  line-height: 1.55;
}

.panel-thresholds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.panel-threshold {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.34rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.panel-threshold.ideal {
  background: rgba(47, 179, 74, 0.14);
  color: #1f6a31;
}

.panel-threshold.alert {
  background: rgba(252, 214, 23, 0.2);
  color: #7a6008;
}

.panel-threshold.critical {
  background: rgba(239, 68, 68, 0.14);
  color: #9f1239;
}

.panel-threshold.neutral {
  background: rgba(39, 51, 107, 0.08);
  color: var(--brand-blue);
}

.approval-note {
  margin: 0.35rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(246, 249, 255, 0.94);
  border: 1px solid rgba(214, 224, 241, 0.98);
  color: var(--muted);
}

.note-block {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: rgba(39, 51, 107, 0.08);
  border: 1px solid rgba(39, 51, 107, 0.2);
  font-weight: 600;
  color: var(--brand-dark);
}

.table-block {
  background: #f8f6ef;
  border: 1px dashed #d9ccb8;
  padding: 0.9rem;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  margin: 0 0 1rem;
}

.risk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.step-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(39, 51, 107, 0.12);
  color: var(--brand-dark);
}

.risk-high {
  background: rgba(229, 62, 62, 0.14);
  color: #9b1c1c;
}

.risk-mid {
  background: rgba(245, 158, 11, 0.18);
  color: #a16207;
}

.risk-low {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.risk-code {
  display: inline-block;
  font-weight: 700;
  color: var(--brand-dark);
}

.cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 420px;
}

.cover-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.cover-mark {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.cover-logo {
  width: 260px;
  height: auto;
  background: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(39, 51, 107, 0.12);
}

.cover-star {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--brand-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  font-size: 1.6rem;
  box-shadow: 0 10px 20px rgba(39, 51, 107, 0.2);
}

.cover-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cover-bars .bar {
  display: block;
  width: 70px;
  height: 6px;
  border-radius: 999px;
}

.bar-blue {
  background: var(--brand-blue);
}

.bar-yellow {
  background: var(--brand-yellow);
}

.bar-green {
  background: var(--brand-green);
}

.cover-meta {
  font-size: 0.86rem;
  color: var(--muted);
  text-align: right;
}

.cover-title {
  text-align: center;
}

.cover-title p {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.cover-title h2 {
  margin: 0;
  font-family: "DM Serif Display", "Times New Roman", serif;
  font-size: 2.4rem;
  color: var(--brand-dark);
}

.cover-title h3 {
  margin: 0.4rem 0 0;
  font-size: 1.1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.cover-colorful {
  position: relative;
  display: block;
  width: 100%;
  min-height: 420px;
  height: 100%;
  padding: 1.45rem;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(98, 166, 78, 0.14), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
}

.cover-color-shape {
  position: absolute;
  border-radius: 999px;
}

.cover-color-shape-green {
  width: 52%;
  height: 62%;
  top: -12%;
  left: -14%;
  background: #2f6918;
}

.cover-color-shape-yellow {
  width: 58%;
  height: 72%;
  top: -8%;
  right: -16%;
  background: var(--brand-yellow);
}

.cover-color-shape-blue {
  width: 124%;
  height: 52%;
  left: -12%;
  bottom: -14%;
  border-radius: 52% 52% 0 0;
  background: #2b4788;
}

.cover-brand-panel {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
}

.cover-logo-colorful {
  width: 128px;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  box-shadow: 0 16px 32px rgba(16, 24, 40, 0.12);
}

.cover-copy {
  position: absolute;
  left: 1.35rem;
  right: 1.35rem;
  bottom: 3.25rem;
  z-index: 2;
  display: grid;
  gap: 0.3rem;
  color: #ffffff;
}

.cover-copy span {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.cover-copy h2 {
  margin: 0;
  font-family: "DM Serif Display", "Times New Roman", serif;
  font-size: 3.3rem;
  line-height: 0.9;
  color: #ffffff;
}

.cover-copy strong {
  font-size: 1.05rem;
  letter-spacing: 0.18em;
}

.cover-footer-colorful {
  position: absolute;
  left: 1.35rem;
  right: 1.35rem;
  bottom: 0.95rem;
  z-index: 2;
  border-top-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.92);
  padding-top: 0.65rem;
}

.book-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.book-controls.is-continuous {
  justify-content: flex-end;
}

.book-controls.is-continuous .nav {
  display: none;
}

.indicator {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  min-width: 196px;
  justify-content: flex-end;
  font-size: 0.88rem;
}

.progress {
  width: 136px;
  height: 8px;
  background: #e6ebf5;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue), var(--accent));
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.page.is-visible {
  opacity: 1;
  transform: translateX(0) rotateY(0deg);
}

.flow-anchor {
  scroll-margin-top: 9.2rem;
}

.book-pages[data-direction="prev"] .page:not(.is-visible) {
  transform: translateX(-26px) rotateY(5deg);
}

@keyframes pageFlipNext {
  0% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0) translateY(0) scaleX(1) scaleY(1);
    box-shadow: 0 20px 36px rgba(32, 50, 92, 0.12);
    filter: brightness(1);
  }
  22% {
    opacity: 1;
    transform: rotateY(-10deg) translateX(-1px) translateY(1px) scaleX(0.999) scaleY(1);
    box-shadow: -8px 24px 42px rgba(10, 24, 58, 0.16);
    filter: brightness(0.97);
  }
  46% {
    opacity: 1;
    transform: rotateY(-42deg) translateX(-4px) translateY(0) scaleX(0.992) scaleY(0.998);
    box-shadow: -18px 24px 48px rgba(10, 24, 58, 0.18);
    filter: brightness(0.93);
  }
  72% {
    opacity: 1;
    transform: rotateY(-96deg) translateX(-10px) translateY(-1px) scaleX(0.985) scaleY(0.996);
    box-shadow: -32px 26px 60px rgba(10, 24, 58, 0.24);
    filter: brightness(0.88);
  }
  100% {
    opacity: 0;
    transform: rotateY(-162deg) translateX(-14px) translateY(-1px) scaleX(0.982) scaleY(0.994);
    box-shadow: -44px 28px 66px rgba(10, 24, 58, 0.26);
    filter: brightness(0.8);
  }
}

@keyframes stageDriftNext {
  0% {
    transform: translateX(0) rotateX(0deg) scale(1);
  }
  30% {
    transform: translateX(-4px) rotateX(0.6deg) scale(1.002);
  }
  68% {
    transform: translateX(3px) rotateX(-0.3deg) scale(0.998);
  }
  100% {
    transform: translateX(0) rotateX(0deg) scale(1);
  }
}

@keyframes stageDriftPrev {
  0% {
    transform: translateX(0) rotateX(0deg) scale(1);
  }
  30% {
    transform: translateX(4px) rotateX(0.6deg) scale(1.002);
  }
  68% {
    transform: translateX(-3px) rotateX(-0.3deg) scale(0.998);
  }
  100% {
    transform: translateX(0) rotateX(0deg) scale(1);
  }
}

@keyframes pageRevealNext {
  0% {
    opacity: 0;
    transform: rotateY(18deg) skewY(5deg) scaleX(0.88) scaleY(0.998) translateY(8px) translateX(18px);
    box-shadow: 0 14px 28px rgba(18, 32, 68, 0.08);
    filter: brightness(0.94);
  }
  68% {
    opacity: 0;
    transform: rotateY(18deg) skewY(5deg) scaleX(0.88) scaleY(0.998) translateY(8px) translateX(18px);
    box-shadow: 0 14px 28px rgba(18, 32, 68, 0.08);
    filter: brightness(0.94);
  }
  84% {
    opacity: 0.52;
    transform: rotateY(10deg) skewY(3deg) scaleX(0.948) scaleY(0.998) translateY(4px) translateX(8px);
    box-shadow: 0 18px 30px rgba(18, 32, 68, 0.1);
  filter: brightness(0.98);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) skewY(0deg) scaleX(1) scaleY(1) translateY(0) translateX(0);
    box-shadow: 0 20px 36px rgba(32, 50, 92, 0.12);
    filter: brightness(1);
  }
}

body.lightbox-open {
  overflow: hidden;
}

.figure-lightbox[hidden] {
  display: none;
}

.figure-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.figure-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.figure-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(47, 63, 116, 0.3), transparent 32%),
    rgba(8, 12, 24, 0.72);
  backdrop-filter: blur(12px);
}

.figure-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-radius: 28px;
  border: 1px solid rgba(194, 205, 232, 0.28);
  background:
    linear-gradient(180deg, rgba(14, 20, 38, 0.92), rgba(10, 15, 30, 0.88)),
    rgba(15, 20, 37, 0.9);
  box-shadow:
    0 28px 64px rgba(6, 10, 22, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.figure-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0.1rem 0;
  color: #f4f7ff;
}

.figure-lightbox-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.figure-lightbox-meta strong {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.figure-lightbox-meta span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 600;
}

.figure-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lightbox-btn {
  border-color: rgba(255, 255, 255, 0.18);
  color: #f4f7ff;
  background: rgba(255, 255, 255, 0.06);
  min-width: 52px;
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
  outline: none;
}

.figure-lightbox-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(192, 205, 233, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.09), transparent 58%),
    rgba(4, 8, 18, 0.72);
  display: grid;
  place-items: center;
  cursor: default;
}

.figure-lightbox-stage.is-zoomed {
  cursor: grab;
}

.figure-lightbox-stage.is-dragging {
  cursor: grabbing;
}

.figure-lightbox-stage img {
  max-width: min(100%, 1000px);
  max-height: calc(100vh - 13rem);
  width: auto;
  height: auto;
  display: block;
  border-radius: 18px;
  background: #ffffff;
  padding: 0.9rem;
  border: 1px solid rgba(219, 229, 245, 0.96);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.95);
  transform-origin: center center;
  transition: transform 180ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

body.print-mode {
  background: #ffffff;
}

body.print-mode .site-header,
body.print-mode .hero-panel,
body.print-mode .toc-panel,
body.print-mode .chapter-rail,
body.print-mode .book-status,
body.print-mode .book-controls,
body.print-mode .figure-lightbox {
  display: none;
}

body.print-mode .book-wrapper {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.print-mode .book-shell {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.print-mode .book-body {
  padding: 0;
  background: #ffffff;
}

body.print-mode .book-pages {
  display: block;
  max-width: none;
  margin: 0;
  perspective: none;
}

body.print-mode .page,
body.print-mode .full-book-page {
  opacity: 1;
  transform: none;
  transition: none;
  box-shadow: none;
  border: 0;
  border-radius: 0;
}

body.print-mode .page::after,
body.print-mode .page-number,
body.print-mode .cover-page::before {
  display: none;
}

body.print-mode .page::before {
  height: 4px;
}

body.print-mode .full-book-page {
  padding: 0 0 1.2rem;
}

@page {
  size: A4;
  margin: 14mm 12mm 16mm;
}

@media print {
  body {
    background: #ffffff;
  }

  .site-header,
  .toc-panel,
  .book-controls {
    display: none !important;
  }

  .book-wrapper {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .book-shell {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .book-body {
    padding: 0;
    background: #ffffff;
  }

  .book-pages {
    display: block;
    max-width: none;
    margin: 0;
    perspective: none;
  }

  .page,
  .full-book-page {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .page::after,
  .page-number,
  .cover-page::before {
    display: none;
  }

  .page::before {
    height: 4px;
  }

  .full-book-page {
    padding: 0 0 1.2rem;
  }
}

@keyframes pageFlipPrev {
  0% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0) translateY(0) scaleX(1) scaleY(1);
    box-shadow: 0 20px 36px rgba(32, 50, 92, 0.12);
    filter: brightness(1);
  }
  22% {
    opacity: 1;
    transform: rotateY(10deg) translateX(1px) translateY(1px) scaleX(0.999) scaleY(1);
    box-shadow: 8px 24px 42px rgba(10, 24, 58, 0.16);
    filter: brightness(0.97);
  }
  46% {
    opacity: 1;
    transform: rotateY(42deg) translateX(4px) translateY(0) scaleX(0.992) scaleY(0.998);
    box-shadow: 18px 24px 48px rgba(10, 24, 58, 0.18);
    filter: brightness(0.93);
  }
  72% {
    opacity: 1;
    transform: rotateY(96deg) translateX(10px) translateY(-1px) scaleX(0.985) scaleY(0.996);
    box-shadow: 32px 26px 60px rgba(10, 24, 58, 0.24);
    filter: brightness(0.88);
  }
  100% {
    opacity: 0;
    transform: rotateY(162deg) translateX(14px) translateY(-1px) scaleX(0.982) scaleY(0.994);
    box-shadow: 44px 28px 66px rgba(10, 24, 58, 0.26);
    filter: brightness(0.8);
  }
}

@keyframes pageRevealPrev {
  0% {
    opacity: 0;
    transform: rotateY(-18deg) skewY(-5deg) scaleX(0.88) scaleY(0.998) translateY(8px) translateX(-18px);
    box-shadow: 0 14px 28px rgba(18, 32, 68, 0.08);
    filter: brightness(0.94);
  }
  68% {
    opacity: 0;
    transform: rotateY(-18deg) skewY(-5deg) scaleX(0.88) scaleY(0.998) translateY(8px) translateX(-18px);
    box-shadow: 0 14px 28px rgba(18, 32, 68, 0.08);
    filter: brightness(0.94);
  }
  84% {
    opacity: 0.52;
    transform: rotateY(-10deg) skewY(-3deg) scaleX(0.948) scaleY(0.998) translateY(4px) translateX(-8px);
    box-shadow: 0 18px 30px rgba(18, 32, 68, 0.1);
    filter: brightness(0.98);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) skewY(0deg) scaleX(1) scaleY(1) translateY(0) translateX(0);
    box-shadow: 0 20px 36px rgba(32, 50, 92, 0.12);
    filter: brightness(1);
  }
}

@keyframes pageExitShadowNext {
  0% {
    opacity: 0.05;
  }
  56% {
    opacity: 0.12;
  }
  100% {
    opacity: 0;
  }
}

@keyframes pageCurlShadowNext {
  0% {
    opacity: 0.04;
    transform: translateX(-4px) scaleX(1.02);
  }
  42% {
    opacity: 0.18;
    transform: translateX(-1px) scaleX(1);
  }
  76% {
    opacity: 0.44;
    transform: translateX(8px) scaleX(0.94);
  }
  100% {
    opacity: 0;
    transform: translateX(16px) scaleX(0.88);
  }
}

@keyframes pageCurlSheenNext {
  0% {
    opacity: 0;
    transform: translateX(-6px) scaleX(1.04);
  }
  30% {
    opacity: 0.08;
    transform: translateX(0) scaleX(1);
  }
  66% {
    opacity: 0.42;
    transform: translateX(10px) scaleX(0.92);
  }
  100% {
    opacity: 0;
    transform: translateX(18px) scaleX(0.88);
  }
}

@keyframes pageCornerNext {
  0% {
    opacity: 0;
    transform: translateY(-8px) rotate(0deg) scale(0.8);
  }
  72% {
    opacity: 0;
    transform: translateY(-4px) rotate(0deg) scale(0.86);
  }
  86% {
    opacity: 0.82;
    transform: translateY(0) rotate(-12deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(6px) rotate(-26deg) scale(1.06);
  }
}

@keyframes pageContentOutNext {
  0% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
  64% {
    opacity: 1;
    transform: translateX(-4px) translateY(0);
  }
  100% {
    opacity: 0.92;
    transform: translateX(-8px) translateY(-1px);
  }
}

@keyframes pageContentInNext {
  0% {
    opacity: 0;
    transform: translateX(22px) translateY(3px);
  }
  70% {
    opacity: 0;
    transform: translateX(22px) translateY(3px);
  }
  88% {
    opacity: 0.8;
    transform: translateX(10px) translateY(1px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes pageExitShadowPrev {
  0% {
    opacity: 0.05;
  }
  56% {
    opacity: 0.12;
  }
  100% {
    opacity: 0;
  }
}

@keyframes pageCurlShadowPrev {
  0% {
    opacity: 0.04;
    transform: translateX(4px) scaleX(1.02);
  }
  42% {
    opacity: 0.18;
    transform: translateX(1px) scaleX(1);
  }
  76% {
    opacity: 0.44;
    transform: translateX(-8px) scaleX(0.94);
  }
  100% {
    opacity: 0;
    transform: translateX(-16px) scaleX(0.88);
  }
}

@keyframes pageCurlSheenPrev {
  0% {
    opacity: 0;
    transform: translateX(6px) scaleX(1.04);
  }
  30% {
    opacity: 0.08;
    transform: translateX(0) scaleX(1);
  }
  66% {
    opacity: 0.42;
    transform: translateX(-10px) scaleX(0.92);
  }
  100% {
    opacity: 0;
    transform: translateX(-18px) scaleX(0.88);
  }
}

@keyframes pageCornerPrev {
  0% {
    opacity: 0;
    transform: translateY(-8px) rotate(0deg) scale(0.8);
  }
  72% {
    opacity: 0;
    transform: translateY(-4px) rotate(0deg) scale(0.86);
  }
  86% {
    opacity: 0.82;
    transform: translateY(0) rotate(12deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(6px) rotate(26deg) scale(1.06);
  }
}

@keyframes pageContentOutPrev {
  0% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
  64% {
    opacity: 1;
    transform: translateX(4px) translateY(0);
  }
  100% {
    opacity: 0.92;
    transform: translateX(8px) translateY(-1px);
  }
}

@keyframes pageContentInPrev {
  0% {
    opacity: 0;
    transform: translateX(-22px) translateY(3px);
  }
  70% {
    opacity: 0;
    transform: translateX(-22px) translateY(3px);
  }
  88% {
    opacity: 0.8;
    transform: translateX(-10px) translateY(1px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes spinePulseNext {
  0% {
    opacity: 0;
    transform: translateX(-4px) scaleY(0.96);
  }
  56% {
    opacity: 0.22;
    transform: translateX(0) scaleY(1);
  }
  84% {
    opacity: 0.52;
    transform: translateX(6px) scaleY(1.02);
  }
  100% {
    opacity: 0;
    transform: translateX(10px) scaleY(1.03);
  }
}

@keyframes spinePulsePrev {
  0% {
    opacity: 0;
    transform: translateX(4px) scaleY(0.96);
  }
  56% {
    opacity: 0.22;
    transform: translateX(0) scaleY(1);
  }
  84% {
    opacity: 0.52;
    transform: translateX(-6px) scaleY(1.02);
  }
  100% {
    opacity: 0;
    transform: translateX(-10px) scaleY(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .page-flip-next,
  .page-flip-prev,
  .page-reveal-next,
  .page-reveal-prev {
    animation: none;
  }
}

@media (max-width: 900px) {
  .site-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-actions {
    width: 100%;
    align-items: center;
    justify-content: space-between;
  }

  .reader-toolbar {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .reader-toolbar .current-section-label {
    white-space: normal;
  }

  .book-controls {
    width: 100%;
    justify-content: space-between;
  }

  .hero-stage {
    grid-template-columns: 1fr;
    padding: 0.92rem 0.95rem 0.98rem;
  }

  .hero-copy {
    max-width: none;
    justify-self: stretch;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .hero-visual {
    justify-items: center;
  }

  .overview-panel {
    padding: 1rem 1.05rem 1.1rem;
  }

  .overview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-body {
    grid-template-columns: 1fr;
    padding: 1.1rem;
  }

  .chapter-rail {
    position: static;
    top: auto;
    padding: 0.82rem;
  }

  .chapter-rail-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding: 0.1rem 0 0.35rem;
  }

  .chapter-pill:hover,
  .chapter-pill:focus-visible,
  .chapter-pill.is-active {
    transform: translateY(-2px);
  }

  .heading-anchor-primary {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0.7rem;
  }

  .heading-anchor-primary::before {
    min-width: 3.3rem;
    min-height: 3.3rem;
    font-size: 1.55rem;
  }

  .book-pages.double {
    grid-template-columns: 1fr;
  }

  .cover-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .cover-meta {
    text-align: left;
  }

  .doc-table {
    display: block;
    overflow-x: auto;
  }

  .superintendent-portrait {
    float: none;
    width: min(100%, 360px);
    max-width: 360px;
    margin: 0.8rem auto 1.3rem;
  }

  .figure-lightbox-dialog {
    width: min(100%, 980px);
  }
}

@media (max-width: 600px) {
  .site-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .header-utility {
    width: 100%;
    flex-wrap: wrap;
  }

  .hero-stage,
  .overview-panel {
    padding: 0.88rem;
  }

  .hero-cover-card {
    width: min(100%, 300px);
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .book-body,
  .toc-panel {
    padding: 1.4rem;
  }

  .chapter-rail-list {
    grid-auto-columns: minmax(190px, 78vw);
  }

  .chapter-pill {
    padding: 0.72rem 0.75rem;
  }

  .chapter-pill-number {
    min-width: 2.1rem;
    font-size: 1.15rem;
  }

  .book-controls {
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .indicator {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  .heading-anchor {
    margin-top: 1.45rem;
  }

  .heading-anchor-primary {
    margin-top: 1.75rem;
    padding-bottom: 0.8rem;
  }

  .heading-anchor-primary::before {
    min-width: 2.85rem;
    min-height: 2.85rem;
    border-radius: 16px;
    font-size: 1.3rem;
  }

  .section-title {
    font-size: 1.14rem;
  }

  .heading-anchor-primary .section-title {
    font-size: 1.5rem;
  }

  .cover-title h2 {
    font-size: 2rem;
  }

  .figure-lightbox {
    padding: 0.8rem;
  }

  .figure-lightbox-dialog {
    max-height: calc(100vh - 1.6rem);
    padding: 0.8rem;
    border-radius: 22px;
  }

  .figure-lightbox-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .figure-lightbox-meta {
    justify-content: space-between;
  }

  .figure-lightbox-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .lightbox-btn {
    flex: 1 1 44%;
  }

.figure-lightbox-stage img {
    max-height: calc(100vh - 16rem);
    padding: 0.65rem;
  }
}

/* Flipbook layout refresh */
body {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 252, 0.96) 48%, rgba(241, 243, 247, 0.98) 100%),
    radial-gradient(circle, rgba(39, 51, 107, 0.07) 0.8px, transparent 0.8px);
  background-size: auto, 18px 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-dark);
  border-bottom: 1px solid rgba(203, 210, 224, 0.9);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
}

.site-inner {
  max-width: 1360px;
  padding: 0.75rem 1.3rem;
}

.viewer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.viewer-title {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header .current-section-label {
  margin: 0;
  color: #6c7488;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flipbook-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.8rem 1.3rem 2.2rem;
}

.flipbook-stage {
  position: relative;
  min-height: calc(100vh - 180px);
  display: grid;
  align-items: center;
}

.book-pages-shell {
  width: 100%;
  min-height: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 4.5rem;
}

.book-pages {
  width: min(100%, 760px);
  margin: 0 auto;
}

.book-pages:not(.continuous) {
  max-width: 760px;
}

.book-pages.continuous {
  width: min(100%, calc(var(--page-width, 680px) + 4rem));
  gap: 1.4rem;
}

.book-controls {
  width: fit-content;
  margin: 1.3rem auto 0;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(213, 219, 232, 0.95);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 38px rgba(20, 24, 45, 0.08);
  backdrop-filter: blur(10px);
}

.toolbar-btn,
.toc-close {
  border: 1px solid rgba(198, 206, 223, 0.95);
  background: #ffffff;
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.toolbar-btn:hover,
.toolbar-btn:focus-visible,
.toc-close:hover,
.toc-close:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(39, 51, 107, 0.38);
  box-shadow: 0 10px 22px rgba(20, 24, 45, 0.1);
  outline: none;
}

.header-download {
  text-decoration: none;
}

.indicator {
  min-width: 9.6rem;
  gap: 0.35rem;
}

.indicator #page-indicator {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #66708a;
}

.progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(154, 165, 186, 0.2);
}

.progress span {
  background: linear-gradient(90deg, #1f4d9f 0%, #2f6918 45%, #f0cc16 100%);
}

.page-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 3.15rem;
  height: 3.15rem;
  border: 1px solid rgba(208, 214, 227, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-dark);
  box-shadow: 0 16px 30px rgba(20, 24, 45, 0.08);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.page-arrow:hover,
.page-arrow:focus-visible {
  transform: translateY(-50%) scale(1.03);
  outline: none;
}

.page-arrow:disabled {
  opacity: 0;
  cursor: default;
  pointer-events: none;
}

.page-arrow-prev {
  left: 1rem;
}

.page-arrow-next {
  right: 1rem;
}

.toc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 59;
  border: 0;
  background: rgba(13, 18, 34, 0.26);
  opacity: 0;
  transition: opacity 180ms ease;
}

.toc-backdrop.is-open {
  opacity: 1;
}

.toc-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: min(370px, 88vw);
  height: 100vh;
  padding: 1.2rem 1rem 1rem;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.9rem;
  background: rgba(255, 255, 255, 0.97);
  border-right: 1px solid rgba(213, 219, 232, 0.95);
  box-shadow: 0 24px 48px rgba(20, 24, 45, 0.12);
  backdrop-filter: blur(14px);
  transform: translateX(-102%);
  transition: transform 220ms ease;
}

.toc-drawer.is-open {
  transform: translateX(0);
}

.toc-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.chapter-rail-label {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7280a0;
  font-weight: 700;
}

.chapter-rail-list {
  display: grid;
  gap: 0.55rem;
  overflow: auto;
  padding-right: 0.1rem;
}

.chapter-pill {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  width: 100%;
  padding: 0.78rem 0.82rem;
  border: 1px solid rgba(218, 224, 236, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.chapter-pill:hover,
.chapter-pill:focus-visible,
.chapter-pill.is-active {
  border-color: rgba(39, 51, 107, 0.42);
  box-shadow: 0 12px 24px rgba(20, 24, 45, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.chapter-pill-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  border-radius: 12px;
  background: linear-gradient(160deg, #f2ffe8 0%, #dfeecf 100%);
  color: #38691d;
  font-size: 0.9rem;
  font-weight: 700;
}

.chapter-pill-title {
  color: #2f3955;
  font-size: 0.78rem;
  line-height: 1.28;
  font-weight: 600;
}

.page {
  min-height: clamp(840px, 78vh, 980px);
  padding: 2.4rem 2.5rem 2.85rem;
  border: 0;
  border-radius: 6px;
  background: #fffefb;
  box-shadow: 0 28px 60px rgba(20, 24, 45, 0.12);
  overflow: visible;
  overflow-x: clip;
}

.page::before,
.page::after,
.page-turn-stage::before,
.page-turn-stage::after {
  display: none;
}

.page-turn-stage {
  background: none;
  perspective: 2600px;
}

.page-number {
  top: 0.9rem;
  right: 1.1rem;
  color: #9ba4b6;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cover-page {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.cover {
  min-height: clamp(840px, 78vh, 980px);
}

.cover-reference-page {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 28px 60px rgba(20, 24, 45, 0.12);
}

.cover-reference-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-swap-stage {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto;
}

.page-swap-page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

.page-swap-incoming {
  z-index: 1;
}

.page-swap-outgoing {
  z-index: 2;
}

.page-swap-stage.is-next .page-swap-incoming {
  animation: pageSwapInNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-swap-stage.is-next .page-swap-outgoing {
  animation: pageSwapOutNext var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-swap-stage.is-prev .page-swap-incoming {
  animation: pageSwapInPrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

.page-swap-stage.is-prev .page-swap-outgoing {
  animation: pageSwapOutPrev var(--page-turn-duration) cubic-bezier(0.22, 0.84, 0.28, 0.98) forwards;
}

@keyframes pageSwapInNext {
  from {
    opacity: 0;
    transform: translateX(34px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes pageSwapOutNext {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-22px) scale(0.996);
  }
}

@keyframes pageSwapInPrev {
  from {
    opacity: 0;
    transform: translateX(-34px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes pageSwapOutPrev {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(22px) scale(0.996);
  }
}

@media (max-width: 900px) {
  .viewer-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .flipbook-shell {
    padding: 1.15rem 0.8rem 1.8rem;
  }

  .flipbook-stage {
    min-height: auto;
  }

  .book-pages-shell {
    padding: 0 1.3rem;
  }

  .page-arrow {
    width: 2.7rem;
    height: 2.7rem;
  }

  .page-arrow-prev {
    left: 0;
  }

  .page-arrow-next {
    right: 0;
  }
}

@media (max-width: 640px) {
  .site-inner {
    padding: 0.72rem 0.9rem;
  }

  .viewer-title,
  .site-header .current-section-label {
    font-size: 0.64rem;
    line-height: 1.4;
  }

  .book-pages-shell {
    padding: 0;
  }

  .page-arrow {
    position: static;
    transform: none;
    width: 2.6rem;
    height: 2.6rem;
  }

  .flipbook-stage {
    gap: 0.85rem;
  }

  .book-controls {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 24px;
  }

  .indicator {
    min-width: 100%;
  }

  .page {
    min-height: 0;
    padding: 1.35rem 1.05rem 1.8rem;
  }

  .cover {
    min-height: 580px;
  }
}

/* Utility: measure rig for height probing */
.page-measure-rig {
  position: absolute;
  left: -9999px;
  top: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
}

/* Ensure swap pages don't clip tall content during animation */
.page-swap-page {
  overflow: visible;
}

/* Better table responsiveness for large tables */
.doc-table td,
.doc-table th {
  font-size: 0.72rem;
  line-height: 1.45;
}

/* Ensure tables in pages don't break the page width */
.page > .doc-table {
  max-width: calc(100% + 0.5rem);
  margin-left: -0.25rem;
  margin-right: -0.25rem;
}

/* Constrain very tall tables to fit within a reasonable page height */
.page .doc-table {
  max-height: clamp(500px, 65vh, 900px);
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* In continuous/full-book mode, allow tables full height */
.full-book-page .doc-table {
  max-height: none;
  overflow-y: visible;
}

/* Flipbook spread mode: closer to the reference reader */
.book-pages {
  width: min(100%, 1320px);
}

.book-pages:not(.continuous) {
  max-width: 1320px;
}

.book-pages-shell {
  padding: 0.4rem 5.2rem;
}

.page.spread-page {
  min-height: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.spread-frame {
  position: relative;
  width: min(100%, 1340px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 2px 8px rgba(20, 24, 45, 0.06),
    0 18px 40px rgba(20, 24, 45, 0.10),
    0 36px 64px rgba(20, 24, 45, 0.06);
  aspect-ratio: 1340 / 947;
}

.spread-frame.is-cover {
  width: min(100%, 700px);
  border-radius: 6px;
  aspect-ratio: 681 / 950;
}

.spread-frame.is-single {
  width: min(100%, 700px);
  border-radius: 6px;
  aspect-ratio: 595 / 842;
}

.spread-image {
  display: block;
  width: calc(100% + 20px);
  height: 100%;
  max-width: none;
  margin-left: -10px;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.spread-image.is-cover {
  width: calc(100% + 16px);
  margin-left: -8px;
}

.spread-image.is-single {
  width: 100%;
  margin-left: 0;
  object-fit: contain;
}

.book-pages.continuous {
  --page-width: 680px;
  width: min(100%, calc(var(--page-width, 680px) + 4rem));
  transition: width 200ms ease;
}

.book-controls {
  gap: 0.38rem;
  padding: 0.35rem 0.45rem;
  margin-top: 1rem;
}

.toolbar-btn,
.toc-close {
  padding: 0.58rem 0.82rem;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
}

.indicator {
  min-width: 11.5rem;
  padding: 0 0.2rem;
}

.indicator #page-indicator {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.progress {
  height: 3px;
}

.page-arrow {
  width: 2.9rem;
  height: 2.9rem;
  font-size: 1.7rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 24px rgba(20, 24, 45, 0.08);
}

.page-arrow-prev {
  left: 1.4rem;
}

.page-arrow-next {
  right: 1.4rem;
}

.toc-drawer {
  width: min(332px, 84vw);
  padding: 1rem 0.9rem 0.95rem;
}

.chapter-pill {
  padding: 0.74rem 0.78rem;
  border-radius: 14px;
}

.chapter-pill-title {
  font-size: 0.76rem;
}

.cover-spread-page {
  border-radius: 6px;
}

.page-swap-stage {
  width: min(100%, 1340px);
}

.page-swap-stage .spread-frame {
  width: 100%;
}

@media (max-width: 1100px) {
  .book-pages-shell {
    padding: 0.25rem 3.7rem;
  }

  .spread-frame {
    width: min(100%, 1180px);
  }
}

@media (max-width: 900px) {
  .book-pages-shell {
    padding: 0 1.2rem;
  }

  .page-arrow-prev {
    left: 0;
  }

  .page-arrow-next {
    right: 0;
  }

  .spread-frame,
  .spread-frame.is-cover {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .book-pages {
    width: 100%;
  }

  .spread-image,
  .spread-image.is-cover {
    width: calc(100% + 12px);
    margin-left: -6px;
  }

  .book-controls {
    width: min(100%, 420px);
    justify-content: center;
  }
}

/* ================================================================
   3D PAGE-FLIP ANIMATION
   ================================================================ */

.page-flip-stage {
  position: relative;
  width: min(100%, 1340px);
  margin: 0 auto;
  perspective: 2200px;
  transform-style: preserve-3d;
  overflow: hidden;
  border-radius: 8px;
}

/* New page — sits behind everything */
.page-flip-base {
  position: relative;
  z-index: 1;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.page-flip-base .spread-frame {
  box-shadow: none;
  border-radius: 0;
}

/* Static half of old page — the side that is NOT flipping.
   Clips to left half (next) or right half (prev), then fades. */
.page-flip-static {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.page-flip-static .spread-frame {
  box-shadow: none;
  border-radius: 0;
}

.flip-dir-next .page-flip-static {
  clip-path: inset(0 50% 0 0);
  animation: fadeStatic var(--page-turn-duration) ease forwards;
}

.flip-dir-prev .page-flip-static {
  clip-path: inset(0 0 0 50%);
  animation: fadeStatic var(--page-turn-duration) ease forwards;
}

@keyframes fadeStatic {
  0%, 35% { opacity: 1; }
  75%, 100% { opacity: 0; }
}

/* Flipping leaf — the page half that turns.
   Uses clip-path to isolate the turning half,
   then rotateY around the spine (50% = center). */
.page-flip-leaf {
  position: absolute;
  inset: 0;
  z-index: 4;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  opacity: 1 !important;
}

.page-flip-leaf .spread-frame {
  box-shadow: none;
  border-radius: 0;
}

/* Half-flip: spread-to-spread, right page turns (next) */
.flip-half.flip-dir-next .page-flip-leaf {
  clip-path: inset(0 0 0 50%);
  transform-origin: 50% 50%;
  animation: flipLeafNext var(--page-turn-duration) cubic-bezier(0.20, 0.82, 0.28, 0.96) forwards;
}

/* Half-flip: spread-to-spread, left page turns (prev) */
.flip-half.flip-dir-prev .page-flip-leaf {
  clip-path: inset(0 50% 0 0);
  transform-origin: 50% 50%;
  animation: flipLeafPrev var(--page-turn-duration) cubic-bezier(0.20, 0.82, 0.28, 0.96) forwards;
}

/* Full flip: cover transitions */
.flip-dir-next .page-flip-leaf.page-flip-full {
  clip-path: none;
  transform-origin: right center;
  animation: flipFullNext var(--page-turn-duration) cubic-bezier(0.20, 0.82, 0.28, 0.96) forwards;
}

.flip-dir-prev .page-flip-leaf.page-flip-full {
  clip-path: none;
  transform-origin: left center;
  animation: flipFullPrev var(--page-turn-duration) cubic-bezier(0.20, 0.82, 0.28, 0.96) forwards;
}

@keyframes flipLeafNext {
  0% {
    transform: rotateY(0deg);
    filter: brightness(1);
  }
  50% {
    filter: brightness(0.88);
  }
  100% {
    transform: rotateY(-165deg);
    filter: brightness(1);
    opacity: 0;
  }
}

@keyframes flipLeafPrev {
  0% {
    transform: rotateY(0deg);
    filter: brightness(1);
  }
  50% {
    filter: brightness(0.88);
  }
  100% {
    transform: rotateY(165deg);
    filter: brightness(1);
    opacity: 0;
  }
}

@keyframes flipFullNext {
  0% {
    transform: perspective(2200px) rotateY(0deg);
    filter: brightness(1);
  }
  40% {
    filter: brightness(0.85);
  }
  100% {
    transform: perspective(2200px) rotateY(-120deg);
    filter: brightness(1);
    opacity: 0;
  }
}

@keyframes flipFullPrev {
  0% {
    transform: perspective(2200px) rotateY(0deg);
    filter: brightness(1);
  }
  40% {
    filter: brightness(0.85);
  }
  100% {
    transform: perspective(2200px) rotateY(120deg);
    filter: brightness(1);
    opacity: 0;
  }
}

/* Fold shadow — gradient that follows the crease */
.page-flip-fold-shadow {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
}

.flip-dir-next .page-flip-fold-shadow {
  animation: foldShadowNext var(--page-turn-duration) ease forwards;
}

.flip-dir-prev .page-flip-fold-shadow {
  animation: foldShadowPrev var(--page-turn-duration) ease forwards;
}

@keyframes foldShadowNext {
  0% {
    opacity: 0;
    background: linear-gradient(to left,
      rgba(0,0,0,0.06) 0%, transparent 6%);
  }
  30% {
    opacity: 1;
    background: linear-gradient(90deg,
      transparent 42%,
      rgba(0,0,0,0.10) 49%,
      rgba(0,0,0,0.14) 50%,
      rgba(0,0,0,0.08) 52%,
      transparent 60%);
  }
  65% {
    opacity: 0.7;
    background: linear-gradient(90deg,
      transparent 30%,
      rgba(0,0,0,0.05) 40%,
      transparent 55%);
  }
  100% {
    opacity: 0;
    background: transparent;
  }
}

@keyframes foldShadowPrev {
  0% {
    opacity: 0;
    background: linear-gradient(to right,
      rgba(0,0,0,0.06) 0%, transparent 6%);
  }
  30% {
    opacity: 1;
    background: linear-gradient(270deg,
      transparent 42%,
      rgba(0,0,0,0.10) 49%,
      rgba(0,0,0,0.14) 50%,
      rgba(0,0,0,0.08) 52%,
      transparent 60%);
  }
  65% {
    opacity: 0.7;
    background: linear-gradient(270deg,
      transparent 30%,
      rgba(0,0,0,0.05) 40%,
      transparent 55%);
  }
  100% {
    opacity: 0;
    background: transparent;
  }
}

/* Spine shadow on static spreads (always visible in paged mode) */
.book-pages:not(.continuous) .spread-page:not(.is-cover-spread) .spread-frame::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0,0,0,0.04) 30%,
    rgba(0,0,0,0.08) 48%,
    rgba(0,0,0,0.10) 50%,
    rgba(0,0,0,0.08) 52%,
    rgba(0,0,0,0.04) 70%,
    transparent 100%);
  pointer-events: none;
  z-index: 2;
}

/* ================================================================
   StPageFlip Integration
   ================================================================ */

.book-pages.stpf-active {
  display: block;
  width: 100%;
  max-width: 1400px;
  perspective: none;
  transform-style: flat;
  gap: 0;
  overflow: visible;
}

.stpf-wrapper {
  width: 100%;
  margin: 0 auto;
}

.stpf-page {
  background: #ffffff;
  overflow: hidden;
}

.stpf-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1b2450;
}

.stpf-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.stpf-half {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.stpf-half img {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  object-fit: contain;
  object-position: left top;
  user-select: none;
  pointer-events: none;
}

.stpf-right img {
  left: -100%;
  object-position: right top;
}

.stpf-single-full {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.stpf-single-full img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.stpf-blank {
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.stpf-panel-page {
  background: #ffffff;
  color: #111827;
  font-family: Arial, "Helvetica Neue", sans-serif;
}

.stpf-panel-sheet {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0.68rem;
  padding: 1.85rem 2.15rem 1.45rem;
  background:
    linear-gradient(90deg, rgba(27, 36, 80, 0.055), transparent 16%, transparent 84%, rgba(27, 36, 80, 0.04)),
    #ffffff;
}

.stpf-panel-overview-sheet {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
}

.stpf-panel-header {
  display: grid;
  gap: 0.32rem;
  padding-bottom: 0.72rem;
  border-bottom: 1px solid #d6deeb;
}

.stpf-panel-header p,
.stpf-panel-header h3,
.stpf-panel-header span {
  margin: 0;
}

.stpf-panel-header p {
  color: #53617b;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.stpf-panel-header h3 {
  color: #111827;
  font-size: 1.02rem;
  line-height: 1.22;
}

.stpf-panel-header span {
  color: #4b5563;
  font-size: 0.72rem;
  line-height: 1.38;
}

.stpf-panel-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.stpf-panel-summary article {
  display: grid;
  gap: 0.2rem;
  padding: 0.62rem 0.68rem;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  background: #f8fafc;
}

.stpf-panel-summary span {
  color: #5b6680;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stpf-panel-summary strong {
  color: #172554;
  font-size: 1.22rem;
  line-height: 1;
}

.stpf-panel-controls {
  display: grid;
  gap: 0.45rem;
}

.stpf-panel-controls.is-compact {
  gap: 0.36rem;
}

.stpf-panel-search {
  display: grid;
  gap: 0.26rem;
}

.stpf-panel-search span {
  color: #334155;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stpf-panel-search input {
  width: 100%;
  min-height: 2.1rem;
  padding: 0.48rem 0.62rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 0.68rem;
}

.stpf-panel-search input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.stpf-panel-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.stpf-panel-filter {
  min-height: 1.65rem;
  padding: 0.26rem 0.48rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.stpf-panel-filter.is-active {
  border-color: #172554;
  background: #172554;
  color: #ffffff;
}

.stpf-panel-status {
  margin: 0;
  color: #64748b;
  font-size: 0.58rem;
}

.stpf-panel-focus {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.stpf-panel-focus article {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.42rem;
  padding: 0.52rem;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  background: #f8fafc;
}

.stpf-panel-focus strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #172554;
  color: #ffffff;
  font-size: 0.58rem;
}

.stpf-panel-focus span {
  color: #334155;
  font-size: 0.62rem;
  line-height: 1.25;
}

.stpf-panel-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
}

.stpf-panel-body::-webkit-scrollbar {
  width: 0.42rem;
}

.stpf-panel-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c2ccda;
}

.stpf-panel-body h4 {
  margin: 0 0 0.58rem;
  color: #111827;
  font-size: 0.78rem;
}

.stpf-panel-risk-list,
.stpf-panel-metrics {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stpf-panel-risk-list {
  display: grid;
  gap: 0.38rem;
}

.stpf-panel-risk-list li {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.52rem 0.6rem;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
}

.stpf-panel-risk-list strong {
  color: #172554;
  font-size: 0.62rem;
}

.stpf-panel-risk-list span {
  color: #1f2937;
  font-size: 0.68rem;
  line-height: 1.24;
}

.stpf-panel-risk-list em {
  grid-column: 2;
  color: #5b6680;
  font-size: 0.58rem;
  font-style: normal;
  white-space: nowrap;
}

.stpf-panel-card-list {
  display: grid;
  gap: 0.62rem;
}

.stpf-panel-card {
  display: grid;
  gap: 0.48rem;
  padding: 0.68rem;
  border: 1px solid #d6deeb;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(27, 36, 80, 0.045);
}

.stpf-panel-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  color: #53617b;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stpf-panel-card h4 {
  margin: 0;
  color: #111827;
  font-size: 0.76rem;
  line-height: 1.28;
}

.stpf-panel-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.38rem;
  margin: 0;
}

.stpf-panel-meta div {
  min-width: 0;
  padding: 0.42rem;
  border-radius: 7px;
  background: #f8fafc;
}

.stpf-panel-meta dt {
  margin: 0 0 0.16rem;
  color: #64748b;
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stpf-panel-meta dd {
  margin: 0;
  color: #1f2937;
  font-size: 0.62rem;
  line-height: 1.25;
}

.stpf-panel-details {
  border-top: 1px solid #eef2f7;
  padding-top: 0.4rem;
  margin-top: 0.2rem;
}

.stpf-panel-details summary {
  color: #172554;
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.5rem;
  background: #eef2ff;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.stpf-panel-details summary::-webkit-details-marker {
  display: none;
}

.stpf-panel-details summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #172554;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.stpf-panel-details[open] summary::before {
  content: '−';
}

.stpf-panel-details summary:hover {
  background: #dbe4ff;
}

.stpf-panel-metrics {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
  list-style: none;
  padding: 0;
}

.stpf-panel-metric {
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfbfd;
}

.stpf-metric-head {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
}

.stpf-metric-num {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #172554;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
}

.stpf-metric-head strong {
  flex: 1;
  color: #1f2937;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.32;
}

.stpf-metric-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.45rem;
  border-radius: 6px;
  background: #eef6ee;
  border-left: 3px solid #2f7a3d;
  font-size: 0.6rem;
}

.stpf-panel-metric[data-pending="1"] .stpf-metric-result {
  background: #fff7e6;
  border-left-color: #c47a17;
}

.stpf-metric-result-label {
  color: #4b5563;
  font-weight: 500;
}

.stpf-metric-result-value {
  color: #111827;
  font-weight: 700;
}

.stpf-metric-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

.stpf-metric-band {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.32rem 0.4rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.55rem;
  line-height: 1.25;
}

.stpf-metric-band-label {
  font-weight: 800;
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stpf-metric-band-range {
  font-weight: 600;
}

.stpf-metric-band-ideal {
  background: #e8f5ed;
  border-color: #b6dcc1;
  color: #1d5b30;
}

.stpf-metric-band-ideal .stpf-metric-band-label {
  color: #1d5b30;
}

.stpf-metric-band-alert {
  background: #fff6dc;
  border-color: #f0d68f;
  color: #7a5610;
}

.stpf-metric-band-alert .stpf-metric-band-label {
  color: #7a5610;
}

.stpf-metric-band-critical {
  background: #fde8e8;
  border-color: #f0bdbd;
  color: #7a1c1c;
}

.stpf-metric-band-critical .stpf-metric-band-label {
  color: #7a1c1c;
}

@media (max-width: 640px) {
  .stpf-metric-scale {
    grid-template-columns: 1fr;
  }
}

.stpf-panel-empty {
  margin: 0;
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  color: #64748b;
  font-size: 0.7rem;
  text-align: center;
}

.stpf-panel-sheet footer {
  padding-top: 0.6rem;
  border-top: 1px solid #d6deeb;
  color: #64748b;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

/* Ensure StPageFlip canvas/container fills the shell */
.book-pages.stpf-active .stpf-wrapper > div {
  margin: 0 auto;
}

/* Hide old page elements when in stpf mode */
.book-pages.stpf-active > .page {
  display: none;
}

/* ================================================================
   ZOOM TOOLBAR
   ================================================================ */

.zoom-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem;
  border-radius: 999px;
  border: 1px solid rgba(213, 219, 232, 0.9);
  background: rgba(248, 249, 252, 0.95);
}

.zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--brand-dark, #1b2450);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
  user-select: none;
}

.zoom-btn:hover,
.zoom-btn:focus-visible {
  background: rgba(39, 51, 107, 0.08);
  outline: none;
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-btn.zoom-level {
  min-width: 3.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #66708a;
  cursor: default;
  pointer-events: none;
}

.zoom-btn.is-active {
  background: rgba(39, 51, 107, 0.12);
  color: #1b2450;
}

/* Only show zoom on continuous mode */
.book-controls:not(.is-continuous) .zoom-toolbar {
  display: none;
}

/* ================================================================
   PAGE-TYPE CLASSIFICATIONS (continuous mode)
   ================================================================ */

.continuous-spread-page[data-page-type="table"],
.continuous-spread-page[data-page-type="appendix"] {
  box-shadow: 0 10px 32px rgba(32, 50, 92, 0.14);
}

.continuous-spread-page[data-page-type="appendix"] {
  max-width: var(--page-width-appendix, var(--page-width, 780px));
}

/* Page label badge for special pages */
.page-type-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 3;
  pointer-events: none;
}

.page-type-badge.badge-table {
  background: rgba(255, 243, 205, 0.95);
  color: #7c5e10;
}

.page-type-badge.badge-appendix {
  background: rgba(219, 234, 254, 0.95);
  color: #1e40af;
}

/* ================================================================
   FULLSCREEN
   ================================================================ */

.flipbook-shell.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 0;
  margin: 0;
  max-width: none;
  background: rgba(248, 249, 252, 0.99);
  overflow-y: auto;
}

.flipbook-shell.is-fullscreen .site-header {
  display: none;
}

.flipbook-shell.is-fullscreen .book-controls {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
}

.flipbook-shell.is-fullscreen .page-arrow {
  z-index: 108;
}

/* ================================================================
   CONTINUOUS MODE: DOUBLE-CLICK ZOOM OVERLAY
   ================================================================ */

.continuous-spread-page {
  position: relative;
  cursor: zoom-in;
}

.continuous-spread-page.is-expanded {
  cursor: zoom-out;
  max-width: 95vw !important;
  z-index: 10;
}

/* Text mode should read like the official document, while still using selectable
   extracted text and the interactive dashboard where the PDF table is illegible. */
.book-pages.continuous .text-flow-page {
  min-height: 930px;
  padding: 3rem 3.35rem 3.7rem;
  border-radius: 4px;
  border: 1px solid #d9dee8;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(20, 24, 45, 0.05),
    0 18px 40px rgba(20, 24, 45, 0.08);
  font-family: Arial, "Helvetica Neue", sans-serif;
  color: #111827;
}

.book-pages.continuous .text-flow-page::before,
.book-pages.continuous .text-flow-page::after {
  display: none;
}

.book-pages.continuous .text-flow-page.cover-page {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.book-pages.continuous .page-number {
  top: auto;
  right: 3.35rem;
  bottom: 1.35rem;
  color: #6b7280;
  font-size: 0.66rem;
  letter-spacing: 0;
}

.book-pages.continuous .heading-anchor {
  display: block;
  margin: 1.35rem 0 0.9rem;
  padding: 0;
  border: 0;
}

.book-pages.continuous .heading-anchor-primary {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 1.55rem 0 1rem;
  padding: 0;
  border: 0;
}

.book-pages.continuous .section-title::after {
  display: none;
}

.book-pages.continuous .heading-anchor-primary::before {
  content: attr(data-section-number);
  display: inline-block;
  color: #2c681e;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.book-pages.continuous .section-title,
.book-pages.continuous .heading-anchor-primary .section-title {
  margin: 0 0 0.75rem;
  padding: 0;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 0.98rem;
  line-height: 1.35;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0;
}

.book-pages.continuous .heading-anchor-primary .section-title {
  color: #17336b;
  font-size: 1.35rem;
  line-height: 1.08;
  text-transform: uppercase;
}

.book-pages.continuous .doc-paragraph,
.book-pages.continuous .doc-list,
.book-pages.continuous .doc-list li {
  font-size: 0.93rem;
  line-height: 1.62;
  color: #111827;
}

.book-pages.continuous .doc-paragraph {
  margin-bottom: 0.72rem;
}

.book-pages.continuous .figure-caption,
.book-pages.continuous .source-note {
  display: block;
  width: fit-content;
  margin: 0.85rem 0 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #111827;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.book-pages.continuous .figure-caption::before {
  display: none;
}

.book-pages.continuous .source-note {
  margin-top: 0.25rem;
  color: #4b5563;
  font-weight: 400;
}

.book-pages.continuous .doc-figure {
  margin: 0.85rem 0 1.1rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.book-pages.continuous .doc-figure::before,
.book-pages.continuous .doc-figure::after {
  display: none;
}

.book-pages.continuous .doc-figure img {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  max-height: none;
}

.book-pages.continuous .superintendent-portrait {
  width: min(36%, 242px);
  min-width: 210px;
  max-width: 242px;
  margin: 0.15rem 0 0.9rem 1.25rem;
  padding: 0;
  background: transparent;
}

.book-pages.continuous .superintendent-portrait .portrait-stage {
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

.book-pages.continuous .superintendent-portrait img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  filter: none;
}

.book-pages.continuous .superintendent-quote {
  display: block;
  margin: 0;
  padding: 1.1rem 1rem;
  background: #c9e84b;
  color: #18346d;
  font-size: 1.12rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1.28;
  text-align: center;
}

.book-pages.continuous .doc-table {
  margin: 0.75rem 0 1rem;
  border-radius: 0;
  border: 1px solid #bfc7d4;
  background: #ffffff;
  box-shadow: none;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 0.68rem;
}

.book-pages.continuous .doc-table th,
.book-pages.continuous .doc-table td {
  padding: 0.36rem 0.42rem;
  border-color: #cfd6e1;
  background: #ffffff;
}

.book-pages.continuous .doc-table tr:nth-child(even) td,
.book-pages.continuous .doc-table tr:nth-child(even) th,
.book-pages.continuous .doc-table tr:hover td,
.book-pages.continuous .doc-table tr:hover th,
.book-pages.continuous .doc-table tr:first-child:has(strong) td,
.book-pages.continuous .doc-table tr:first-child:has(strong) th {
  background: #f3f6fb;
}

.book-pages.continuous .doc-table tr:first-child:has(strong) > :first-child,
.book-pages.continuous .doc-table tr:first-child:has(strong) > :last-child,
.book-pages.continuous .doc-table tr:last-child > :first-child,
.book-pages.continuous .doc-table tr:last-child > :last-child {
  border-radius: 0;
}

.book-pages.continuous .panel-dashboard {
  border-radius: 6px;
  background: #ffffff;
  border-color: #cfd6e1;
  box-shadow: none;
}

.book-pages.continuous .panel-dashboard-hero h3 {
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 1.15rem;
  line-height: 1.3;
}

.book-pages.continuous .panel-kicker,
.book-pages.continuous .panel-summary-label,
.book-pages.continuous .panel-action-label,
.book-pages.continuous .panel-action-period,
.book-pages.continuous .panel-action-meta dt,
.book-pages.continuous .panel-metric-title {
  letter-spacing: 0;
}

.book-pages.continuous .panel-summary-card,
.book-pages.continuous .panel-search-field input,
.book-pages.continuous .panel-filter-chip,
.book-pages.continuous .panel-filter-code,
.book-pages.continuous .panel-risk-group,
.book-pages.continuous .panel-risk-code,
.book-pages.continuous .panel-risk-badge,
.book-pages.continuous .panel-action-card,
.book-pages.continuous .panel-threshold,
.book-pages.continuous .approval-note {
  border-radius: 6px;
}

/* Continuous mode now mirrors the flipbook artwork and replaces only the
   unreadable dashboard spreads with readable interactive pages. */
.book-pages.continuous.is-visual-integral {
  --page-width: 1240px;
  width: min(100%, 1320px);
  gap: 2rem;
}

.book-pages.continuous.is-visual-integral .continuous-spread-page {
  width: 100%;
  max-width: min(100%, 1240px);
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.book-pages.continuous.is-visual-integral .visual-flow-page .spread-frame {
  width: 100%;
}

.book-pages.continuous.is-visual-integral .visual-cover-page,
.book-pages.continuous.is-visual-integral .visual-single-page,
.book-pages.continuous.is-visual-integral .visual-half-page,
.book-pages.continuous.is-visual-integral .continuous-panel-page,
.book-pages.continuous.is-visual-integral .continuous-readable-page {
  max-width: min(100%, 700px);
}

.book-pages.continuous.is-visual-integral .visual-half-page .visual-single-frame {
  width: 100%;
  border-radius: 6px;
  aspect-ratio: 670 / 947;
  background: #ffffff;
}

.book-pages.continuous.is-visual-integral .visual-half-page .visual-single-frame img {
  width: 200%;
  height: 100%;
  max-width: none;
  margin-left: 0;
  object-fit: cover;
  object-position: left top;
}

.book-pages.continuous.is-visual-integral .visual-half-page .visual-single-frame.is-right img {
  margin-left: -100%;
  object-position: right top;
}

.continuous-heading-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.book-pages.continuous.is-visual-integral .continuous-panel-page {
  min-height: 930px;
  overflow: hidden;
  background: #ffffff;
  box-shadow:
    0 2px 8px rgba(20, 24, 45, 0.06),
    0 18px 40px rgba(20, 24, 45, 0.10);
  cursor: default;
}

.book-pages.continuous.is-visual-integral .continuous-panel-page .stpf-panel-sheet {
  min-height: 930px;
  height: auto;
}

.book-pages.continuous.is-visual-integral .continuous-panel-page .stpf-panel-body {
  overflow: visible;
  padding-right: 0;
}

.stpf-terminal-page {
  background: #ffffff;
  color: #111827;
  font-family: Arial, "Helvetica Neue", sans-serif;
  cursor: default;
}

.terminal-sheet {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 0.62rem;
  padding: 1.65rem 1.85rem 1.35rem;
  background:
    linear-gradient(90deg, rgba(27, 36, 80, 0.045), transparent 16%, transparent 84%, rgba(27, 36, 80, 0.035)),
    #ffffff;
}

.terminal-sheet-guide,
.terminal-sheet-end {
  grid-template-rows: auto minmax(0, 1fr);
}

.terminal-sheet-header {
  display: grid;
  gap: 0.3rem;
  padding-bottom: 0.68rem;
  border-bottom: 1px solid #d6deeb;
}

.terminal-sheet-header p,
.terminal-sheet-header h3,
.terminal-sheet-header span {
  margin: 0;
}

.terminal-sheet-header p {
  color: #2c681e;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.terminal-sheet-header h3 {
  color: #172554;
  font-size: 1.02rem;
  line-height: 1.22;
}

.terminal-sheet-header span,
.terminal-status {
  color: #64748b;
  font-size: 0.6rem;
  line-height: 1.35;
}

.terminal-search {
  display: grid;
  gap: 0.24rem;
}

.terminal-search span {
  color: #334155;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.terminal-search input {
  width: 100%;
  min-height: 2rem;
  padding: 0.46rem 0.58rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 0.68rem;
}

.terminal-status {
  margin: -0.18rem 0 0;
}

.terminal-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
}

.terminal-scroll::-webkit-scrollbar {
  width: 0.42rem;
  height: 0.42rem;
}

.terminal-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c2ccda;
}

.terminal-scroll .heading-anchor {
  margin: 0 0 0.8rem;
  padding: 0;
  border: 0;
}

.terminal-scroll .section-title {
  margin: 0 0 0.75rem;
  color: #172554;
  font-size: 1rem;
  line-height: 1.25;
  text-transform: uppercase;
}

.terminal-scroll .doc-paragraph,
.terminal-scroll .doc-list,
.terminal-scroll .doc-list li {
  color: #111827;
  font-size: 0.72rem;
  line-height: 1.5;
}

.terminal-scroll .doc-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  border: 1px solid #bfc7d4;
  background: #ffffff;
  font-size: 0.58rem;
  line-height: 1.28;
}

.terminal-sheet-readable .terminal-scroll .doc-table {
  min-width: 980px;
  font-size: 0.55rem;
}

.terminal-scroll .doc-table th,
.terminal-scroll .doc-table td {
  min-width: 5.4rem;
  max-width: 13rem;
  padding: 0.34rem 0.38rem;
  border: 1px solid #cfd6e1;
  vertical-align: top;
}

.terminal-scroll .doc-table tr:first-child td,
.terminal-scroll .doc-table tr:first-child th {
  background: #e8eef7;
  color: #172554;
  font-weight: 800;
}

.terminal-scroll .doc-table tr:nth-child(even) td,
.terminal-scroll .doc-table tr:nth-child(even) th {
  background: #f8fafc;
}

.terminal-scroll .doc-figure {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.terminal-scroll .doc-figure img {
  display: block;
  width: 100%;
  max-width: none;
  max-height: none;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.terminal-sheet-term .terminal-scroll .doc-figure img {
  width: 150%;
  min-width: 620px;
}

.terminal-sheet-term .terminal-scroll .approval-note {
  margin: 0 0 0.54rem;
  text-align: justify;
}

.terminal-sheet-term .terminal-scroll .approval-note:nth-of-type(2),
.terminal-sheet-term .terminal-scroll .approval-note:nth-last-of-type(-n + 3) {
  text-align: center;
  font-weight: 700;
}

.terminal-sheet-references .terminal-scroll .doc-paragraph {
  margin: 0 0 0.66rem;
  padding-left: 1.45rem;
  text-indent: -1.45rem;
  text-align: left;
  overflow-wrap: anywhere;
}

.terminal-sheet-appendix .terminal-scroll .doc-figure img {
  width: 220%;
  min-width: 980px;
}

.terminal-guide-grid {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.terminal-guide-grid article,
.terminal-end-card {
  display: grid;
  gap: 0.52rem;
  padding: 0.9rem;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fafc;
}

.terminal-guide-grid article {
  grid-template-columns: auto 1fr;
}

.terminal-guide-grid strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: #172554;
  color: #ffffff;
  font-size: 0.68rem;
}

.terminal-guide-grid span,
.terminal-end-card span {
  color: #334155;
  font-size: 0.76rem;
  line-height: 1.42;
}

.terminal-end-card {
  align-self: center;
  text-align: center;
}

.terminal-end-card p,
.terminal-end-card h3,
.terminal-end-card span {
  margin: 0;
}

.terminal-end-card p {
  color: #2c681e;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.terminal-end-card h3 {
  color: #172554;
  font-size: 1.45rem;
  line-height: 1.1;
}

.book-pages.continuous.is-visual-integral .continuous-terminal-page,
.book-pages.continuous.is-visual-integral .continuous-readable-page {
  max-width: min(100%, 760px);
  min-height: 930px;
  overflow: hidden;
  background: #ffffff;
  box-shadow:
    0 2px 8px rgba(20, 24, 45, 0.06),
    0 18px 40px rgba(20, 24, 45, 0.10);
  cursor: default;
}

.book-pages.continuous.is-visual-integral .continuous-terminal-page .terminal-sheet,
.book-pages.continuous.is-visual-integral .continuous-readable-page .terminal-sheet {
  min-height: 930px;
  height: auto;
}

.stpf-end-page {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 28% 22%, rgba(201, 232, 75, 0.22), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #eef4fb 100%);
  color: #172554;
}

.stpf-end-sheet {
  display: grid;
  gap: 0.65rem;
  width: min(78%, 25rem);
  padding: 2.2rem;
  border: 1px solid #d8e1ef;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  text-align: center;
  box-shadow: 0 18px 42px rgba(23, 37, 84, 0.10);
}

.stpf-end-sheet p,
.stpf-end-sheet h3,
.stpf-end-sheet span {
  margin: 0;
}

.stpf-end-sheet p {
  color: #2c681e;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stpf-end-sheet h3 {
  color: #172554;
  font-size: 1.45rem;
  line-height: 1.1;
}

.stpf-end-sheet span {
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.45;
}

/* ================================================================
   FLIPBOOK: DOUBLE-CLICK DETAIL VIEW
   ================================================================ */

.stpf-page {
  cursor: pointer;
}

/* ================================================================
   RESPONSIVE ADJUSTMENTS FOR WIDER CONTINUOUS PAGES
   ================================================================ */

@media (max-width: 900px) {
  .book-pages.continuous {
    --page-width: min(680px, calc(100vw - 2rem));
    width: min(100%, calc(100vw - 1rem));
  }
}

@media (max-width: 640px) {
  .book-pages.continuous {
    --page-width: calc(100vw - 1.5rem);
    width: 100%;
  }

  .zoom-toolbar {
    gap: 0;
  }

  .zoom-btn {
    min-width: 1.8rem;
    height: 1.8rem;
  }
}

/* Exportacao PDF visual: usa a mesma sequencia canonica renderizada na tela. */
body.pdf-export {
  background: #ffffff !important;
}

body.pdf-export .site-header,
body.pdf-export .hero-panel,
body.pdf-export .toc-panel,
body.pdf-export .chapter-rail,
body.pdf-export .book-status,
body.pdf-export .book-controls,
body.pdf-export .toolbar,
body.pdf-export .figure-lightbox,
body.pdf-export .terminal-search,
body.pdf-export [data-ui-only="true"],
body.pdf-export .ui-only,
body.pdf-export .stpf-panel-controls,
body.pdf-export .panel-dashboard-toolbar,
body.pdf-export .panel-filter-row,
body.pdf-export .stpf-panel-details > summary,
body.print-mode .stpf-panel-controls,
body.print-mode .panel-dashboard-toolbar,
body.print-mode .panel-filter-row,
body.print-mode .stpf-panel-details > summary {
  display: none !important;
}

body.pdf-export .stpf-panel-details,
body.print-mode .stpf-panel-details {
  border-top: 0;
  padding-top: 0;
  margin-top: 0.4rem;
}

body.pdf-export .stpf-panel-details > .stpf-panel-metrics,
body.print-mode .stpf-panel-details > .stpf-panel-metrics {
  display: grid !important;
  margin-top: 0;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm !important;
    min-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .site-header,
  .hero-panel,
  .toc-panel,
  .chapter-rail,
  .book-status,
  .book-controls,
  .toolbar,
  .figure-lightbox,
  .terminal-search,
  [data-ui-only="true"],
  .ui-only {
    display: none !important;
  }

  .flipbook-shell,
  .flipbook-stage,
  .book-pages-shell,
  .book-body,
  .book-wrapper,
  .book-shell {
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  #reader-pages {
    display: block !important;
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    gap: 0 !important;
    perspective: none !important;
  }

  article.page,
  .full-book-page,
  .continuous-spread-page,
  .continuous-panel-page,
  .continuous-readable-page,
  .continuous-terminal-page,
  .stpf-terminal-page {
    display: block !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-height: 297mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    break-after: page !important;
    page-break-after: always !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    background: #ffffff !important;
    cursor: default !important;
  }

  .spread-frame,
  .visual-single-frame {
    width: 210mm !important;
    height: 297mm !important;
    max-width: none !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  .spread-frame img,
  .spread-image {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .visual-half-page .visual-single-frame img {
    width: 420mm !important;
    height: 297mm !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: left top !important;
  }

  .visual-half-page .visual-single-frame.is-left img {
    margin-left: 0 !important;
  }

  .visual-half-page .visual-single-frame.is-right img {
    margin-left: -210mm !important;
    object-position: right top !important;
  }

  .visual-cover-page .spread-frame img,
  .visual-single-page .spread-frame img {
    width: 210mm !important;
    height: 297mm !important;
    object-fit: cover !important;
  }

  .terminal-sheet,
  .stpf-panel-sheet {
    width: 210mm !important;
    min-height: 297mm !important;
    height: 297mm !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .stpf-panel-body,
  .terminal-scroll {
    overflow: hidden !important;
  }

  .page::before,
  .page::after,
  .page-number,
  .page-arrow,
  .continuous-heading-anchor {
    display: none !important;
  }

  #reader-pages article.page:last-child {
    break-after: auto !important;
    page-break-after: auto !important;
  }
}
