:root {
  --tsw-bg: #F8F4EC;
  --tsw-surface: #FFFDF8;
  --tsw-surface-2: #F0E9DE;
  --tsw-text: #122636;
  --tsw-muted: #5B686B;
  --tsw-border: #DDD3C4;
  --tsw-accent: #224250;
  --tsw-accent-strong: #183641;
  --tsw-accent-soft: #E6EFEC;
  --tsw-gold: #E8AE47;
  --tsw-orange: #A64F0F;
  --tsw-selection: #EAF2EF;
  --tsw-shadow: 0 24px 70px rgba(18,38,54,.16);
  --tsw-reader-width: 780px;
  --tsw-font-size: 19px;
  --tsw-reading-font: Georgia, Cambria, "Times New Roman", serif;
  --tsw-ui-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-tsw-theme="dark"] {
  --tsw-bg: #0E202B;
  --tsw-surface: #142A35;
  --tsw-surface-2: #193440;
  --tsw-text: #F8F4EC;
  --tsw-muted: #B8C3C5;
  --tsw-border: #31505B;
  --tsw-accent: #85B4AB;
  --tsw-accent-strong: #A7D0C8;
  --tsw-accent-soft: #203C45;
  --tsw-gold: #F0B94D;
  --tsw-orange: #E08A42;
  --tsw-selection: #203C45;
  --tsw-shadow: 0 24px 70px rgba(0,0,0,.38);
}

@media (prefers-color-scheme: dark) {
  :root[data-tsw-theme="system"] {
    --tsw-bg: #0E202B;
    --tsw-surface: #142A35;
    --tsw-surface-2: #193440;
    --tsw-text: #F8F4EC;
    --tsw-muted: #B8C3C5;
    --tsw-border: #31505B;
    --tsw-accent: #85B4AB;
    --tsw-accent-strong: #A7D0C8;
    --tsw-accent-soft: #203C45;
    --tsw-gold: #F0B94D;
    --tsw-orange: #E08A42;
    --tsw-selection: #203C45;
    --tsw-shadow: 0 24px 70px rgba(0,0,0,.38);
  }
}

body.tsw-reader-template {
  margin: 0;
  background: var(--tsw-bg);
  color: var(--tsw-text);
  font-family: var(--tsw-ui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.tsw-reader-template * { box-sizing: border-box; }
body.tsw-sheet-open { overflow: hidden; }
body.admin-bar .tsw-reader-bar { top: 32px; }
@media (max-width: 782px) { body.admin-bar .tsw-reader-bar { top: 46px; } }

.tsw-reader-app {
  min-height: 100vh;
  background: var(--tsw-bg);
  color: var(--tsw-text);
  --tsw-font-size: 19px;
}

.tsw-reader-app a { color: inherit; }
.tsw-reader-app button,
.tsw-reader-app input { font: inherit; }
.tsw-reader-app :focus-visible {
  outline: 3px solid var(--tsw-gold);
  outline-offset: 3px;
}

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

.tsw-reader-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px clamp(16px,3vw,34px);
  border-bottom: 1px solid var(--tsw-border);
  background: color-mix(in srgb,var(--tsw-surface) 94%,transparent);
  backdrop-filter: blur(16px);
}

.tsw-reader-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--tsw-text) !important;
  text-decoration: none !important;
}

.tsw-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: var(--tsw-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}

.tsw-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.tsw-brand-copy strong { font-size: 13px; white-space: nowrap; }
.tsw-brand-copy small { margin-top: 3px; color: var(--tsw-muted); font-size: 10px; }

.tswr-reference-button,
.tsw-icon-button,
.tsw-sheet button,
.tsw-selection-bar button {
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
}

.tswr-reference-button {
  justify-self: center;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  min-width: 0 !important;
  min-height: 44px;
  padding: 0 15px !important;
  border: 1px solid var(--tsw-border) !important;
  border-radius: 999px !important;
  background: var(--tsw-surface) !important;
  color: var(--tsw-text) !important;
  font-weight: 750;
  cursor: pointer;
}
.tswr-reference-button:hover { background: var(--tsw-accent-soft) !important; }

