/* The Fulcrum — austere book shell
   White/near-white ground, black ink, generous measure */

:root {
  --bg: #faf9f6;
  --bg-elev: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #4a4a4a;
  --ink-faint: #7a7a7a;
  --rule: #d8d4cb;
  --rule-strong: #1a1a1a;
  --accent: #1a1a1a;
  --focus: #2c5f8a;
  --measure: 38rem;
  --page-pad: clamp(1.25rem, 4vw, 2.5rem);
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.2rem);
  --line: 1.65;
  --header-h: 3.25rem;
  --consent-reserve: 10rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--font-size);
  line-height: var(--line);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-decoration: none;
}
.skip-link:focus {
  left: var(--page-pad);
  top: 0.5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  max-width: calc(var(--measure) + 8rem);
  margin: 0 auto;
  padding: 0.85rem var(--page-pad);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.site-mark {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.site-mark:hover {
  opacity: 0.7;
}
.site-nav {
  display: flex;
  gap: 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
}
.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Main */
.main {
  max-width: calc(var(--measure) + 8rem);
  margin: 0 auto;
  padding: 2rem var(--page-pad) 3rem;
}

.crumb {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
}
.crumb a {
  color: inherit;
  text-decoration: none;
}
.crumb a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Prose */
.prose {
  max-width: var(--measure);
  margin: 0 auto;
}
.prose > p {
  margin: 0 0 1.15em;
  hyphens: auto;
}
.prose > p:last-child {
  margin-bottom: 0;
}

.chapter-head {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.part-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.75rem;
}
.chapter-num {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0 0 0.35rem;
}
.chapter-head h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.35rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}
.chapter-sub {
  margin: 0.75rem 0 0;
  font-style: italic;
  color: var(--ink-muted);
  font-size: 1.05em;
}
.lede {
  font-size: 1.08em;
  color: var(--ink-muted);
  margin-top: 0 !important;
}

.closing-hold {
  font-size: 1.2em;
  font-style: italic;
  text-align: center;
  margin: 0 0 2rem !important;
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  line-height: 1.5;
}

/* Part divider */
.part-divider {
  text-align: center;
  padding: 3rem 0 2rem;
}
.part-roman {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
}
.part-head h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  line-height: 1.15;
}
.part-blurb {
  font-style: italic;
  color: var(--ink-muted);
  max-width: 28rem;
  margin: 0 auto 2.5rem;
  line-height: 1.55;
}
.part-continue {
  margin: 0;
}

/* TOC */
.toc-page .chapter-head {
  text-align: left;
}
.toc-section {
  margin: 2.5rem 0 0;
}
.toc-section h2 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc-list li {
  margin: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.toc-list a {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.65rem 0;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
}
.toc-list a:hover {
  color: var(--focus);
}
.toc-num {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-faint);
  min-width: 2rem;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.toc-part {
  margin-top: 0.25rem !important;
}
.toc-part a {
  font-weight: 600;
}
.toc-blurb {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-muted);
  padding: 0 0 0.75rem 2.75rem;
  line-height: 1.4;
}

.register-list {
  padding-left: 1.25rem;
}
.register-list li {
  margin-bottom: 0.65rem;
}
.outro {
  margin-top: 2rem !important;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}
.outro a {
  color: var(--ink);
}

kbd {
  font-family: var(--font-sans);
  font-size: 0.8em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg-elev);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: transparent;
  color: var(--ink);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
}

/* Cover */
.cover-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem var(--page-pad) 4rem;
  max-width: 36rem;
  margin: 0 auto;
}
.cover-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.35rem;
}
.cover-author {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  margin: 0 0 2.5rem;
  color: var(--ink-muted);
}
.cover-title {
  font-size: clamp(2.75rem, 2rem + 4vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.5rem;
}
.cover-subtitle {
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  font-style: italic;
  color: var(--ink-muted);
  margin: 0 0 2rem;
  letter-spacing: 0.01em;
}
.cover-rule {
  width: 3rem;
  border: none;
  border-top: 1px solid var(--rule-strong);
  margin: 0 0 2rem;
}
.cover-hold {
  font-size: 1.15rem;
  font-style: italic;
  margin: 0 0 1.75rem;
  max-width: 22rem;
  line-height: 1.45;
}
.cover-epigraph {
  margin: 0 0 2.75rem;
  padding: 0;
  border: none;
  max-width: 22rem;
}
.cover-epigraph p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
  line-height: 1.5;
}
.cover-epigraph p::before {
  content: "“";
}
.cover-epigraph p::after {
  content: "”";
}
.cover-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  justify-content: center;
  margin-bottom: 3rem;
  width: 100%;
  max-width: 28rem;
}
.cover-actions .btn,
.cover-actions .b-button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.cover-mark {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 0 1.25rem;
  opacity: 0.9;
}
.cover-actions-primary,
.cover-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
}

