#main.is-reading {
  --toolbar-height: 49px;
  width: min(1510px, 100%);
  padding: 0 0 28px;
}
.is-reading > .notice { margin: 12px 18px; }
.reader {
  display: grid;
  grid-template-columns: clamp(218px, 21vw, 282px) minmax(0, 1fr);
  align-items: start;
}
.reader-index {
  position: sticky;
  top: var(--site-head);
  height: calc(100vh - var(--site-head));
  height: calc(100dvh - var(--site-head));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 20px 14px;
  background: var(--paper);
  border-right: 1px solid var(--line);
}
.index-book {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 4px 16px;
}
.index-book .cover { width: 43px; height: 65px; }
.index-book strong {
  display: block;
  font: 700 19px/1.12 Georgia, serif;
  overflow-wrap: anywhere;
}
.index-book small { color: var(--muted); font-size: 12px; }
.index-progress {
  padding: 11px 12px;
  margin-bottom: 19px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.index-progress div { display: flex; justify-content: space-between; align-items: center; }
.index-progress small { color: var(--muted); font-size: 11px; }
.index-progress progress {
  display: block;
  width: 100%;
  height: 6px;
  margin: 5px 0 3px;
  accent-color: var(--leaf);
}
.index-quick-contents {
  margin: 0 0 16px;
}
.index-show-contents-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: var(--wash, #f3efe6);
  border: 1px solid var(--line, #e2dac9);
  border-radius: 9px;
  color: var(--ink, #1f1d1a);
  font: 600 12.5px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
.index-show-contents-btn svg {
  flex-shrink: 0;
  stroke: var(--ink, #1f1d1a);
}
.index-show-contents-btn:hover {
  background: #fbf7ee;
  border-color: #cb2b2b;
  color: #cb2b2b;
}
.index-show-contents-btn:hover svg {
  stroke: #cb2b2b;
}
.index-show-contents-btn.active {
  background: #fff4f2;
  border-color: #cb2b2b;
  color: #cb2b2b;
  font-weight: 700;
}
.index-show-contents-btn.active svg {
  stroke: #cb2b2b;
}
.index-heading, .index-progress strong, .chapter-group > summary {
  color: var(--leaf);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .095em;
}
.index-heading { margin: 0 4px 8px; text-transform: uppercase; }
.chapter-group { margin: 0 0 8px; }
.chapter-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  padding: 7px 5px;
}
.chapter-group > summary::-webkit-details-marker { display: none; }
.chapter-group > summary::after { content: '+'; font-size: 13px; }
.chapter-group[open] > summary::after { content: '−'; }
.index-chapter {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 13px;
  gap: 7px;
  align-items: center;
  width: 100%;
  padding: 7px 5px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.32;
  overflow-wrap: anywhere;
}
.index-chapter:hover, .index-chapter[aria-current] {
  background: var(--wash);
  border-color: var(--line);
  color: var(--leaf);
}
.index-chapter[aria-current] { font-weight: 750; }
.index-number {
  display: grid;
  place-items: center;
  min-height: 23px;
  padding: 1px;
  font-size: 9px;
  font-weight: 800;
  color: var(--leaf);
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.index-chapter svg, .reader svg.control-icon, .reader button > svg, .reader .back-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.index-close, .index-shade, #reader-contents { display: none; }
.reader-page { min-width: 0; }
.reader-toolbar {
  position: sticky;
  top: var(--site-head);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--toolbar-height);
  padding: 0 clamp(12px, 4vw, 50px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.reader-tools, .reader-location { display: flex; align-items: center; gap: 7px; }
.reader-tool, .reader .back-link { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.reader .back-link {
  padding: 4px 0;
  color: var(--leaf);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.reader-tool[aria-pressed="true"] { background: var(--wash); border-color: var(--leaf); }
.reader-track { position: absolute; inset: auto 0 -1px; height: 2px; }
.reader-track span { display: block; width: 0; height: 100%; background: var(--leaf); transition: width .12s; }
.reader-toolbar details { position: relative; }
.reader-toolbar details > summary { list-style: none; cursor: pointer; }
.reader-toolbar details > summary::-webkit-details-marker { display: none; }
.display-menu {
  position: absolute;
  top: 39px;
  right: 0;
  z-index: 3;
  min-width: 180px;
  padding: 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 8px 24px #172a1a22;
}
.display-menu div { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.display-menu p { color: var(--muted); font-size: 11px; margin: 0 0 4px; }
.display-menu div + p { margin-top: 10px; }
.display-menu button {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 12px;
}
.display-menu button[aria-pressed="true"] { border-color: var(--leaf); font-weight: 700; }
.display-menu output { font-size: 12px; color: var(--muted); }
.reader-content { max-width: 1110px; margin: auto; padding: 23px clamp(19px, 4vw, 50px) 0; }
.edition {
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 301px;
  padding: 28px clamp(23px, 4vw, 53px);
  border-radius: 16px;
  color: #f5f2e4;
  background: #203b2b;
  box-shadow: 0 6px 19px #253a2222;
}
.edition-copy { max-width: min(100%, 605px); }
.edition .eyebrow { color: #d4e2ab; }
.edition h1 {
  font: 400 clamp(42px, 6vw, 86px)/.94 Georgia, serif;
  letter-spacing: -.055em;
  margin: 15px 0 12px;
  overflow-wrap: anywhere;
}
.edition h1 em { font-weight: 400; color: #d7e4ac; }
.edition-subtitle { color: #e4e9d5; font: 16px Georgia, serif; margin: 0 0 15px; }
.edition-author {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
  color: #f0f1e5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  margin: 0;
}
.edition-author b { color: #d4e2b1; font-size: 12px; font-weight: 400; letter-spacing: 0; }
.edition-art {
  position: absolute;
  width: min(65%, 575px);
  height: 100%;
  top: 0;
  right: 0;
  z-index: -1;
}
.edition:not(.is-atomic) .edition-art { opacity: .5; }
.edition-annotation { fill: #c3d89c; font: 9px system-ui, sans-serif; letter-spacing: .13em; }
.edition:not(.is-atomic) .edition-annotation { display: none; }
.edition-path { stroke-dasharray: 420; animation: edition-draw 1.2s ease-out both; }
@keyframes edition-draw { from { stroke-dashoffset: 420; } to { stroke-dashoffset: 0; } }
.reader-chapter { scroll-margin-top: calc(var(--site-head) + var(--toolbar-height) + 9px); }
.reader-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin: 17px 0 12px;
}
.reader-bar p { margin: 0; line-height: 1.35; }
.reader-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reader-chunk-pager {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}
.btn-chunk-nav {
  background: none;
  border: none;
  padding: 2px 7px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--leaf);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s;
}
.btn-chunk-nav:disabled {
  opacity: 0.3;
  cursor: default;
}
.btn-chunk-nav:not(:disabled):hover {
  background: rgba(0,0,0,0.06);
}
.chunk-badge {
  padding: 0 4px;
  white-space: nowrap;
}
.reader-modes {
  display: flex;
  flex: none;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: var(--paper);
}
.reader-modes button {
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}
.reader-modes button[aria-pressed="true"] { background: var(--wash); color: var(--leaf); }
.reader-shell {
  padding: clamp(23px, 4vw, 55px) clamp(18px, 5vw, 62px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.reader-inner { max-width: 710px; margin: auto; animation: appear .22s ease-out both; }
.reader-title {
  font: 400 clamp(32px, 5vw, 54px)/1.08 Georgia, serif;
  letter-spacing: -.042em;
  margin: 12px 0 10px;
  overflow-wrap: anywhere;
  outline: none;
}
.chapter-tag {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 20px;
  background: var(--wash);
  color: var(--leaf);
}
.reader-status {
  display: flex;
  gap: 5px 13px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 20px;
}
.save-state { margin-left: auto; }
.note-jump {
  padding: 0;
  border: 0;
  background: none;
  color: var(--leaf);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: inherit;
}
.chapter-body { font: var(--font-size)/1.75 Georgia, serif; overflow-wrap: anywhere; }
.chapter-body p { margin: 0 0 .9em; }
.chapter-body h3 { font-size: 1.15em; line-height: 1.35; margin: 1.45em 0 .55em; }
.chapter-body figure { margin: 1.4em 0; background: var(--wash); border: 1px solid var(--line); padding: 9px; border-radius: 9px; }
.chapter-body img { display: block; width: 100%; height: auto; max-height: 490px; object-fit: contain; background: white; border-radius: 5px; }
.chapter-body figcaption { font: 12px/1.55 system-ui, sans-serif; margin-top: 8px; color: var(--muted); }
.source-page, .chapter-body .guide { scroll-margin-top: calc(var(--site-head) + var(--toolbar-height) + 12px); }
.chapter-body a { color: var(--leaf); text-underline-offset: 3px; }
.guide {
  background: var(--wash);
  border: 1px solid var(--line);
  border-left: 3px solid var(--leaf);
  padding: 13px 15px;
  border-radius: 8px;
  font: max(14px, calc(var(--font-size) - 3px))/1.78 system-ui, sans-serif;
  margin: 17px 0;
}
.guide summary { cursor: pointer; color: var(--leaf); font-weight: 750; }
.guide p { margin: 7px 0 0; white-space: pre-line; }
.study-details { margin: 16px 0 0; }
.study-details h2 { font: 700 1.25em/1.3 Georgia, serif; margin: 0 0 8px; }
.study-details p { white-space: pre-line; }
.reader-bottom { display: flex; justify-content: space-between; gap: 7px; margin: 14px 0 0; flex-wrap: wrap; }
.reader-bottom .btn { font-size: 12px; }
.reader-bottom #complete[aria-pressed="true"] { background: var(--wash); border-color: var(--leaf); }
.reader.is-focused { grid-template-columns: minmax(0, 1fr); }
.reader.is-focused .reader-index, .reader.is-focused .edition { display: none; }
.reader.is-focused .reader-content { max-width: 900px; padding-top: 4px; }
@media (max-width: 760px) {
  .reader { display: block; }
  #reader-contents { display: inline-flex; }
  .reader-toolbar { padding-inline: 12px; }
  .reader-content { padding: 13px 12px 0; }
  .reader-index, .reader.is-focused .reader-index {
    display: none;
    position: fixed;
    inset: var(--site-head) auto 0 0;
    z-index: 7;
    width: min(86vw, 300px);
    height: auto;
    box-shadow: 10px 0 28px #16291b45;
  }
  .reader.index-open .reader-index { display: block; }
  .index-close { display: inline-flex; position: absolute; top: 11px; right: 10px; }
  .index-book { padding-right: 29px; }
  .reader.index-open .index-shade {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 6;
    background: #12201599;
    border: 0;
  }
  .edition { min-height: 235px; border-radius: 12px; padding: 22px 19px; }
  .edition h1 { font-size: clamp(41px, 12vw, 68px); }
  .edition-art { width: 80%; right: -46px; opacity: .65; }
  .edition:not(.is-atomic) .edition-art { opacity: .35; }
  .edition-annotation { display: none; }
  .reader-bar { margin: 12px 0 9px; }
  .reader-bar .eyebrow { font-size: 9px; letter-spacing: .075em; }
  .reader-modes button { font-size: 11px; padding: 6px; }
  .reader-shell { border-radius: 10px; }
}
@media (max-width: 380px) {
  .reader-toolbar { padding-inline: 9px; }
  .reader-tool { padding-inline: 6px; }
  .reader-bottom .btn { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .reader *, .reader *::before, .reader *::after { animation: none !important; transition: none !important; }
}

.source-text mark[data-highlight] {
  background: #f7df83;
  color: #352a13;
  border-radius: 2px;
  cursor: pointer;
}
:root[data-theme="dark"] .source-text mark[data-highlight] { background: #806325; color: #fff2c1; }
.reader-actions {
  position: fixed;
  z-index: 1000;
  width: min(340px, calc(100vw - 24px));
  max-height: min(48vh, 300px);
  overflow: auto;
  padding: 12px 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(18, 36, 24, 0.22), 0 3px 8px rgba(0, 0, 0, 0.08);
  overscroll-behavior: contain;
  animation: popoverFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Caret Arrow pointing to the clicked word */
.reader-actions::before,
.reader-actions::after {
  content: "";
  position: absolute;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  pointer-events: none;
}

/* Arrow when popup is ABOVE the word */
.reader-actions.placement-above::before {
  bottom: -9px;
  border-top: 9px solid var(--line);
}
.reader-actions.placement-above::after {
  bottom: -7px;
  border-top: 8px solid var(--paper);
}

/* Arrow when popup is BELOW the word */
.reader-actions.placement-below::before {
  top: -9px;
  border-bottom: 9px solid var(--line);
}
.reader-actions.placement-below::after {
  top: -7px;
  border-bottom: 8px solid var(--paper);
}

.lookup-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.lookup-badge { font-size: 11px; font-weight: 750; color: var(--leaf); letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 4px; }
.lookup-top .small-button { padding: 4px 6px; font-size: 13px; border-radius: 6px; line-height: 1; }
.lookup-quote {
  margin: 4px 0 8px;
  max-height: 3.8em;
  overflow: auto;
  font: 700 16px/1.3 Georgia, serif;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.tapped-indicator-word {
  color: #e53935;
  border-bottom: 1.5px solid #e53935;
  padding-bottom: 1px;
}
.lookup-result {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.lookup-result[lang="am"] {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--leaf);
  background: var(--wash);
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 6px 0 8px;
}
.lookup-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.lookup-actions .btn { padding: 6px 10px; font-size: 11.5px; }

.reader-tip { margin: -11px 0 18px; color: var(--muted); font-size: 11px; }
.lookup-source { margin: -4px 0 6px; font-size: 11px; color: var(--muted); }

.translation-upload { position: relative; cursor: pointer; }
.translation-upload:focus-within { outline: 2px solid currentColor; }
.translation-upload input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

/* Active Tapped Word Dialogue Indicator */
.active-tapped-word {
  background: rgba(229, 57, 53, 0.16) !important;
  color: #d32f2f !important;
  border-bottom: 2.5px solid #e53935 !important;
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.12);
  padding: 0 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}
:root[data-theme="dark"] .active-tapped-word {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #fca5a5 !important;
  border-bottom-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Language Choice Modal for First-Time Readers */
.lang-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 25, 17, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: appear 0.2s ease-out;
}
.lang-modal-dialog {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: min(480px, 100%);
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  animation: popoverFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.lang-modal-icon {
  font-size: 40px;
  margin-bottom: 10px;
  display: inline-block;
}
.lang-modal-dialog h2 {
  font: 700 24px/1.2 Georgia, serif;
  color: var(--ink);
  margin: 0 0 4px;
}
.lang-modal-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--leaf);
  margin: 0 0 12px;
}
.lang-modal-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 22px;
}
.lang-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.lang-option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--wash);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.lang-option-card:hover {
  background: var(--paper);
  border-color: var(--leaf);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(18, 36, 24, 0.12);
}
.lang-flag {
  font-size: 28px;
  flex-shrink: 0;
}
.lang-info {
  flex: 1;
  min-width: 0;
}
.lang-info strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 2px;
}
.lang-info small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.lang-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #e53935;
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.lang-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* Quick Reader Tutorial Guide */
.tutorial-dialog {
  width: min(540px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  text-align: left;
  padding: 26px 22px;
}
.tutorial-dialog .lang-modal-icon {
  display: block;
  text-align: center;
  font-size: 36px;
  margin-bottom: 6px;
}
.tutorial-dialog h2 {
  text-align: center;
  font: 700 22px/1.2 Georgia, serif;
}
.tutorial-dialog .lang-modal-subtitle {
  text-align: center;
  margin-bottom: 18px;
}
.tutorial-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}
.tutorial-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
}
.tutorial-badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--leaf);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  margin-top: 2px;
}
.tutorial-card-body {
  flex: 1;
  min-width: 0;
}
.tutorial-card-body strong {
  display: block;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 3px;
}
.tutorial-card-body p {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 4px;
}
.tutorial-card-body small {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.tutorial-done-btn {
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  background: var(--leaf);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(18, 92, 49, 0.28);
  transition: transform 0.15s ease, background 0.15s ease;
  text-align: center;
  display: block;
}
.tutorial-done-btn:hover {
  background: #104e29;
  transform: translateY(-1px);
}
@media (max-width: 520px) {
  .reader-tools .reader-tool span {
    display: none;
  }
}

