.premium-book {
  --book-ink: #10283f;
  --book-muted: #506276;
  --book-blue: #1a62c6;
  --book-deep: #0d3c70;
  --book-rust: #ad5b3b;
  --book-green: #216047;
  --book-paper: #f5f1e8;
  --book-white: #fffefa;
  --book-line: #d8d1c5;
  display: grid;
  grid-template-columns: minmax(238px, 268px) minmax(0, 1fr);
  gap: clamp(24px, 4.5vw, 76px);
  max-width: 1450px;
  margin: 0 auto;
  padding: 38px clamp(20px, 3vw, 44px) 80px;
  color: var(--book-ink);
  font: 16px/1.65 Arial, Helvetica, sans-serif;
}

.premium-book *, .premium-book *::before, .premium-book *::after { box-sizing: border-box; }
.premium-book a { color: var(--book-blue); text-underline-offset: 3px; }
.premium-book a:focus-visible, .premium-book button:focus-visible,
.premium-book select:focus-visible, .premium-book summary:focus-visible {
  outline: 3px solid var(--book-rust);
  outline-offset: 3px;
}
.premium-book button, .premium-book select { font: inherit; }
.premium-book [hidden] { display: none !important; }
.book-skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: white;
  padding: 10px 16px;
}
.book-skip:focus { left: 12px; }
.book-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* A chapter rail gives the reader a visible map without turning the book into
   a list of repository paths. */
.book-rail { border-right: 1px solid var(--book-line); }
.book-rail-inner { position: sticky; top: 22px; padding: 10px 24px 20px 0; }
.book-small-label, .book-step-label, .book-kicker {
  color: var(--book-rust);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1.5;
  text-transform: uppercase;
}
.book-rail .book-small-label { margin: 0 0 23px; }
.book-chapter-list { list-style: none; margin: 0; padding: 0; }
.book-chapter-list li + li { border-top: 1px solid var(--book-line); }
.book-chapter-list a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 7px;
  color: var(--book-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.32;
  text-decoration: none;
  border-radius: 5px;
}
.book-chapter-list a:hover, .book-chapter-list a[aria-current="page"] {
  color: var(--book-blue);
  background: #e7eef7;
}
.book-nav-number { color: var(--book-rust); font: 19px/1 Georgia, serif; }
.book-read-tick { color: var(--book-green); text-align: center; }
.book-chapter-list a[data-read="true"] .book-read-tick::after { content: "✓"; }
.book-mobile-picker { display: none; }
.book-progress-card {
  display: none;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid #b8cce9;
  border-radius: 12px;
  background: #e7eef7;
  font-size: 12px;
}
.book-ready .book-progress-card { display: block; }
.book-progress-card > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.book-progress-card strong { color: var(--book-deep); font-size: 15px; }
.book-progress-card progress { display: block; width: 100%; height: 9px; margin: 13px 0 8px; accent-color: var(--book-blue); }
.book-progress-card p { margin: 0; color: var(--book-muted); line-height: 1.45; }
.book-progress-card #book-storage-status:not(:empty) { margin-top: 8px; }

.book-reader { min-width: 0; max-width: 1050px; }
.book-panel { padding: 8px 0 38px; border-bottom: 1px solid var(--book-line); }
.book-panel + .book-panel { margin-top: 68px; }
.book-ready .book-panel + .book-panel { margin-top: 0; }
.book-intro-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(185px, .7fr); align-items: end; gap: 36px; padding: 32px 0 45px; }
.book-intro .book-kicker { margin: 0 0 22px; }
.book-intro h2, .book-support h2 {
  margin: 0;
  font: 400 clamp(46px, 6vw, 83px)/1.02 Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
}
.book-intro h2 em, .book-support h2 em { color: var(--book-blue); font-style: normal; }
.book-intro-lead { max-width: 620px; margin: 26px 0 10px; font: 21px/1.45 Georgia, serif; }
.book-intro-layout p:not(.book-kicker):not(.book-intro-lead) { max-width: 640px; color: var(--book-muted); }
.book-intro-aside { border-left: 3px solid var(--book-rust); padding: 6px 0 6px 20px; }
.book-intro-aside span { color: var(--book-rust); font: italic 44px/1 Georgia, serif; }
.book-intro-aside p { margin: 14px 0 0; font-size: 15px; font-weight: 700; line-height: 1.6; }
.book-intro-world { margin: 0 0 30px; }
.book-intro-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.book-intro-cards article { min-width: 0; padding: clamp(18px, 2.3vw, 28px); border: 1px solid var(--book-line); border-radius: 14px; background: var(--book-white); }
.book-intro-cards h3 { margin: 6px 0 14px; font: 27px/1.15 Georgia, serif; }
.book-intro-cards p { margin: 12px 0; }
.book-intro-cards article > p:last-child { margin-bottom: 0; }
.book-intro-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 25px; padding: 20px 0; border-top: 1px solid var(--book-line); }
.book-intro-bottom p { flex: 1 1 270px; margin: 0; font-size: 14px; }
.book-intro-bottom a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 13px; border: 1px solid var(--book-blue); border-radius: 7px; font-size: 13px; font-weight: 700; text-decoration: none; }
.book-intro-bottom a:last-child { color: white; background: var(--book-blue); }
.book-original-routes { margin-top: 10px; padding: 13px 0; border-top: 1px solid var(--book-line); color: var(--book-muted); font-size: 14px; }
.book-original-routes summary { cursor: pointer; font-weight: 700; }