.tsw-bar-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.tsw-icon-button {
  display: inline-grid !important;
  place-items: center;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px;
  padding: 0 !important;
  border: 1px solid var(--tsw-border) !important;
  border-radius: 12px !important;
  background: var(--tsw-surface) !important;
  color: var(--tsw-text) !important;
  font-weight: 750;
  cursor: pointer;
}
.tsw-icon-button:hover { background: var(--tsw-accent-soft) !important; }

.tsw-reader-main {
  width: min(calc(100% - 40px), var(--tsw-reader-width));
  margin-inline: auto;
  padding-block: clamp(42px,7vw,74px) 88px;
}

.tswr-chapter-header { margin-bottom: 34px; }
.tswr-eyebrow {
  margin: 0 0 10px;
  color: var(--tsw-orange);
  font-family: var(--tsw-ui-font);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.tswr-chapter-header h1 {
  margin: 0;
  color: var(--tsw-text);
  font-family: var(--tsw-reading-font);
  font-size: clamp(42px,7vw,62px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.04em;
}

.tswr-chapter-text {
  color: var(--tsw-text);
  font-family: var(--tsw-reading-font);
  font-size: var(--tsw-font-size);
  line-height: 1.82;
}
.tswr-chapter-text h2 {
  margin: 42px 0 14px;
  color: var(--tsw-muted);
  font-family: var(--tsw-ui-font);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.tswr-paragraph { margin: 0 0 1.35em; }
.tswr-paragraph--lineated { margin-bottom: 1.7em; }
.tswr-verse { border-radius: 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.tswr-verse.is-selected { background: var(--tsw-selection); outline: 4px solid var(--tsw-selection); }

.tswr-verse-number {
  display: inline !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 .22em 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--tsw-accent) !important;
  font-family: var(--tsw-ui-font);
  font-size: .62em !important;
  font-weight: 800;
  line-height: 1 !important;
  vertical-align: super;
  cursor: pointer;
}
.tswr-verse-number:hover,
.tswr-verse-number:focus-visible { color: var(--tsw-orange) !important; }

.tswr-paragraph--lineated .tswr-verse {
  display: block;
  margin: .35em 0 .85em;
  padding-left: 1.7em;
}
.tswr-paragraph--lineated .tswr-verse-number {
  float: left;
  margin-left: -1.7em !important;
  margin-top: .45em !important;
  vertical-align: baseline;
}
.tswr-line { white-space: pre-wrap; }
.tswr-stanza-gap { display: block; margin-top: .65em; }

.tswr-chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 64px;
}
.tswr-nav-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 88px;
  padding: 17px 19px;
  border: 1px solid var(--tsw-border);
  border-radius: 18px;
  background: var(--tsw-surface);
  color: var(--tsw-text) !important;
  text-decoration: none !important;
}
.tswr-nav-card:hover { background: var(--tsw-accent-soft); }
.tswr-nav-card span { color: var(--tsw-muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.tswr-nav-card strong { font-family: var(--tsw-reading-font); font-size: 21px; font-weight: 600; }
.tswr-nav-card--next { grid-column: 2; text-align: right; }

.tswr-reader-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 42px;
  color: var(--tsw-muted);
  font-size: 12px;
}
.tswr-reader-footer a { color: inherit; }

.tsw-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8,20,27,.5);
  backdrop-filter: blur(4px);
}

.tsw-sheet {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 90;
  transform: translateX(-50%);
  width: min(860px,calc(100vw - 28px));
  max-height: min(78vh,760px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--tsw-border);
  border-radius: 24px;
  background: var(--tsw-surface);
  color: var(--tsw-text);
  box-shadow: var(--tsw-shadow);
}
.tsw-sheet--small { width: min(570px,calc(100vw - 28px)); }
.tsw-sheet--study { width: min(720px,calc(100vw - 28px)); }