.cover-imprint {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

/* Chapter prev/next nav */
.chapter-nav {
  border-top: 1px solid var(--rule);
  background: var(--bg-elev);
}
.chapter-nav-inner {
  max-width: calc(var(--measure) + 8rem);
  margin: 0 auto;
  padding: 1.5rem var(--page-pad) 1.75rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
  font-family: var(--font-sans);
}
.nav-prev,
.nav-next {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
.nav-prev:hover .nav-title,
.nav-next:hover .nav-title {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.nav-next {
  text-align: right;
  justify-self: end;
}
.nav-dir {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.nav-title {
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--ink-muted);
}
.nav-toc {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  align-self: center;
  padding: 0.4rem 0.6rem;
}
.nav-toc:hover {
  color: var(--ink);
}
.nav-prev.is-empty,
.nav-next.is-empty {
  visibility: hidden;
  pointer-events: none;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem var(--page-pad) 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
}
.meta-note {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.75rem;
}
.footer-mark {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin: 0 0 0.75rem;
}
.footer-copy {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 0;
}
.footer-copy a {
  color: inherit;
  text-decoration: none;
}
.footer-copy a:hover {
  text-decoration: underline;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* About page tweaks */
.about-page .prose h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

/* Mobile */
@media (max-width: 540px) {
  .chapter-nav-inner {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .nav-next {
    text-align: left;
    justify-self: start;
    order: 3;
  }
  .nav-toc {
    order: 2;
    justify-self: start;
    padding-left: 0;
  }
  .nav-prev {
    order: 1;
  }
  .cover-actions {
    flex-direction: column;
    flex-wrap: wrap;
    width: 100%;
  }
  .cover-actions .btn {
    flex: 1 1 calc(50% - 0.75rem);
    min-width: 8.5rem;
    min-height: 44px;
    width: auto;
    text-align: center;
  }
  .toc-blurb {
    padding-left: 0;
  }
}

/* Print */
@media print {
  .site-header,
  .chapter-nav,
  .skip-link,
  .consent-banner,
  .page-foundation {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .main {
    padding: 0;
    max-width: none;
  }
  .site-footer {
    border: none;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn {
    transition: none;
  }
}


/* Manuscript draft helpers */
.prose h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}
.prose h2:first-of-type {
  margin-top: 0.5rem;
}
.prose ul,
.prose ol {
  margin: 0 0 1.15em;
  padding-left: 1.25rem;
}
.prose li {
  margin-bottom: 0.45rem;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5em;
  font-size: 0.95em;
}
.prose th,
.prose td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.prose th {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.prose td:first-child {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--ink-muted);
  width: 3.5rem;
}
.ticket {
  margin: 0 0 1.5em;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  font-size: 0.95em;
}
.ticket p {
  margin: 0 0 0.65em;
}
.ticket p:last-child {
  margin-bottom: 0;
}
.ticket-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.5rem !important;
}
.part-divider .part-open {
  text-align: left;
  max-width: var(--measure);
  margin: 0 auto 2.5rem;
  font-style: normal;
  color: var(--ink);
}

/* ---------- Talk to the book ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.talk-page {
  padding-bottom: 5rem;
}

.talk-main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem var(--page-pad) 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: calc(100vh - var(--header-h) - 8rem);
}

.talk-head h1 {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.talk-lede {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.02em;
  line-height: 1.5;
}

.talk-shell-badge {
  display: inline-block;
  margin: 0.75rem 0 0;
  padding: 0.25rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  background: var(--bg-elev);
}

.talk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
}

.talk-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 10rem;
  min-width: 8rem;
}

.talk-field-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.talk-select,
.talk-text-input,
.talk-input {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.55rem 0.65rem;
}

.talk-select:focus,
.talk-text-input:focus,
.talk-input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.talk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding-bottom: 0.35rem;
}

.talk-btn-ghost {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-muted);
  padding: 0.45rem 0.75rem;
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 0.15rem;
}

.talk-btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.talk-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.talk-chip {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 1.3;
  text-align: left;
}

.talk-chip:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.talk-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.5rem 0 1rem;
  min-height: 14rem;
  max-height: min(55vh, 28rem);
  overflow-y: auto;
  scroll-behavior: smooth;
}

.talk-bubble {
  max-width: 92%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  border-radius: 2px 12px 12px 12px;
}

.talk-bubble--user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  border-radius: 12px 2px 12px 12px;
}

.talk-bubble--book {
  align-self: flex-start;
}

.talk-meta {
  margin: 0 0 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.talk-bubble--user .talk-meta {
  color: color-mix(in srgb, var(--bg) 70%, transparent);
}

.talk-bubble-body p {
  margin: 0 0 0.65em;
  font-size: 0.98em;
  line-height: 1.55;
  white-space: pre-wrap;
}

.talk-bubble-body p:last-child {
  margin-bottom: 0;
}

.talk-composer {
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.talk-input {
  flex: 1;
  resize: vertical;
  min-height: 2.75rem;
  max-height: 8rem;
  font-family: var(--font-serif);
  line-height: 1.45;
}

.talk-send {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}

/* Settings drawer */
.talk-settings-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 28%, transparent);
  z-index: 50;
}

.talk-settings {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(22rem, 100%);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--rule);
  box-shadow: -8px 0 24px color-mix(in srgb, var(--ink) 8%, transparent);
  overflow-y: auto;
}

.talk-settings-inner {
  padding: 1.25rem 1.35rem 2.5rem;
}

.talk-settings-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.talk-settings-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.talk-settings-section {
  margin-bottom: 1.75rem;
}

.talk-settings-section h3 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.75rem;
}

.talk-hint {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.45;
  margin: 0.5rem 0 0.75rem;
}

.talk-hint code,
.talk-note code,
.talk-voice-map code {
  font-size: 0.85em;
}

.talk-note {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--rule);
  background: var(--bg-elev);
  color: var(--ink-muted);
  margin: 0 0 0.85rem;
}

