:root {
  color-scheme: light;
  --navy-950: #09231f;
  --navy-900: #0d2b26;
  --navy-800: #173f37;
  --navy-700: #285e52;
  --ink: #172521;
  --ink-soft: #53645f;
  --paper: #f4f0e5;
  --paper-deep: #e9e1d1;
  --surface: #fffdf7;
  --surface-raised: #ffffff;
  --line: #d8d0bd;
  --line-strong: #b9ad96;
  --gold: #9d742f;
  --gold-bright: #d3b36a;
  --oxblood: #8b3f34;
  --mark: #f1d98f;
  --shadow: 0 18px 50px rgb(9 35 31 / 0.14);
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --reader-size: 1.12rem;
  --reader-leading: 1.82;
  --reader-family: var(--serif);
  --reader-width: 45rem;
  --topbar-h: 4.25rem;
  --sidebar-w: 19rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 1.25rem);
}

body {
  margin: 0;
  min-width: 20rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
}

body.nav-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: 0.7rem;
  left: 0.8rem;
  z-index: 200;
  transform: translateY(-150%);
  padding: 0.7rem 1rem;
  border-radius: 0.35rem;
  background: var(--surface-raised);
  color: var(--navy-900);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgb(198 165 106 / 0.24);
  background: rgb(16 30 48 / 0.97);
  color: #f9f5ec;
  backdrop-filter: blur(14px);
}

.reading-meter {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: rgb(255 255 255 / 0.08);
}

.reading-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold-bright);
  transition: width 140ms linear;
}

.wordmark {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--gold-bright);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.wordmark-copy {
  display: grid;
  line-height: 1.05;
}

.wordmark-copy strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.wordmark-copy small {
  margin-top: 0.18rem;
  color: var(--gold-bright);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-button,
.utility-button,
.quiet-button,
.primary-button,
.text-button,
.tool-button,
.segmented button {
  border: 0;
  cursor: pointer;
}

.icon-button,
.utility-button {
  min-height: 2.55rem;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 0.35rem;
  background: rgb(255 255 255 / 0.06);
  color: #fff;
}

.icon-button {
  min-width: 2.55rem;
  padding: 0 0.65rem;
  font-weight: 700;
}

.utility-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.utility-button kbd {
  padding: 0.08rem 0.35rem;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 0.25rem;
  color: #dcd5c7;
  font: inherit;
}

.icon-button:hover,
.utility-button:hover {
  border-color: rgb(198 165 106 / 0.7);
  background: rgb(255 255 255 / 0.1);
}

.nav-toggle {
  display: none;
}

.shell {
  min-height: 100vh;
  padding-top: var(--topbar-h);
}

.book-nav {
  position: fixed;
  inset: var(--topbar-h) auto 0 0;
  z-index: 60;
  width: var(--sidebar-w);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  scrollbar-width: thin;
}

.nav-head {
  padding: 1.6rem 1.35rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.nav-kicker,
.eyebrow,
.chapter-label,
.page-kicker {
  margin: 0 0 0.55rem;
  color: var(--oxblood);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  line-height: 1.35;
  text-transform: uppercase;
}

.nav-title {
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.12;
  text-decoration: none;
}

.overall-progress {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.69rem;
  font-weight: 700;
}

.overall-track {
  height: 3px;
  margin-top: 0.55rem;
  background: var(--paper-deep);
}

.overall-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--oxblood);
  transition: width 250ms ease;
}

#primary-nav {
  padding: 0.8rem 0.7rem 1rem;
}

.nav-group-title {
  margin: 1rem 0.65rem 0.45rem;
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.45rem;
  padding: 0.62rem 0.6rem;
  border-radius: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.25;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--paper);
  color: var(--ink);
}

.nav-link.active {
  background: var(--navy-800);
  color: #fff;
}

.nav-link .nav-num {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
}

.nav-link.active .nav-num {
  color: var(--gold-bright);
}

.nav-link .nav-check {
  color: var(--gold);
  opacity: 0;
}

.nav-link.visited .nav-check {
  opacity: 1;
}

