:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --paper: #fffdf8;
  --ink: #1f2523;
  --muted: #626b66;
  --line: #d7cec0;
  --accent: #2f7567;
  --accent-strong: #194f47;
  --gold: #d99c2b;
  --rose: #b35d5e;
  --blue: #496f9f;
  --shadow: 0 18px 45px rgba(34, 38, 35, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(31, 37, 35, 0.1);
  background: rgba(246, 241, 232, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  font-weight: 760;
  text-decoration: none;
}

.top-nav {
  display: flex;
  gap: 18px;
  font-size: 0.93rem;
  color: var(--muted);
}

.top-nav a {
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--ink);
}

.content-shell {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
}

.intro-band {
  padding: 78px 0 64px;
  border-bottom: 1px solid rgba(31, 37, 35, 0.09);
  background:
    linear-gradient(90deg, rgba(47, 117, 103, 0.08), transparent 42%),
    var(--bg);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
  gap: 36px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.25rem, 9vw, 6.7rem);
  line-height: 0.93;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  letter-spacing: 0;
}

.intro-copy {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.reading-status {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.reading-status strong,
.reading-status span {
  display: block;
}

.reading-status span {
  color: var(--muted);
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(217, 156, 43, 0.16);
}

.section-block {
  padding: 54px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.paper-list {
  display: grid;
  gap: 16px;
}

.paper-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.paper-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.paper-card p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.paper-meta {
  margin-bottom: 8px !important;
  font-size: 0.88rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent-strong);
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fffdf8;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

.button-link:hover {
  background: var(--accent);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: 999px;
  background: #f4eadb;
  color: #454c48;
  font-size: 0.82rem;
  font-weight: 650;
}

.muted-section {
  max-width: 760px;
}

.muted-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.paper-body {
  background: #eee7dc;
}

.reader-header {
  position: sticky;
  top: 61px;
  z-index: 40;
  border-bottom: 1px solid rgba(31, 37, 35, 0.12);
  background: rgba(246, 241, 232, 0.95);
  backdrop-filter: blur(14px);
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.reader-title {
  min-width: 0;
}

.reader-title p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.84rem;
}

.reader-title h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2.3vw, 1.7rem);
  line-height: 1.15;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.ghost-button {
  min-height: 38px;
  border: 1px solid rgba(31, 37, 35, 0.16);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}

.icon-button {
  width: 38px;
}

.ghost-button {
  padding: 0 14px;
}

.icon-button:hover,
.ghost-button:hover {
  border-color: var(--accent);
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 24px;
  align-items: start;
  padding: 28px 0 64px;
}

.paper-stream {
  display: grid;
  gap: 22px;
  justify-items: center;
  min-width: 0;
}

.pdf-page {
  position: relative;
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(31, 37, 35, 0.2);
}

.pdf-page canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.page-label {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(31, 37, 35, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 760;
}

.highlight-layer {
  position: absolute;
  inset: 0;
}

.paper-highlight {
  position: absolute;
  border: 2px solid rgba(217, 156, 43, 0.78);
  border-radius: 4px;
  background: rgba(217, 156, 43, 0.26);
  box-shadow: 0 0 0 2px rgba(255, 253, 248, 0.2);
  cursor: pointer;
}

.paper-highlight[data-tone="green"] {
  border-color: rgba(47, 117, 103, 0.78);
  background: rgba(47, 117, 103, 0.22);
}

.paper-highlight[data-tone="rose"] {
  border-color: rgba(179, 93, 94, 0.78);
  background: rgba(179, 93, 94, 0.22);
}

.paper-highlight[data-tone="blue"] {
  border-color: rgba(73, 111, 159, 0.8);
  background: rgba(73, 111, 159, 0.2);
}

.paper-highlight:hover,
.paper-highlight.is-active {
  background: rgba(217, 156, 43, 0.42);
  outline: 3px solid rgba(31, 37, 35, 0.16);
}

.notes-rail {
  position: sticky;
  top: 138px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 154px);
  overflow: auto;
  padding-right: 4px;
}

.rail-empty,
.note-card,
.all-notes-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(31, 37, 35, 0.09);
}

.rail-empty {
  padding: 22px;
}

.rail-empty strong {
  display: block;
  margin-bottom: 8px;
}

.rail-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.note-card {
  padding: 18px;
}

.note-card-header {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.note-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.note-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.32rem;
  line-height: 1.12;
}

.close-card {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(31, 37, 35, 0.14);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.close-card:hover {
  color: var(--ink);
  border-color: rgba(31, 37, 35, 0.28);
}

.note-card p,
.note-card li {
  color: #3f4642;
  line-height: 1.58;
}

.note-card p {
  margin: 12px 0 0;
}

.note-card ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.note-card code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #efe4d3;
  font-size: 0.94em;
}

.all-notes-panel {
  display: none;
  padding: 16px;
}

.all-notes-panel.is-open {
  display: block;
}

.all-notes-panel h2 {
  margin: 0 0 12px;
  font-size: 1.24rem;
}

.search-input {
  width: 100%;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid rgba(31, 37, 35, 0.18);
  border-radius: 999px;
  background: #fffaf2;
  color: var(--ink);
  font: inherit;
}

.note-index {
  display: grid;
  gap: 8px;
}

.note-index button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: var(--radius);
  background: #fffaf2;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.note-index button:hover {
  border-color: var(--accent);
}