.talk-voice-map {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  line-height: 1.55;
}

.talk-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.talk-settings-actions .btn {
  cursor: pointer;
}

#talk-rate {
  width: 100%;
  accent-color: var(--ink);
}

.talk-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  max-width: min(90vw, 24rem);
  padding: 0.65rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 2px;
  text-align: center;
}

/* Floating talk bubble FAB */
.talk-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 35;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 50% 50% 4px 50%;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--ink) 25%, transparent);
}

.talk-fab:hover {
  opacity: 0.88;
}

.talk-fab-bubble {
  width: 1.15rem;
  height: 0.85rem;
  border: 2px solid var(--bg);
  border-radius: 0.55rem 0.55rem 0.55rem 0.15rem;
}

@media (max-width: 540px) {
  .talk-log {
    max-height: min(48vh, 22rem);
  }
  .talk-bubble {
    max-width: 100%;
  }
  .talk-composer {
    flex-direction: column;
    align-items: stretch;
  }
  .talk-send {
    width: 100%;
    text-align: center;
  }
  .talk-settings {
    width: 100%;
  }
}

@media print {
  .talk-toolbar,
  .talk-starters,
  .talk-composer,
  .talk-fab,
  .talk-settings,
  .talk-settings-backdrop,
  .talk-toast {
    display: none !important;
  }
  .talk-log {
    max-height: none;
    overflow: visible;
  }
}