.tsw-sheet-head {
  position: sticky;
  top: -22px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -2px -2px 15px;
  padding: 2px 2px 12px;
  background: var(--tsw-surface);
  border-bottom: 1px solid var(--tsw-border);
}
.tsw-sheet-head h2 { margin: 0; font-family: var(--tsw-reading-font); font-size: 26px; font-weight: 600; }
.tsw-sheet-kicker { margin: 0 0 3px; color: var(--tsw-orange); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.tsw-sheet-head button {
  display: grid !important;
  place-items: center;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px;
  padding: 0 !important;
  border: 1px solid var(--tsw-border) !important;
  border-radius: 12px !important;
  background: var(--tsw-surface-2) !important;
  color: var(--tsw-text) !important;
  font-size: 22px;
  cursor: pointer;
}

.tsw-book-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 15px;
  padding: 4px;
  border-radius: 14px;
  background: var(--tsw-surface-2);
}
.tsw-book-tabs button,
.tsw-book-grid button,
.tsw-setting button,
.tsw-chapter-grid-head button {
  min-width: 0 !important;
  border: 1px solid var(--tsw-border) !important;
  background: var(--tsw-surface) !important;
  color: var(--tsw-text) !important;
  box-shadow: none !important;
  cursor: pointer;
}
.tsw-book-tabs button { padding: 10px !important; border-radius: 10px !important; }
.tsw-book-tabs button.is-active { background: var(--tsw-accent) !important; color: #fff !important; border-color: var(--tsw-accent) !important; }

.tsw-book-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.tsw-book-grid button { padding: 11px 12px !important; border-radius: 12px !important; text-align: left; }
.tsw-book-grid button:hover { background: var(--tsw-accent-soft) !important; }

.tsw-chapter-grid-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tsw-chapter-grid-head button { width: 40px !important; height: 40px; padding: 0 !important; border-radius: 11px !important; }
.tsw-number-grid { display: grid; grid-template-columns: repeat(8,1fr); gap: 7px; }
.tsw-number-grid a {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--tsw-border);
  border-radius: 11px;
  background: var(--tsw-surface);
  color: var(--tsw-text) !important;
  text-decoration: none !important;
  font-weight: 700;
}
.tsw-number-grid a:hover { background: var(--tsw-accent-soft); }

.tsw-search-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.tsw-search-form input {
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--tsw-border);
  border-radius: 12px;
  background: var(--tsw-surface-2);
  color: var(--tsw-text);
}
.tsw-search-form button {
  min-width: 0 !important;
  padding: 0 17px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--tsw-accent) !important;
  color: #fff !important;
  font-weight: 750;
}
.tsw-search-results { margin-top: 14px; }
.tsw-search-result { display: flex; flex-direction: column; gap: 4px; padding: 13px 3px; border-bottom: 1px solid var(--tsw-border); color: var(--tsw-text) !important; text-decoration: none !important; }
.tsw-search-result strong { font-size: 13px; }
.tsw-search-result span { color: var(--tsw-muted); line-height: 1.45; }
.tsw-search-result mark { background: var(--tsw-gold); color: #122636; border-radius: 3px; }

.tsw-setting {
  display: grid;
  grid-template-columns: minmax(110px,1fr) minmax(0,1.5fr);
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--tsw-border);
}
.tsw-setting:last-child { border-bottom: 0; }
.tsw-setting > span { font-weight: 750; }
.tsw-setting > div { display: flex; flex-wrap: wrap; gap: 7px; }
.tsw-setting button { padding: 9px 12px !important; border-radius: 11px !important; }
.tsw-setting button.is-active,
.tsw-setting button:hover { background: var(--tsw-accent-soft) !important; }

.tswr-study-intro { margin-bottom: 6px; color: var(--tsw-muted); }
.tswr-study-intro p { margin: 0; }
.tswr-note,
.tswr-vocab {
  display: grid;
  grid-template-columns: 66px minmax(0,1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--tsw-border);
}
.tswr-ref { padding-top: 3px; color: var(--tsw-orange); font-size: 11px; font-weight: 850; letter-spacing: .03em; }
.tswr-note p,
.tswr-vocab p { margin: 0; line-height: 1.58; }
.tswr-term { margin-bottom: 6px !important; font-family: var(--tsw-reading-font); font-size: 20px; }
.tswr-translit { color: var(--tsw-muted); font-size: .88em; }
.tswr-empty { color: var(--tsw-muted); }