.loader {
  display: grid;
  min-height: 60vh;
  place-items: center;
  color: var(--muted);
}

@media (max-width: 900px) {
  .intro-grid,
  .paper-card-main,
  .reader-layout {
    grid-template-columns: 1fr;
  }

  .button-link {
    width: fit-content;
  }

  .reader-header {
    top: 60px;
  }

  .reader-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }

  .notes-rail {
    position: static;
    max-height: none;
    order: -1;
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .reader-header {
    top: 95px;
  }

  .intro-band {
    padding: 54px 0 44px;
  }

  .paper-card {
    padding: 18px;
  }

  .ghost-button {
    padding: 0 11px;
  }
}

/* Annotated paper walkthrough */
.walkthrough-body {
  --reader-header-height: 74px;
  --pdf-target-width: 760px;
  --annotation-gutter: clamp(410px, 31vw, 610px);
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(32, 37, 40, 0.045) 1px, transparent 1px) 0 0 / 32px 32px,
    #f2f4ef;
}

.walkthrough-shell {
  min-height: 100vh;
}

.walkthrough-body .reader-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(320px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: var(--reader-header-height);
  padding: 10px 18px;
  border-bottom: 1px solid rgba(32, 37, 40, 0.14);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.walkthrough-body .reader-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.walkthrough-body .reader-title a {
  color: #7a8582;
  font-size: 0.94rem;
  text-decoration: none;
}

.walkthrough-body .reader-title strong {
  min-width: 0;
  color: #9f2842;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-center-controls,
.reader-controls,
.page-jump,
.zoom-controls {
  display: flex;
  align-items: center;
}

.reader-center-controls {
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(32, 37, 40, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.page-jump,
.zoom-controls {
  gap: 8px;
}

.page-jump span,
.tool-readout,
.checkbox-control,
.open-count {
  color: #68726f;
  font-size: 0.9rem;
  font-weight: 760;
}

.page-input {
  width: 56px;
  min-height: 38px;
  border: 1px solid rgba(32, 37, 40, 0.14);
  border-radius: 8px;
  background: #ffffff;
  color: #202528;
  font: inherit;
  font-weight: 780;
  text-align: center;
}

.toolbar-divider {
  width: 1px;
  height: 34px;
  background: rgba(32, 37, 40, 0.12);
}

.tool-button,
.secondary-button,
.close-all-button,
.walkthrough-body .icon-button,
.annotation-nav-button {
  border: 1px solid rgba(32, 37, 40, 0.16);
  background: #ffffff;
  color: #202528;
  font: inherit;
  font-weight: 780;
  cursor: pointer;
}

.tool-button,
.walkthrough-body .icon-button,
.annotation-nav-button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.tool-button {
  border-radius: 12px;
}

.secondary-button,
.close-all-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
}

.secondary-button:hover,
.tool-button:hover,
.walkthrough-body .icon-button:hover,
.annotation-nav-button:hover {
  border-color: #149c9a;
  color: #0d7775;
}

.reader-controls {
  justify-content: flex-end;
  gap: 12px;
}

.checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  white-space: nowrap;
}

.checkbox-control input {
  width: 20px;
  height: 20px;
  accent-color: #149c9a;
}

.open-count {
  min-width: 58px;
  text-align: right;
  white-space: nowrap;
}

.close-all-button {
  display: none;
  border-color: rgba(159, 40, 66, 0.34);
  background: rgba(159, 40, 66, 0.08);
  color: #9f2842;
}

.close-all-button.is-visible {
  display: inline-flex;
}

.close-all-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #c7364f;
  color: #ffffff;
  line-height: 1;
}

.pdf-pane {
  min-height: calc(100vh - var(--reader-header-height));
}

.viewer-stage {
  position: relative;
  min-height: calc(100vh - var(--reader-header-height));
  padding: 34px clamp(12px, 2vw, 32px) 96px;
}

.pages {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 28px;
  width: min(var(--pdf-target-width), calc(100vw - var(--annotation-gutter)));
}

.reader-loading {
  padding: 34px 0;
  color: #68726f;
  font-weight: 720;
}

.walkthrough-body .pdf-page {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  max-width: none;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(26, 31, 34, 0.14);
  user-select: none;
}

.walkthrough-body .pdf-page canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pdf-page-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(32, 37, 40, 0.78);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 820;
  pointer-events: none;
}