/* —— Chapter Listen / TTS samples (austere) —— */
.listen-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
}
.listen-btn {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper, #f7f4ef);
  cursor: pointer;
  border-radius: 2px;
}
.listen-btn:hover {
  opacity: 0.88;
}
.listen-btn--ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--rule);
}
.listen-btn--ghost:hover {
  color: var(--ink);
  border-color: var(--ink-muted);
}
.listen-persona {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  max-width: 11rem;
}
.listen-sample {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.listen-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  margin: 0;
  padding: 0.65rem 1rem;
  max-width: min(28rem, 92vw);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background: var(--ink);
  color: var(--paper, #f7f4ef);
  border-radius: 2px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}
.cover-epigraph .listen-sample {
  margin-top: 0.75rem;
  justify-content: center;
}

/* —— Legal diligence pages —— */
.legal-disclaimer {
  margin: 1.25rem 0 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule-strong);
  background: color-mix(in srgb, var(--bg-elev) 80%, #f0ebe3);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.5;
}
.legal-disclaimer p {
  margin: 0;
}
.legal-meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin: 0 0 1.5rem;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  margin: 1rem 0 1.5rem;
}
.legal-table th,
.legal-table td {
  border: 1px solid var(--rule);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: color-mix(in srgb, var(--bg) 70%, var(--rule));
  font-weight: 600;
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}
.footer-legal a,
.footer-legal .linkish {
  color: inherit;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.footer-legal a:hover,
.footer-legal .linkish:hover {
  text-decoration: underline;
  color: var(--ink-muted);
}
.footer-sep {
  opacity: 0.55;
}
button.linkish {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* —— Cookie consent banner —— compact card, bottom-center (not a full-bleed wall) */
.consent-banner {
  position: fixed;
  z-index: 60;
  left: 50%;
  right: auto;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(22rem, calc(100vw - 1.5rem));
  max-width: 22rem;
  max-height: min(70vh, 24rem);
  overflow: auto;
  padding: 0.7rem 0.85rem 0.8rem;
  background: color-mix(in srgb, var(--bg-elev) 96%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 10%, transparent);
  font-family: var(--font-sans);
}
.consent-banner[hidden] {
  display: none !important;
}
.consent-inner {
  max-width: none;
  margin: 0;
}
.consent-title {
  margin: 0 0 0.28rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
}
.consent-text {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-muted);
}
.consent-link {
  color: var(--ink);
}
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.2rem;
}
.consent-actions .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.consent-panel {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.consent-fine {
  margin: 0.55rem 0 0;
  font-size: 0.68rem;
  color: var(--ink-faint);
}
@media (max-width: 520px) {
  .consent-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* Keep cover primary actions above the cookie card; consent stays z 60 over orbs */
body:has(.consent-banner:not([hidden])) .cover {
  padding-bottom: calc(2.5rem + var(--consent-reserve));
}
body:has(.consent-banner:not([hidden])):not(.cover-page) {
  padding-bottom: var(--consent-reserve);
}
body:has(.consent-banner:not([hidden])) .talk-fab {
  visibility: hidden;
  pointer-events: none;
}

/* Cover footer (legal chrome on landing) */
.cover-page .cover-footer {
  border-top: none;
  padding-top: 0.5rem;
}
.cover-page .cover-footer .meta-note {
  text-transform: none;
  letter-spacing: 0.04em;
}


/* —— Youth help portal (informational, static) —— */
.youth-crisis {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule-strong);
  background: var(--bg-elev);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.5;
}
.youth-crisis h2 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.45rem;
  color: var(--ink);
}
.youth-crisis p {
  margin: 0 0 0.45rem;
}
.youth-crisis ul {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}
.youth-crisis li {
  margin: 0.2rem 0;
}
.youth-subnav {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  margin: 0 0 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
}
.youth-subnav a {
  color: var(--ink-muted);
  text-decoration: none;
}
.youth-subnav a:hover,
.youth-subnav a:focus-visible,
.youth-subnav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.youth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0 1.6rem;
}
.youth-card {
  border: 1px solid var(--rule);
  padding: 0.95rem 1rem 1.05rem;
  background: var(--bg-elev);
}
.youth-card h2 {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.youth-card p,
.youth-card ul {
  font-size: 0.95em;
}
.youth-card ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}
.youth-hold {
  margin: 1.25rem 0 1.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-style: italic;
  color: var(--ink-muted);
}
.youth-summation {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 1.25rem 0 0;
  white-space: pre-wrap;
}
.youth-summation:empty {
  display: none;
}
[data-law-agencies]:empty {
  display: none;
}
.youth-footer-crisis {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.55;
  margin: 0 0 0.65rem;
}
.youth-map th:first-child {
  width: 28%;
}
@media (max-width: 40rem) {
  .youth-split {
    grid-template-columns: 1fr;
  }
}