.tsw-selection-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 5px;
  transform: translateX(-50%);
  max-width: calc(100vw - 24px);
  padding: 7px;
  border-radius: 999px;
  background: var(--tsw-text);
  color: var(--tsw-bg);
  box-shadow: var(--tsw-shadow);
}
.tsw-selection-bar[hidden] { display: none; }
.tsw-selection-bar > span { padding-inline: 8px; font-size: 12px; font-weight: 850; }
.tsw-selection-bar button { min-width: 0 !important; padding: 8px 10px !important; border: 0 !important; border-radius: 999px !important; background: transparent !important; color: inherit !important; }
.tsw-selection-bar button:hover { background: rgba(255,255,255,.12) !important; }

.tsw-toast {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 120;
  transform: translate(-50%,-10px);
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--tsw-text);
  color: var(--tsw-bg);
  font-size: 12px;
  opacity: 0;
  transition: .2s;
}
.tsw-toast.is-visible { transform: translate(-50%,0); opacity: 1; }

.tswr-passage-card {
  max-width: 760px;
  margin: 22px auto;
  padding: 22px;
  border: 1px solid var(--tsw-border);
  border-radius: 18px;
  background: var(--tsw-surface);
  color: var(--tsw-text);
}
.tswr-passage-card figcaption { margin-top: 12px; color: var(--tsw-muted); font-size: 12px; }
.tsw-reader-app--embed { min-height: 0; }
.tsw-reader-app--embed .tsw-reader-main { width: auto; max-width: none; padding: 20px; }
.tsw-reader-error { margin: 20px; padding: 18px; border: 1px solid #b42318; border-radius: 12px; background: #fff5f3; color: #7a271a; }
.tsw-reader-embed-template { background: transparent !important; }

@media (max-width: 760px) {
  .tsw-reader-bar {
    grid-template-columns: auto minmax(0,1fr) auto;
    min-height: 62px;
    padding: 9px 12px;
  }
  .tsw-brand-copy { display: none; }
  .tsw-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .tswr-reference-button { justify-self: stretch; justify-content: center; max-width: 220px; overflow: hidden; }
  .tswr-reference-button span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tsw-reader-main { width: min(calc(100% - 32px),var(--tsw-reader-width)); padding-top: 38px; }
  .tswr-chapter-header h1 { font-size: clamp(40px,13vw,54px); }
  .tswr-chapter-text { line-height: 1.76; }
  .tsw-book-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tsw-number-grid { grid-template-columns: repeat(6,1fr); }
  .tsw-sheet { bottom: 8px; width: calc(100vw - 16px); padding: 18px; border-radius: 20px; }
  .tsw-sheet-head { top: -18px; }
  .tsw-setting { grid-template-columns: 1fr; }
  .tswr-note,.tswr-vocab { grid-template-columns: 1fr; gap: 7px; }
  .tswr-paragraph--lineated .tswr-verse { padding-left: 1.15em; }
  .tswr-paragraph--lineated .tswr-verse-number { float: left; margin-left: -1.15em !important; margin-top: .45em !important; vertical-align: baseline; }
  .tswr-chapter-nav { grid-template-columns: 1fr; }
  .tswr-nav-card--next { grid-column: auto; text-align: left; }
}

@media (max-width: 500px) {
  .tsw-bar-actions { gap: 5px; }
  .tsw-icon-button { width: 39px !important; min-width: 39px !important; height: 39px; }
  .tsw-reader-main { width: min(calc(100% - 28px),var(--tsw-reader-width)); }
  .tsw-selection-bar [data-action="share"] { display: none; }
  .tsw-search-form { grid-template-columns: 1fr; }
  .tsw-search-form button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}


/* =========================================================
   Reader 2.0.1 refinements
   ========================================================= */

.tsw-study-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 0 !important;
  height: 42px;
  padding: 0 13px !important;
  border: 1px solid var(--tsw-border) !important;
  border-radius: 12px !important;
  background: var(--tsw-surface) !important;
  color: var(--tsw-text) !important;
  box-shadow: none !important;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.tsw-study-button:hover,
.tsw-study-button:focus-visible {
  background: var(--tsw-accent-soft) !important;
}

.tsw-study-hub-intro {
  margin: 2px 0 16px;
  color: var(--tsw-muted);
  line-height: 1.5;
}

.tsw-study-hub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tsw-study-card {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  min-width: 0 !important;
  min-height: 154px;
  padding: 17px !important;
  border: 1px solid var(--tsw-border) !important;
  border-radius: 16px !important;
  background: var(--tsw-surface) !important;
  color: var(--tsw-text) !important;
  text-align: left;
  box-shadow: none !important;
  cursor: pointer;
}
.tsw-study-card:hover,
.tsw-study-card:focus-visible {
  border-color: var(--tsw-accent) !important;
  background: var(--tsw-accent-soft) !important;
}
.tsw-study-card__label {
  font-family: var(--tsw-reading-font);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}
.tsw-study-card__count {
  margin-top: 6px;
  color: var(--tsw-orange);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tsw-study-card__description {
  margin-top: 12px;
  color: var(--tsw-muted);
  font-size: 13px;
  line-height: 1.45;
}

.tsw-chapter-grid-head {
  position: sticky;
  top: 46px;
  z-index: 1;
  padding: 8px 0 12px;
  background: var(--tsw-surface);
}
.tsw-chapter-grid-head strong {
  font-family: var(--tsw-reading-font);
  font-size: 20px;
  font-weight: 600;
}
.tsw-chapter-grid-head span {
  margin-left: auto;
  color: var(--tsw-muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .tsw-study-button {
    height: 39px;
    padding-inline: 10px !important;
    font-size: 11px;
  }
  .tsw-study-hub { grid-template-columns: 1fr; }
  .tsw-study-card { min-height: 122px; }
}

@media (max-width: 430px) {
  .tsw-study-button {
    padding-inline: 8px !important;
  }
  .tsw-bar-actions { gap: 4px; }
}


/* =========================================================
   Reader 2.0.2 — book/chapter picker visibility fix
   ========================================================= */

/*
 * These components have explicit author-level display rules (grid/flex).
 * Honor the HTML hidden state explicitly so selecting ANY OT/NT book
 * replaces the book list with its chapter selector immediately.
 */
.tsw-book-grid[hidden],
.tsw-book-tabs[hidden],
.tsw-chapter-grid[hidden] {
  display: none !important;
}


/* =========================================================
   Reader 2.1 — inline [tsw] Scripture embeds
   ========================================================= */
.tswr-inline-passage {
  margin: 1.75rem 0 2rem;
  border: 1px solid var(--tsw-border);
  border-radius: 20px;
  background: var(--tsw-surface);
  color: var(--tsw-text);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(18,38,54,.06);
}
.tswr-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--tsw-border);
  background: color-mix(in srgb,var(--tsw-surface) 88%,var(--tsw-bg));
}
.tswr-inline-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tswr-inline-eyebrow {
  color: var(--tsw-orange);
  font-family: var(--tsw-ui-font);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.tswr-inline-title {
  color: var(--tsw-text);
  font-family: var(--tsw-reading-font);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
}
.tswr-inline-open {
  flex: 0 0 auto;
  color: var(--tsw-accent) !important;
  font-family: var(--tsw-ui-font);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none !important;
}
.tswr-inline-open:hover,
.tswr-inline-open:focus-visible {
  text-decoration: underline !important;
}
.tswr-inline-content {
  padding: 22px 20px 18px;
}
.tswr-inline-scripture {
  color: var(--tsw-text);
  font-family: var(--tsw-reading-font);
  font-size: clamp(1.06rem,1.5vw,1.2rem);
  line-height: 1.78;
}
.tswr-inline-section-heading {
  margin: 1.6rem 0 .65rem !important;
  color: var(--tsw-muted) !important;
  font-family: var(--tsw-ui-font) !important;
  font-size: .68rem !important;
  font-weight: 850 !important;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tswr-inline-section-heading:first-child {
  margin-top: 0 !important;
}
.tswr-inline-paragraph {
  margin: 0 0 1.2em !important;
}
.tswr-inline-paragraph:last-child {
  margin-bottom: 0 !important;
}
.tswr-inline-verse {
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.tswr-inline-vnum {
  margin-right: .28em;
  color: var(--tsw-accent);
  font-family: var(--tsw-ui-font);
  font-size: .62em;
  font-weight: 850;
  line-height: 1;
  vertical-align: super;
}
.tswr-inline-paragraph--lineated .tswr-inline-verse {
  display: block;
  margin: .28em 0 .72em;
  padding-left: 1.55em;
}
.tswr-inline-paragraph--lineated .tswr-inline-vnum {
  float: left;
  margin-left: -1.55em;
  margin-top: .48em;
  vertical-align: baseline;
}
.tswr-inline-line { white-space: pre-wrap; }
.tswr-inline-stanza-gap { display: block; margin-top: .6em; }

.tswr-inline-accordion {
  border: 0;
}
.tswr-inline-accordion > summary {
  padding: 15px 20px;
  border-bottom: 1px solid var(--tsw-border);
  color: var(--tsw-accent);
  font-family: var(--tsw-ui-font);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.tswr-inline-accordion[open] > summary {
  background: var(--tsw-accent-soft);
}

.tswr-inline-study {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--tsw-border);
}
.tswr-inline-study-panel {
  border-bottom: 1px solid var(--tsw-border);
}
.tswr-inline-study-panel:last-child {
  border-bottom: 0;
}
.tswr-inline-study-panel > summary {
  padding: 13px 20px;
  color: var(--tsw-accent);
  font-family: var(--tsw-ui-font);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.tswr-inline-study-panel[open] > summary {
  background: var(--tsw-accent-soft);
}
.tswr-inline-study-body {
  padding: 4px 20px 18px;
}
.tswr-inline-note,
.tswr-inline-vocab {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--tsw-border);
}
.tswr-inline-note:first-child,
.tswr-inline-vocab:first-child {
  border-top: 0;
}
.tswr-inline-ref {
  color: var(--tsw-orange);
  font-family: var(--tsw-ui-font);
  font-size: 11px;
  font-weight: 850;
}
.tswr-inline-note p,
.tswr-inline-vocab p {
  margin: 0 !important;
  color: var(--tsw-text);
  line-height: 1.55;
}
.tswr-inline-term {
  margin-bottom: 4px !important;
  font-family: var(--tsw-reading-font);
  font-size: 1.06rem;
}
.tswr-inline-translit {
  color: var(--tsw-muted);
}
.tswr-inline-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 9px 20px 11px;
  border-top: 1px solid var(--tsw-border);
  color: var(--tsw-muted);
  font-family: var(--tsw-ui-font);
  font-size: 10px;
}
.tswr-inline-footer a {
  color: inherit !important;
}
.tswr-inline-error {
  margin: 1rem 0;
  padding: 12px 14px;
  border: 1px solid var(--tsw-border);
  border-radius: 12px;
  background: var(--tsw-surface);
  color: var(--tsw-text);
}

@media (max-width: 640px) {
  .tswr-inline-passage {
    margin-inline: -4px;
    border-radius: 16px;
  }
  .tswr-inline-header {
    align-items: flex-start;
    padding: 14px 15px;
  }
  .tswr-inline-title {
    font-size: 19px;
  }
  .tswr-inline-open {
    margin-top: 3px;
    font-size: 11px;
  }
  .tswr-inline-content {
    padding: 18px 15px 15px;
  }
  .tswr-inline-study-panel > summary,
  .tswr-inline-study-body {
    padding-left: 15px;
    padding-right: 15px;
  }
  .tswr-inline-note,
  .tswr-inline-vocab {
    grid-template-columns: 38px minmax(0,1fr);
    gap: 9px;
  }
  .tswr-inline-footer {
    padding-inline: 15px;
  }
}


/* Reader 2.4.1 — launch accessibility hardening */
.tsw-sheet { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tswr-note p, .tswr-vocab p, .tsw-search-result span, .tsw-study-card__description { overflow-wrap: anywhere; }
@media (max-width: 430px) {
  .tswr-inline-paragraph--lineated .tswr-inline-verse { padding-left: 1.2em; }
  .tswr-inline-paragraph--lineated .tswr-inline-vnum { margin-left: -1.2em; }
}

/* =========================================================
   Reader 2.4.3 — mobile reader + direct study controls
   ========================================================= */

/* The chapter toolbar is an app control surface, not page content. Keep it
 * compact and predictable even when a site theme has broad button/link rules. */
.tsw-reader-bar {
  grid-template-columns: minmax(170px,1fr) auto auto minmax(100px,1fr);
  grid-template-areas: "brand reference study actions";
  column-gap: 14px;
}
.tsw-reader-brand { grid-area: brand; justify-self: start; }
.tswr-reference-button { grid-area: reference; }
.tsw-study-shortcuts {
  grid-area: study;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.tsw-bar-actions { grid-area: actions; }

.tsw-back-arrow { display: none; }
.tsw-study-label-short { display: none; }

.tsw-study-chip {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  border: 1px solid var(--tsw-border) !important;
  border-radius: 999px !important;
  background: var(--tsw-surface) !important;
  color: var(--tsw-text) !important;
  box-shadow: none !important;
  font-family: var(--tsw-ui-font) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer;
}
.tsw-study-chip:hover,
.tsw-study-chip:focus-visible {
  border-color: var(--tsw-accent) !important;
  background: var(--tsw-accent-soft) !important;
  color: var(--tsw-text) !important;
}
.tsw-study-chip.is-empty { color: var(--tsw-muted) !important; }
.tsw-study-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--tsw-accent-soft);
  color: var(--tsw-accent-strong);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
:root[data-tsw-theme="dark"] .tsw-study-count { color: var(--tsw-text); }
@media (prefers-color-scheme: dark) {
  :root[data-tsw-theme="system"] .tsw-study-count { color: var(--tsw-text); }
}

/* Old intermediate Study hub is no longer part of the reader UI. These
 * selectors remain harmless for backwards-cached markup. */
.tsw-study-button,
.tsw-study-hub-intro,
.tsw-study-hub { display: none !important; }

@media (max-width: 760px) {
  .tsw-reader-bar {
    grid-template-columns: auto minmax(0,1fr) auto;
    grid-template-areas:
      "brand reference actions"
      "study study study";
    gap: 7px 9px;
    min-height: 0;
    padding: 8px 10px 9px;
  }
  .tsw-reader-brand {
    min-width: 0;
  }
  .tsw-brand-copy { display: none !important; }
  .tsw-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 48px;
    height: 38px;
    flex: 0 0 48px;
    border-radius: 999px;
  }
  .tsw-back-arrow {
    display: inline;
    margin-top: -1px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
  }
  .tswr-reference-button {
    justify-self: stretch;
    width: 100% !important;
    max-width: none !important;
    min-height: 40px;
    height: 40px;
    padding-inline: 10px !important;
    font-size: 14px !important;
  }
  .tsw-bar-actions {
    justify-self: end;
    gap: 6px;
  }
  .tsw-icon-button {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px;
    border-radius: 999px !important;
  }
  .tsw-study-shortcuts {
    justify-self: center;
    width: 100%;
    gap: 8px;
  }
  .tsw-study-chip {
    min-height: 34px !important;
    padding: 5px 12px !important;
    font-size: 11px !important;
  }
  .tsw-reader-main {
    width: min(calc(100% - 30px),var(--tsw-reader-width));
    padding-top: 32px;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .tswr-chapter-header { margin-bottom: 28px; }
  .tswr-chapter-header h1 {
    font-size: clamp(40px,12vw,52px);
    line-height: 1;
  }
  .tswr-chapter-text { line-height: 1.68; }
  .tswr-chapter-text h2 { margin-top: 36px; }

  /* On phones, sheets behave like native bottom sheets and avoid colliding
   * visually with Safari's browser chrome. */
  .tsw-sheet,
  .tsw-sheet--small,
  .tsw-sheet--study {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100vw;
    max-width: none;
    max-height: min(82dvh, 720px);
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
  }
  .tsw-sheet-head {
    top: -18px;
    margin-inline: 0;
    padding-top: 4px;
  }
  .tsw-sheet-head h2 { font-size: 24px; }
}

@media (max-width: 430px) {
  .tsw-reader-bar { gap: 6px 7px; }
  .tsw-mark { width: 44px; flex-basis: 44px; }
  .tswr-reference-button { font-size: 13px !important; }
  .tsw-bar-actions { gap: 5px; }
  .tsw-icon-button { width: 38px !important; min-width: 38px !important; height: 38px; }
  .tsw-study-chip { flex: 1 1 0; max-width: 150px; }
  .tsw-study-label-long { display: none; }
  .tsw-study-label-short { display: inline; }
  .tsw-reader-main { width: calc(100% - 28px); }
}