.walkthrough-body .highlight-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.pdf-highlight {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--accent) 78%, #000);
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.pdf-highlight:hover,
.pdf-highlight:focus-visible,
.pdf-highlight.is-hovered,
.pdf-highlight.is-active {
  border-color: color-mix(in srgb, var(--accent) 92%, #000);
  outline: none;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 88%, #000);
}

.connector-layer,
.floating-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.connector-layer {
  z-index: 8;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.connector-layer path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 4 6;
}

.floating-layer {
  z-index: 9;
}

.annotation-card {
  position: absolute;
  width: min(560px, calc(100vw - 40px));
  max-height: min(650px, calc(100vh - 114px));
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--card-accent, #149c9a) 34%, rgba(32, 37, 40, 0.16));
  border-top: 5px solid var(--card-accent, #149c9a);
  border-bottom: 2px solid color-mix(in srgb, var(--card-accent, #149c9a) 34%, rgba(32, 37, 40, 0.08));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card-accent, #149c9a) 4%, #ffffff), #ffffff 150px),
    #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.74),
    inset 4px 0 0 color-mix(in srgb, var(--card-accent, #149c9a) 16%, transparent),
    0 18px 46px rgba(26, 31, 34, 0.14);
  pointer-events: auto;
  scrollbar-gutter: stable;
}

.annotation-card.is-selected {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.74),
    inset 4px 0 0 color-mix(in srgb, var(--card-accent, #149c9a) 20%, transparent),
    0 0 0 2px color-mix(in srgb, var(--card-accent, #149c9a) 34%, transparent),
    0 22px 52px rgba(26, 31, 34, 0.17);
}

.annotation-card-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 14px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--card-accent, #149c9a) 18%, rgba(32, 37, 40, 0.1));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--card-accent, #149c9a) 7%, transparent), transparent 64%),
    #ffffff;
}

.annotation-type {
  margin: 0;
  color: #68726f;
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.annotation-card h2 {
  margin: 4px 0 0;
  color: #202528;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  line-height: 1.14;
  letter-spacing: 0;
}

.annotation-card-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.annotation-nav-button,
.annotation-card .icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: color-mix(in srgb, var(--card-accent, #149c9a) 72%, #202528);
}

.annotation-card .card-close {
  border-color: rgba(159, 40, 66, 0.48);
  background: #c7364f;
  color: #ffffff;
}

.annotation-body {
  padding: 18px 20px 24px;
}

.note-question {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--card-accent, #149c9a);
  border-radius: 6px;
  background: color-mix(in srgb, var(--card-accent, #149c9a) 10%, #ffffff);
  color: #26302d;
  font-weight: 740;
  line-height: 1.48;
}

.note-section {
  padding: 15px 0;
  border-top: 1px solid rgba(32, 37, 40, 0.1);
}

.note-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.note-section h3 {
  margin: 0 0 9px;
  color: color-mix(in srgb, var(--card-accent, #149c9a) 70%, #202528);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.86rem;
  font-weight: 840;
  letter-spacing: 0;
  text-transform: uppercase;
}

.annotation-body p,
.annotation-body li {
  margin: 0;
  color: #3b4542;
  font-size: 1rem;
  line-height: 1.58;
}

.annotation-body p + p {
  margin-top: 14px;
}

.annotation-body ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.annotation-body li + li {
  margin-top: 7px;
}

.annotation-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--card-accent, #149c9a) 10%, #f4f1ea);
  font-size: 0.94em;
}

.note-formula {
  margin: 10px 0 12px;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid color-mix(in srgb, var(--card-accent, #149c9a) 22%, rgba(32, 37, 40, 0.12));
  border-radius: 8px;
  background: #fbfaf6;
  color: #202528;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 0.94rem;
  line-height: 1.45;
  white-space: nowrap;
}

.note-example,
.note-callout {
  margin: 11px 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--card-accent, #149c9a) 20%, rgba(32, 37, 40, 0.12));
  border-radius: 8px;
  background: color-mix(in srgb, var(--card-accent, #149c9a) 6%, #ffffff);
}

.note-example p + p {
  margin-top: 8px;
}

.note-callout strong,
.note-callout span {
  display: block;
}

.note-callout strong {
  margin-bottom: 4px;
  color: #202528;
}

.note-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.note-flow span {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--card-accent, #149c9a) 28%, rgba(32, 37, 40, 0.12));
  border-radius: 999px;
  background: #ffffff;
  color: #2f3835;
  font-size: 0.86rem;
  font-weight: 720;
}

.note-flow span:not(:last-child)::after {
  content: ">";
  margin-left: 8px;
  color: color-mix(in srgb, var(--card-accent, #149c9a) 72%, #202528);
}

.note-table {
  width: 100%;
  margin: 12px 0;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(32, 37, 40, 0.12);
  border-radius: 8px;
  font-size: 0.88rem;
}

.note-table th,
.note-table td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(32, 37, 40, 0.1);
  text-align: left;
  vertical-align: top;
}

.note-table th {
  background: color-mix(in srgb, var(--card-accent, #149c9a) 10%, #ffffff);
  color: #202528;
  font-weight: 820;
}

.note-table tr:last-child td {
  border-bottom: 0;
}

.notes-drawer {
  position: fixed;
  top: calc(var(--reader-header-height) + 10px);
  right: 18px;
  z-index: 120;
  display: none;
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - var(--reader-header-height) - 24px);
  overflow: auto;
  border: 1px solid rgba(32, 37, 40, 0.14);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(26, 31, 34, 0.18);
}

.notes-drawer.is-open {
  display: block;
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid rgba(32, 37, 40, 0.1);
  background: #ffffff;
}

.drawer-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.note-search {
  padding: 14px 18px 4px;
}

.note-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(32, 37, 40, 0.14);
  border-radius: 8px;
  background: #fbfaf6;
  color: #202528;
  font: inherit;
}

.note-list {
  display: grid;
  gap: 10px;
  padding: 14px 18px 18px;
}

.note-chip {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(32, 37, 40, 0.12);
  border-radius: 8px;
  background: #fbfaf6;
  color: #202528;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.note-chip:hover {
  border-color: #149c9a;
}

.note-chip-title {
  font-weight: 820;
}

.note-chip-meta,
.note-chip-snippet {
  color: #68726f;
  font-size: 0.86rem;
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .walkthrough-body .reader-header {
    grid-template-columns: 1fr;
  }

  .reader-center-controls,
  .reader-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .pages {
    width: min(var(--pdf-target-width), calc(100vw - 36px));
  }
}

@media (max-width: 820px) {
  .walkthrough-body {
    --reader-header-height: 154px;
  }

  .walkthrough-body .reader-header {
    min-height: var(--reader-header-height);
    padding: 10px;
  }

  .walkthrough-body .reader-title {
    flex-wrap: wrap;
  }

  .walkthrough-body .reader-title strong {
    width: 100%;
    white-space: normal;
  }

  .reader-center-controls {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
  }

  .reader-controls {
    width: 100%;
  }

  .checkbox-control {
    display: none;
  }

  .viewer-stage {
    padding: 22px 10px 80px;
  }

  .annotation-card {
    max-height: none;
  }
}