.nav-foot {
  margin: 0 1.3rem;
  padding: 1rem 0 1.8rem;
  border-top: 1px solid var(--line);
}

.nav-foot p {
  margin: 0.8rem 0 0;
  color: var(--ink-soft);
  font-size: 0.67rem;
  line-height: 1.45;
}

.quiet-button {
  padding: 0;
  background: transparent;
  color: var(--oxblood);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.quiet-button:hover,
.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.nav-scrim {
  display: none;
}

#main-content {
  min-height: calc(100vh - var(--topbar-h));
  margin-left: var(--sidebar-w);
}

.home {
  min-height: calc(100vh - var(--topbar-h));
}

.cover {
  position: relative;
  min-height: min(43rem, calc(100vh - var(--topbar-h)));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(17rem, 0.85fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 28%, rgb(198 165 106 / 0.16), transparent 27%),
    linear-gradient(135deg, var(--navy-950), var(--navy-700));
  color: #fff;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgb(255 255 255 / 0.018) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to right, black, transparent 80%);
}

.cover-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: 50rem;
  padding: clamp(3.8rem, 8vw, 8rem) clamp(2rem, 8vw, 7rem);
}

.cover-rule {
  width: 4.5rem;
  height: 2px;
  margin: 1.1rem 0 1.8rem;
  background: var(--gold-bright);
}

.cover h1 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 7vw, 6.7rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.93;
}

.cover-subtitle {
  max-width: 36rem;
  margin: 1.8rem 0 0;
  color: #dcd7ce;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.36rem);
  line-height: 1.55;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.2rem;
}

.primary-button,
.text-button,
.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.8rem;
  padding: 0.72rem 1rem;
  border-radius: 0.25rem;
  text-decoration: none;
}

.primary-button {
  background: var(--gold-bright);
  color: var(--navy-950);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.primary-button:hover {
  background: #d4b77e;
}

.text-button {
  background: transparent;
  color: inherit;
  font-size: 0.8rem;
  font-weight: 800;
}

.cover-art {
  position: relative;
  min-height: 34rem;
  align-self: stretch;
}

.court-lines {
  position: absolute;
  inset: 12% 5% 10% 0;
  opacity: 0.88;
}

.court-lines span {
  position: absolute;
  display: block;
  border: 1px solid rgb(198 165 106 / 0.62);
}

.court-lines span:nth-child(1) {
  inset: 8% 18% 10% 13%;
}

.court-lines span:nth-child(2) {
  inset: 17% 9% 19% 23%;
}

.court-lines span:nth-child(3) {
  top: 50%;
  left: -4%;
  width: 100%;
  transform: rotate(-21deg);
  border-width: 1px 0 0;
}

.court-lines::before,
.court-lines::after {
  content: "§";
  position: absolute;
  color: rgb(198 165 106 / 0.82);
  font-family: var(--serif);
}

.court-lines::before {
  top: 8%;
  right: 12%;
  font-size: 9rem;
}

.court-lines::after {
  right: 38%;
  bottom: 7%;
  font-size: 3.5rem;
}

.cover-meta {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  z-index: 1;
  display: grid;
  gap: 0.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--gold-bright);
  color: #d9d4ca;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-transform: uppercase;
}

.home-section,
.front-page {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1.35rem, 6vw, 5rem);
}

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 8vw, 7rem);
  align-items: start;
}

.display-heading,
.front-page h1,
.front-page h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.display-heading {
  font-size: clamp(2.1rem, 5vw, 4rem);
}

.home-intro-copy p,
.front-page > p,
.front-section p,
.legal-list li {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.75;
}

.home-intro-copy p:first-child {
  margin-top: 0;
  color: var(--ink);
  font-size: 1.28rem;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 3.4rem;
  border: 1px solid var(--line);
  background: var(--line);
}