.book-chapter-heading { padding: 25px 0 27px; }
.book-chapter-heading .book-kicker { margin: 0 0 14px; }
.book-kicker span { color: var(--book-line); padding: 0 6px; }
.book-chapter h2 { max-width: 880px; margin: 0; font: 400 clamp(38px, 5vw, 68px)/1.06 Georgia, serif; letter-spacing: -.035em; }
.book-chapter-deck { max-width: 690px; margin: 16px 0 0; color: var(--book-muted); font: 19px/1.5 Georgia, serif; }
.book-hero-figure { margin: 0 0 28px; padding: 0; border: 1px solid #cad3d8; border-radius: 15px; overflow: hidden; background: var(--book-white); box-shadow: 0 18px 40px rgba(16, 40, 63, .07); }
.book-hero-figure .architecture { margin: 0; border: 0; box-shadow: none; }
.book-hero-figure img, .book-hero-figure svg { display: block; width: 100%; height: auto; }
.book-hero-caption { margin: 0; padding: 12px 20px; border-top: 1px solid var(--book-line); color: var(--book-muted); font-size: 12px; }
.book-tabs { display: none; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; border-bottom: 1px solid var(--book-line); }
.book-ready .book-tabs { display: flex; }
.book-tabs button {
  min-height: 47px;
  padding: 11px 15px 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--book-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
}
.book-tabs button:hover { color: var(--book-blue); }
.book-tabs button[aria-pressed="true"] { color: var(--book-blue); border-color: var(--book-blue); }
.book-mode-panel { min-height: 270px; padding: 8px 0 20px; }
.book-mode-panel h3 { margin: 4px 0 17px; font: 31px/1.18 Georgia, serif; }
.book-mode-panel p { max-width: 780px; margin: 0 0 16px; font-size: 17px; line-height: 1.7; }
.book-mode-panel .book-step-label { margin-bottom: 7px; font-size: 11px; }
.book-mode-panel code { padding: 1px 4px; border-radius: 3px; background: #e8edf0; font: .88em/1.3 Consolas, "Liberation Mono", monospace; overflow-wrap: anywhere; }
.book-mode-panel .book-check { margin-top: 25px; padding: 17px 20px; border-left: 4px solid var(--book-green); background: #e4f0e8; font-size: 15px; }
.book-model-frame { margin: 15px 0; padding: clamp(16px, 2vw, 24px); border: 1px solid #b8cce9; border-radius: 14px; background: #f8fbff; }
.book-model-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0 0 9px; }
.book-model-head span { color: var(--book-blue); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.book-model-head strong { font: 22px/1.2 Georgia, serif; }
.book-model-frame > p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; }
.book-model { min-height: 110px; }
.book-model-frame .book-model-boundary { margin: 12px 0 0; color: var(--book-muted); font-size: 12px; }
.book-extra-model { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--book-line); border-radius: 9px; background: white; }
.book-extra-model summary { min-height: 44px; padding: 9px 0; cursor: pointer; color: var(--book-deep); font-size: 14px; font-weight: 700; }
.book-extra-model .book-model-frame { margin-bottom: 0; }
.book-resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 20px 0; }
.book-resource-grid a { display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; padding: 16px; border: 1px solid var(--book-line); border-radius: 10px; background: var(--book-white); font-size: 16px; font-weight: 700; text-decoration: none; }
.book-resource-grid a:hover { border-color: var(--book-blue); background: #f8fbff; }
.book-resource-grid span { display: block; margin-top: 14px; color: var(--book-muted); font-size: 12px; font-weight: 400; }
.book-mode-panel .book-source-link { font-size: 14px; }
.book-apply { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 22px; margin-top: 20px; padding: 25px; border-radius: 12px; background: var(--book-deep); color: white; }
.book-apply .book-small-label { margin: 0 0 5px; color: #a7c7f7; }
.book-apply h3 { margin: 0; font: 25px/1.2 Georgia, serif; }
.book-apply p:not(.book-small-label) { max-width: 570px; margin: 7px 0 0; color: #d8e3ed; font-size: 13px; }
.book-apply-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 172px; }
.book-apply-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 7px 14px; border: 1px solid #93b8e9; border-radius: 7px; color: white; font-size: 13px; font-weight: 700; text-align: center; text-decoration: none; }
.book-apply-actions .book-primary-link { border-color: white; background: white; color: var(--book-deep); }
.book-end-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 19px; }
.book-end-actions a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 700; }
.book-mark-read { display: none; min-height: 44px; padding: 8px 16px; border: 1px solid var(--book-green); border-radius: 7px; background: white; color: var(--book-green); cursor: pointer; font-size: 13px; font-weight: 700; }
.book-ready .book-mark-read { display: inline-block; }
.book-mark-read[aria-pressed="true"] { background: #e4f0e8; }

.book-support .book-kicker { margin: 23px 0 13px; }
.book-support h2 { font-size: clamp(42px, 5vw, 70px); }
.book-support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin: 28px 0; }
.book-support-card { min-width: 0; padding: 14px 20px; border: 1px solid var(--book-line); border-radius: 10px; background: var(--book-white); }
.book-support-card summary { min-height: 44px; cursor: pointer; font: 20px/1.25 Georgia, serif; }
.book-support-card summary span { display: block; margin-bottom: 4px; color: var(--book-rust); font: 800 10px/1.5 Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.book-support-card p, .book-support-card li { color: var(--book-muted); font-size: 14px; line-height: 1.55; }
.book-support-card ul { padding-left: 19px; }
.book-support-close { max-width: 700px; margin-top: 25px; padding-left: 16px; border-left: 3px solid var(--book-rust); font: 19px/1.5 Georgia, serif; }
.book-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 23px; color: var(--book-muted); font-size: 13px; }
.book-footer p { margin: 0; }
.book-footer button { display: none; min-height: 44px; padding: 8px 15px; border: 1px solid var(--book-blue); border-radius: 7px; background: white; color: var(--book-blue); cursor: pointer; font-size: 12px; font-weight: 700; }
.book-ready .book-footer button { display: inline-block; }

@media (max-width: 1040px) {
  .premium-book { grid-template-columns: 216px minmax(0, 1fr); gap: 25px; }
  .book-rail-inner { padding-right: 15px; }
  .book-intro-layout { gap: 22px; }
  .book-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .premium-book { display: block; padding: 12px 18px 55px; }
  .book-rail { position: relative; z-index: 2; border: 0; border-bottom: 1px solid var(--book-line); background: var(--book-paper); }
  .book-rail-inner { position: static; padding: 10px 0 16px; }
  .book-rail .book-small-label { margin-bottom: 7px; }
  .book-ready .book-chapter-list { display: none; }
  .book-ready .book-mobile-picker { display: block; }
  .book-mobile-picker label { display: block; margin: 4px 0 5px; font-size: 12px; font-weight: 700; }
  .book-mobile-picker select { width: 100%; min-height: 48px; padding: 8px 13px; border: 1px solid var(--book-blue); border-radius: 8px; background: white; color: var(--book-ink); }
  .book-progress-card { margin-top: 11px; padding: 12px 14px; }
  .book-progress-card p { font-size: 11px; }
  .book-reader { max-width: none; }
  .book-intro-layout { display: block; padding: 29px 0 28px; }
  .book-intro-aside { margin-top: 27px; }
  .book-intro-cards, .book-support-grid { grid-template-columns: 1fr; }
  .book-chapter-heading { padding-top: 33px; }
  .book-tabs { display: none; }
  .book-ready .book-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .book-tabs button { min-height: 48px; }
  .book-apply { grid-template-columns: 1fr; }
  .book-apply-actions { flex-direction: row; flex-wrap: wrap; }
  .book-apply-actions a { flex: 1 1 150px; }
}
@media (max-width: 500px) {
  .premium-book { padding-left: 14px; padding-right: 14px; }
  .book-intro h2 { font-size: 45px; }
  .book-intro-lead { font-size: 19px; }
  .book-chapter h2 { font-size: 39px; }
  .book-chapter-deck { font-size: 17px; }
  .book-mode-panel p { font-size: 16px; }
  .book-resource-grid { grid-template-columns: 1fr; }
  .book-resource-grid a { min-height: 88px; }
  .book-apply { padding: 20px; }
  .book-hero-caption { padding: 11px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .premium-book *, .premium-book *::before, .premium-book *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .premium-book { display: block; max-width: none; padding: 0; color: #111; font-size: 11pt; }
  .book-rail, .book-tabs, .book-model, .book-footer button, .book-end-actions,
  .book-intro-world, .book-intro-bottom, .book-apply-actions, .book-original-routes { display: none !important; }
  .premium-book .book-panel[hidden], .premium-book .book-mode-panel[hidden] { display: block !important; }
  .book-panel { break-before: page; padding: 0; border: 0; }
  .book-panel:first-child { break-before: auto; }
  .book-panel + .book-panel { margin-top: 0; }
  .book-hero-figure { max-width: 100%; box-shadow: none; break-inside: avoid; }
  .book-intro h2, .book-chapter h2, .book-support h2 { font-size: 34pt; }
  .book-mode-panel { min-height: 0; padding: 0 0 10px; }
  .book-mode-panel h3 { font-size: 19pt; }
  .book-apply { display: block; background: #eef2f6; color: #111; border: 1px solid #ccc; }
  .book-apply p:not(.book-small-label) { color: #333; }
  .book-resource-grid a { min-height: 0; }
  .book-support-card { break-inside: avoid; }
  a { color: #111 !important; }
}