.chapter-card {
  position: relative;
  min-height: 14rem;
  display: grid;
  grid-template-columns: 3.3rem 1fr;
  gap: 1.1rem;
  padding: 1.6rem;
  background: var(--surface);
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

.chapter-card:hover {
  z-index: 2;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-number {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1;
}

.card-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.38rem;
  font-weight: 600;
  line-height: 1.22;
}

.card-copy p {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.card-status {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  color: var(--oxblood);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1.35rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.home-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.home-footer a:hover {
  color: var(--oxblood);
}

.front-page {
  max-width: 62rem;
}

.front-page h1 {
  max-width: 18ch;
  font-size: clamp(2.6rem, 6vw, 5rem);
}

.front-deck {
  max-width: 44rem;
  margin: 1.3rem 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.65;
}

.front-section {
  max-width: 46rem;
  margin-top: 3.5rem;
}

.front-section h2 {
  margin-bottom: 1rem;
  font-size: 1.9rem;
}

.steps {
  display: grid;
  gap: 1.25rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.steps li {
  position: relative;
  min-height: 3rem;
  padding-left: 4rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.65;
  counter-increment: steps;
}

.steps li::before {
  content: counter(steps, decimal-leading-zero);
  position: absolute;
  top: 0.1rem;
  left: 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.55rem;
}

.shortcut-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem 1.2rem;
  align-items: center;
  margin-top: 1.5rem;
}

.shortcut-list dt,
.shortcut-list dd {
  margin: 0;
}

.shortcut-list kbd {
  display: inline-block;
  min-width: 2rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 0.25rem;
  background: var(--surface-raised);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.shortcut-list dd {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.contents-list {
  display: grid;
  gap: 0;
  margin: 3rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
}

.contents-link {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.contents-link:hover .contents-title {
  color: var(--oxblood);
}

.contents-num {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.8rem;
}

.contents-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
}

.contents-meta {
  color: var(--ink-soft);
  font-size: 0.7rem;
  white-space: nowrap;
}

.reader-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15.5rem;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: calc(var(--reader-width) + 23rem);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1.35rem, 4vw, 4rem) 5rem;
}

.chapter-article {
  min-width: 0;
  max-width: var(--reader-width);
}

.chapter-masthead {
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line-strong);
}

.chapter-masthead h1 {
  max-width: 17ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.3rem;
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chapter-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.tool-button {
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tool-button:hover,
.tool-button.is-active {
  border-color: var(--gold);
  color: var(--oxblood);
}

.search-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -2rem 0 2.4rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.chapter-body {
  font-family: var(--serif);
  font-size: var(--reader-size);
  line-height: 1.82;
}

.chapter-body h2,
.chapter-body h3 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  text-wrap: balance;
}

.chapter-body h2 {
  margin: 4.6rem 0 1.15rem;
  font-size: 1.95em;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.chapter-body h2::before {
  content: "";
  display: block;
  width: 2.8rem;
  height: 2px;
  margin-bottom: 1.15rem;
  background: var(--gold);
}

.chapter-body h3 {
  margin: 2.8rem 0 0.8rem;
  font-size: 1.3em;
  line-height: 1.28;
}

.chapter-body p {
  margin: 0 0 1.25em;
  hanging-punctuation: first last;
}

.chapter-body h2 + p::first-letter {
  float: left;
  margin: 0.08em 0.1em 0 0;
  color: var(--oxblood);
  font-size: 3.4em;
  font-weight: 500;
  line-height: 0.82;
}

mark {
  padding: 0.04em 0.08em;
  background: var(--mark);
  color: #241c10;
}

.chapter-end {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-strong);
}

.chapter-end-link {
  min-height: 7rem;
  display: grid;
  align-content: center;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}

.chapter-end-link:last-child {
  text-align: right;
}

.chapter-end-link:hover {
  border-color: var(--gold);
}

.chapter-end-link span {
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-end-link strong {
  margin-top: 0.35rem;
  font-family: var(--serif);
  font-size: 0.9rem;
  line-height: 1.35;
}

.chapter-rail {
  position: sticky;
  top: calc(var(--topbar-h) + 1.7rem);
  max-height: calc(100vh - var(--topbar-h) - 3rem);
  align-self: start;
  overflow-y: auto;
  padding-left: 1.2rem;
  border-left: 1px solid var(--line);
  scrollbar-width: thin;
}

.rail-title {
  margin: 0 0 0.7rem;
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rail-link {
  display: block;
  padding: 0.38rem 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.35;
  text-decoration: none;
}

.rail-link.level-2 {
  padding-left: 0.8rem;
  font-size: 0.66rem;
}

.rail-link:hover,
.rail-link.active {
  color: var(--oxblood);
}

.rail-link.active {
  font-weight: 800;
}

.legal-list {
  margin: 1.2rem 0 0;
  padding-left: 1.2rem;
}

.legal-list li {
  padding-left: 0.4rem;
  margin-bottom: 0.9rem;
}

.modal {
  width: min(44rem, calc(100% - 2rem));
  max-height: min(48rem, calc(100vh - 2rem));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0.3rem;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.28);
}

.modal::backdrop {
  background: rgb(4 12 22 / 0.72);
  backdrop-filter: blur(4px);
}

.compact-modal {
  width: min(34rem, calc(100% - 2rem));
}

.modal-frame {
  margin: 0;
  padding: 1.5rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: start;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.15;
}

.modal .icon-button {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 1.25rem;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
}

.search-status {
  margin: 0.8rem 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.search-results {
  max-height: 24rem;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.search-result {
  width: 100%;
  display: block;
  padding: 1rem 0.2rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.search-result:hover {
  background: var(--paper);
}

.search-result strong,
.search-result span,
.search-result small {
  display: block;
}

.search-result small {
  margin-bottom: 0.25rem;
  color: var(--oxblood);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-result strong {
  font-family: var(--serif);
  font-size: 0.94rem;
}

.search-result span {
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.8rem;
  line-height: 1.45;
}

.settings-group {
  margin: 1.7rem 0 0;
  padding: 0;
  border: 0;
}

.settings-group legend {
  margin-bottom: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: var(--line);
}

.settings-group:nth-of-type(2) .segmented {
  grid-template-columns: repeat(2, 1fr);
}

.segmented button {
  min-height: 2.6rem;
  padding: 0.5rem;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 800;
}

.segmented button:hover,
.segmented button.is-active {
  background: var(--navy-800);
  color: #fff;
}

.settings-note {
  margin: 1.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.notes-modal label {
  display: block;
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-modal textarea {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.9rem;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 0.2rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.55;
}

.notes-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

/* Property Deep Dive editorial and flipbook layer */

.topbar {
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-left: max(1.25rem, env(safe-area-inset-left));
  background: rgb(13 43 38 / 0.97);
}

.cover h1 em {
  color: var(--gold-bright);
  font-style: italic;
  font-weight: 400;
}

.cover-disclaimer {
  margin: 1.35rem 0 0;
  color: rgb(255 255 255 / 0.68);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.as-button {
  border: 0;
  cursor: pointer;
}

.cover-art {
  perspective: 1200px;
  overflow: hidden;
}

.parcel-grid {
  position: absolute;
  inset: 8% 4% 8% -8%;
  opacity: 0.42;
  transform: rotate(-8deg);
}

.parcel-grid::before,
.parcel-grid::after,
.parcel-grid span {
  content: "";
  position: absolute;
  border: 1px solid rgb(211 179 106 / 0.62);
}

.parcel-grid::before { inset: 8% 12% 28% 18%; }
.parcel-grid::after { inset: 31% 4% 8% 32%; }
.parcel-grid span:nth-child(1) { inset: 0 48% 42% 7%; }
.parcel-grid span:nth-child(2) { inset: 48% 56% 2% 0; }
.parcel-grid span:nth-child(3) { inset: 16% 6% 54% 58%; }
.parcel-grid span:nth-child(4) { inset: 52% 18% 12% 52%; }
.parcel-grid span:nth-child(5) { top: 6%; bottom: 3%; left: 47%; border-width: 0 0 0 1px; transform: rotate(23deg); }

.book-object {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(21rem, 62%);
  aspect-ratio: 0.72;
  transform: translate(-44%, -52%) rotateY(-17deg) rotateX(5deg) rotateZ(2deg);
  transform-style: preserve-3d;
  filter: drop-shadow(1.6rem 2rem 1.5rem rgb(0 0 0 / 0.34));
  animation: book-float 7s ease-in-out infinite;
}

.book-face {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-content: space-between;
  padding: 2rem 1.6rem 1.5rem 2rem;
  border: 1px solid rgb(211 179 106 / 0.55);
  background:
    linear-gradient(130deg, transparent 0 48%, rgb(211 179 106 / 0.08) 48% 49%, transparent 49% 100%),
    linear-gradient(155deg, #214d43, #102e29 64%, #09231f);
  color: #fff;
  box-shadow: inset 0 0 0 0.45rem rgb(255 255 255 / 0.025);
}

.book-face::before {
  content: "";
  position: absolute;
  inset: 7% 9%;
  border: 1px solid rgb(211 179 106 / 0.35);
  pointer-events: none;
}

.book-face span,
.book-face small {
  position: relative;
  z-index: 1;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.book-face strong {
  position: relative;
  z-index: 1;
  color: #f7f0df;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.88;
}

.book-face small { color: var(--gold-bright); line-height: 1.4; }

.book-spine {
  position: absolute;
  inset: 0 auto 0 -1.35rem;
  width: 1.4rem;
  background: linear-gradient(90deg, #071c19, #173f37);
  transform: rotateY(-90deg);
  transform-origin: right;
}

.book-pages {
  position: absolute;
  inset: 0.45rem -0.62rem -0.55rem 0.45rem;
  z-index: 1;
  background: repeating-linear-gradient(to bottom, #efe7d5 0 2px, #d9cdb5 2px 3px);
  transform: translateZ(-0.5rem);
}

@keyframes book-float {
  0%, 100% { transform: translate(-44%, -52%) rotateY(-17deg) rotateX(5deg) rotateZ(2deg); }
  50% { transform: translate(-44%, -54%) rotateY(-13deg) rotateX(3deg) rotateZ(1deg); }
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 3.5rem 0 1rem;
  border: 1px solid var(--line-strong);
}

.feature-strip span {
  padding: 1rem;
  border-right: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.feature-strip span:last-child { border-right: 0; }

.trust-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(2rem, 8vw, 7rem);
  max-width: 76rem;
  margin: 0 auto 4rem;
  padding: clamp(2.2rem, 5vw, 4rem) clamp(1.35rem, 6vw, 5rem);
  border-block: 1px solid var(--line);
}

.trust-panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
}

.trust-panel > p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.75;
}

.legal-page a,
.front-page a { color: var(--oxblood); text-underline-offset: 0.18em; }

.chapter-body {
  font-family: var(--reader-family);
  line-height: var(--reader-leading);
}

.block-exam-tip,
.block-common-trap,
.block-hypothetical {
  position: relative;
  margin: 1.8rem 0 !important;
  padding: 1rem 1.1rem 1rem 1.25rem;
  border-left: 4px solid var(--gold);
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--gold-bright) 22%);
  box-shadow: 0 0.7rem 1.8rem rgb(9 35 31 / 0.07);
}

.block-common-trap { border-left-color: var(--oxblood); }
.block-hypothetical { border-left-color: var(--navy-700); }
.block-numbered-step { padding-left: 1rem; border-left: 2px solid var(--line-strong); }

.flipbook { margin-top: 1.5rem; }

.flip-stage {
  position: relative;
  min-height: 43rem;
  display: grid;
  place-items: center;
  padding: 2rem 4.4rem;
  overflow: hidden;
  border: 1px solid rgb(13 43 38 / 0.32);
  border-radius: 0.45rem;
  background:
    radial-gradient(circle at 50% 8%, rgb(255 255 255 / 0.08), transparent 34%),
    linear-gradient(145deg, #173f37, #09231f);
  box-shadow: inset 0 0 4rem rgb(0 0 0 / 0.2), var(--shadow);
  perspective: 1600px;
}

.flip-stage::before {
  content: "";
  position: absolute;
  inset: 3% 9%;
  border: 1px solid rgb(211 179 106 / 0.2);
  pointer-events: none;
}

.flip-page {
  position: relative;
  width: min(100%, 48rem);
  min-height: 37rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #d2c6ac;
  border-radius: 0.15rem 0.35rem 0.35rem 0.15rem;
  background:
    linear-gradient(90deg, rgb(105 77 39 / 0.09), transparent 5%, transparent 96%, rgb(105 77 39 / 0.06)),
    #fffdf7;
  color: #172521;
  box-shadow: -0.6rem 0.8rem 0 rgb(233 225 209 / 0.72), 0 1.5rem 3.5rem rgb(0 0 0 / 0.32);
  transform-origin: left center;
  transition: transform 230ms cubic-bezier(.2,.65,.3,1), opacity 180ms ease;
}

.flip-page::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1.5rem;
  background: linear-gradient(90deg, rgb(87 62 32 / 0.13), transparent);
  pointer-events: none;
}

.folio-top,
.folio-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.5rem;
  color: #65736f;
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.folio-top { border-bottom: 1px solid #e0d8c8; }
.folio-bottom { border-top: 1px solid #e0d8c8; }
.folio-bottom span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.flip-page-content {
  max-height: 33.5rem;
  overflow-y: auto;
  padding: 1.7rem 2.4rem 2rem;
  scrollbar-color: #b7aa90 transparent;
  scrollbar-width: thin;
}

.flip-page-content h2:first-child,
.flip-page-content h3:first-child { margin-top: 0.4rem; }

.flip-page-content h2 { font-size: 1.75em; }
.flip-page-content h3 { font-size: 1.25em; }
.flip-page-content p { font-size: 0.98em; line-height: 1.72; }

.flip-page.turning-next { transform: rotateY(-72deg) translateX(5%); opacity: 0.22; }
.flip-page.turning-previous { transform: rotateY(35deg) translateX(-4%); opacity: 0.28; }
.flip-page.entered-next { transform: rotateY(8deg); opacity: 0.65; }
.flip-page.entered-previous { transform: rotateY(-8deg); opacity: 0.65; }

.page-edge {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 3rem;
  height: 4.2rem;
  border: 1px solid rgb(211 179 106 / 0.48);
  border-radius: 0.25rem;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 1.15rem;
  transform: translateY(-50%);
}

.page-edge:hover { background: rgb(255 255 255 / 0.16); }
.page-edge-previous { left: 0.75rem; }
.page-edge-next { right: 0.75rem; }

button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.page-controls {
  display: grid;
  grid-template-columns: auto minmax(7rem, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.page-controls .quiet-button { min-height: 2.75rem; }
.page-range-label { display: grid; }
.page-range-label input { width: 100%; accent-color: var(--navy-700); }
.page-count { min-width: 4rem; color: var(--ink-soft); font-size: 0.72rem; font-weight: 800; text-align: center; }

.settings-modal { width: min(40rem, calc(100% - 2rem)); }
.segmented.two { grid-template-columns: repeat(2, 1fr); }
.segmented.four { grid-template-columns: repeat(4, 1fr); }

.settings-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.settings-footer p { margin: 0; color: var(--ink-soft); font-size: 0.7rem; }
.text-danger { border: 0; background: transparent; color: var(--oxblood); cursor: pointer; font-size: 0.72rem; font-weight: 800; }

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.danger-button {
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 0.25rem;
  background: #8b3f34;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

html[data-font="small"] { --reader-size: 1rem; }
html[data-font="large"] { --reader-size: 1.28rem; }
html[data-typeface="sans"] { --reader-family: var(--sans); }
html[data-spacing="relaxed"] { --reader-leading: 2; }

html[data-theme="sepia"] {
  color-scheme: light;
  --paper: #e9dfc7;
  --paper-deep: #ddd0b4;
  --surface: #f7efd9;
  --surface-raised: #fff8e5;
  --ink: #34291e;
  --ink-soft: #6d5b48;
  --line: #cdbf9e;
  --line-strong: #ad9b73;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef2ee;
  --ink-soft: #afbbb6;
  --paper: #0d1c19;
  --paper-deep: #142823;
  --surface: #12241f;
  --surface-raised: #1a302a;
  --line: #30463f;
  --line-strong: #526b63;
  --gold: #d3b36a;
  --gold-bright: #e1c47e;
  --oxblood: #f0a696;
  --mark: #735e28;
  --shadow: 0 18px 50px rgb(0 0 0 / 0.34);
}

html[data-theme="contrast"] {
  color-scheme: dark;
  --ink: #fff;
  --ink-soft: #fff;
  --paper: #000;
  --paper-deep: #000;
  --surface: #000;
  --surface-raised: #000;
  --line: #fff;
  --line-strong: #fff;
  --gold: #ffdf42;
  --gold-bright: #ffdf42;
  --oxblood: #7ffcff;
  --mark: #ffdf42;
  --shadow: none;
}

html[data-theme="contrast"] .topbar,
html[data-theme="contrast"] .flip-stage { border-color: #fff; background: #000; }
html[data-theme="contrast"] .flip-page { border: 2px solid #fff; background: #000; color: #fff; box-shadow: none; }
html[data-theme="contrast"] .folio-top,
html[data-theme="contrast"] .folio-bottom { color: #fff; border-color: #fff; }

.standalone {
  min-height: 100vh;
  background: var(--paper);
}

.standalone-header {
  padding: 1rem max(1.25rem, env(safe-area-inset-left));
  background: var(--navy-900);
  color: #fff;
}

.standalone-header a { text-decoration: none; }
.standalone-main { max-width: 52rem; margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) 1.35rem; }
.standalone-main h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 500; line-height: 1; }
.standalone-main h2 { margin-top: 2.8rem; font-family: var(--serif); font-size: 1.65rem; font-weight: 600; }
.standalone-main p,
.standalone-main li { color: var(--ink-soft); font-family: var(--serif); font-size: 1.03rem; line-height: 1.72; }
.standalone-main a { color: var(--oxblood); }
.standalone-footer { padding: 1.5rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.75rem; text-align: center; }

html[data-shell="webview"] .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
html[data-shell="webview"] .shell { padding-top: calc(var(--topbar-h) + env(safe-area-inset-top)); }
html[data-shell="webview"] .book-nav { top: calc(var(--topbar-h) + env(safe-area-inset-top)); }

.toast {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 140;
  max-width: 20rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--gold-bright);
  background: var(--navy-900);
  color: #fff;
  font-size: 0.75rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.8rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.noscript {
  position: fixed;
  inset: var(--topbar-h) 0 auto;
  z-index: 200;
  padding: 1rem;
  background: #fff1c7;
  color: #2c2112;
  text-align: center;
}

@media (max-width: 74rem) {
  .reader-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: calc(var(--reader-width) + 8rem);
  }

  .chapter-rail {
    display: none;
  }
}

@media (max-width: 58rem) {
  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .wordmark-copy small,
  .utility-button kbd {
    display: none;
  }

  .book-nav {
    transform: translateX(-102%);
    box-shadow: var(--shadow);
    transition: transform 180ms ease;
  }

  body.nav-open .book-nav {
    transform: translateX(0);
  }

  .nav-scrim {
    position: fixed;
    inset: var(--topbar-h) 0 0;
    z-index: 50;
    border: 0;
    background: rgb(4 12 22 / 0.55);
  }

  body.nav-open .nav-scrim {
    display: block;
  }

  #main-content {
    margin-left: 0;
  }

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

  .cover-copy {
    padding-bottom: 3rem;
  }

  .cover-art {
    min-height: 17rem;
  }

  .court-lines {
    inset: -25% 8% 4% 28%;
  }

  .home-intro {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 42rem) {
  :root {
    --topbar-h: 3.9rem;
  }

  .topbar {
    padding: 0 0.75rem;
  }

  .wordmark-mark {
    width: 2rem;
    height: 2rem;
  }

  .wordmark-copy strong {
    font-size: 0.87rem;
  }

  .utility-button {
    min-width: 2.55rem;
    padding: 0;
    justify-content: center;
  }

  .utility-button span:nth-child(2) {
    display: none;
  }

  .cover-copy {
    padding: 4.5rem 1.35rem 2rem;
  }

  .cover h1 {
    font-size: clamp(3rem, 16vw, 4.5rem);
  }

  .cover-meta {
    right: 1.35rem;
    bottom: 1.35rem;
  }

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

  .contents-link {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.8rem;
  }

  .contents-meta {
    grid-column: 2;
  }

  .reader-shell {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .chapter-masthead {
    margin-bottom: 3rem;
  }

  .chapter-body {
    line-height: 1.72;
  }

  .chapter-body h2 {
    margin-top: 3.8rem;
  }

  .chapter-end {
    grid-template-columns: 1fr;
  }

  .chapter-end-link:last-child {
    text-align: left;
  }

  .home-footer {
    display: block;
  }

  .home-footer nav {
    margin-top: 0.8rem;
  }

  .modal-frame {
    padding: 1.1rem;
  }
}

@media (max-width: 58rem) {
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
  .feature-strip span:nth-child(2) { border-right: 0; }
  .feature-strip span:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .trust-panel { grid-template-columns: 1fr; }
  .book-object { width: min(17rem, 54%); left: 62%; }
  .flip-stage { min-height: 39rem; padding: 1.3rem 3.8rem; }
  .flip-page { min-height: 34rem; }
  .flip-page-content { max-height: 30.5rem; padding: 1.4rem 1.7rem 1.8rem; }
}

@media (max-width: 42rem) {
  .cover-art { min-height: 21rem; }
  .book-object { width: min(14rem, 54%); left: 66%; }
  .cover-meta { right: auto; left: 1.35rem; max-width: 35%; }
  .feature-strip { grid-template-columns: 1fr; }
  .feature-strip span { border-right: 0; border-bottom: 1px solid var(--line); }
  .feature-strip span:last-child { border-bottom: 0; }
  .flip-stage { min-height: calc(100svh - 12rem); padding: 0.8rem 2.6rem; border-radius: 0; }
  .flip-page { min-height: calc(100svh - 14rem); }
  .flip-page-content { max-height: calc(100svh - 20.2rem); padding: 1.1rem 1.15rem 1.5rem; }
  .flip-page-content h2 { font-size: 1.55em; }
  .flip-page-content h3 { font-size: 1.18em; }
  .folio-top,
  .folio-bottom { padding: 0.65rem 1rem; }
  .page-edge { width: 2.25rem; height: 3.5rem; }
  .page-edge-previous { left: 0.15rem; }
  .page-edge-next { right: 0.15rem; }
  .page-controls { grid-template-columns: auto minmax(4rem, 1fr) auto; }
  .page-controls .page-count { display: none; }
  .segmented.four { grid-template-columns: repeat(2, 1fr); }
  .settings-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .book-object { animation: none !important; }
}

@media print {
  :root {
    --ink: #000;
    --paper: #fff;
    --reader-size: 11pt;
    --reader-width: none;
  }

  @page {
    size: letter;
    margin: 0.75in;
  }

  .topbar,
  .book-nav,
  .chapter-rail,
  .chapter-tools,
  .search-context,
  .chapter-end,
  .nav-scrim,
  .toast {
    display: none !important;
  }

  .shell {
    padding: 0;
  }

  #main-content {
    margin: 0;
  }

  .reader-shell {
    display: block;
    max-width: none;
    padding: 0;
  }

  .chapter-article {
    max-width: none;
  }

  .chapter-masthead {
    break-after: avoid;
  }

  .chapter-body h2,
  .chapter-body h3 {
    break-after: avoid;
  }

  .chapter-body p {
    orphans: 3;
    widows: 3;
  }
}
