:root {
  --paper: #f4f3ee;
  --card: #fffefa;
  --ink: #202b26;
  --muted: #738078;
  --green: #214939;
  --deep: #153629;
  --gold: #d3aa68;
  --line: #dedfd6;
  --han: -apple-system, BlinkMacSystemFont, "PingFang SC", "Heiti SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f6f2e9; color: var(--ink); font-family: var(--han); }
button, input { font: inherit; }
button { cursor: pointer; }
.site-shell { max-width: 1440px; margin: auto; background: #f6f2e9; min-height: 100vh; }

.masthead {
  position: relative;
  overflow: hidden;
  padding: 0 48px;
  color: #f7f4e9;
  background: radial-gradient(circle at 78% 45%, #416451 0%, #274b3b 27%, transparent 55%), linear-gradient(115deg, #112e25, #1c3e31 65%, #19392c);
  box-shadow: 0 24px 50px #0d26191c;
}
.masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background: repeating-linear-gradient(100deg, transparent 0 77px, #d8e1c9 78px, transparent 79px);
}
.topbar, .intro { position: relative; z-index: 1; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d6e0ca36; }
.brand { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 700; letter-spacing: .14em; white-space: nowrap; }
.brand small { display: inline-block; margin-left: 15px; padding-left: 17px; border-left: 1px solid #d8dfd26b; color: #c6d3c6; font-size: 12px; font-weight: 500; letter-spacing: .13em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #c5d4bb85; border-radius: 50%; color: #e5cc92; font-size: 20px; font-weight: 400; }
.header-right { display: flex; align-items: center; gap: 22px; }
.header-series { color: #b9cab9; font-family: Georgia, serif; font-size: 11px; letter-spacing: .18em; }
.preview-pill { border: 1px solid #d9e4cd57; border-radius: 999px; padding: 8px 13px; color: #d8e1d2; font-size: 11px; white-space: nowrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #e1b463; vertical-align: 1px; }

.intro { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr); gap: 42px; min-height: 470px; padding: 62px 0 64px; }
.intro-copy { align-self: center; }
.eyebrow, .section-kicker, .panel-kicker, .player-overline { font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #ddc38f; }
.eyebrow span:not(.eyebrow-rule) { color: #d8e1ce80; }
.eyebrow-rule { display: inline-block; width: 32px; height: 1px; margin: 0 9px; background: #ddc38f91; }
.title-row { display: flex; align-items: baseline; gap: 22px; margin-top: 19px; }
.title-index { color: #e1bc7b; font-family: Georgia, serif; font-size: 51px; line-height: 1; font-weight: 400; }
.intro h1 { margin: 0; font-family: var(--han); font-size: clamp(72px, 7.4vw, 108px); font-weight: 650; line-height: 1.15; letter-spacing: .055em; }
.pali-title { margin: 5px 0 19px 95px; color: #e6d6b7; font-family: Georgia, serif; font-size: 29px; font-style: italic; letter-spacing: .03em; }
.intro-lead { margin: 0; color: #e2e9dd; font-size: 19px; font-weight: 500; letter-spacing: .05em; line-height: 1.7; }
.intro-facts { display: flex; align-items: center; gap: 18px; margin-top: 30px; color: #b8c8b8; font-size: 13px; }
.intro-facts b { margin-right: 3px; color: #f4eee0; font-family: Georgia, var(--han); font-size: 19px; font-weight: 500; }
.intro-facts i { display: block; height: 15px; border-left: 1px solid #d7e2cc50; }
.intro-note { display: flex; align-items: flex-start; gap: 10px; max-width: 570px; margin-top: 30px; color: #b3c3b4; font-size: 12px; line-height: 1.8; }
.note-icon { display: grid; place-items: center; flex: none; width: 17px; height: 17px; margin-top: 2px; border: 1px solid #b8c8b890; border-radius: 50%; font-family: Georgia, serif; font-style: italic; line-height: 1; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 330px; overflow: hidden; border-left: 1px solid #e8e7d922; isolation: isolate; }
.halo { position: absolute; width: 460px; height: 460px; border: 1px solid #dbc99a3d; border-radius: 50%; }
.halo-2 { width: 330px; height: 330px; border-color: #dbc99a59; }
.halo-3 { width: 202px; height: 202px; border-color: #dbc99a85; box-shadow: 0 0 0 28px #dfc8920a, 0 0 0 60px #dfc89208; }
.hero-vertical { position: absolute; top: 20px; right: 15px; color: #d5caad92; font-family: Georgia, serif; font-size: 10px; letter-spacing: .22em; writing-mode: vertical-rl; }
.hero-glyph { position: relative; color: #f0dfb7; font-family: Georgia, serif; font-size: clamp(65px, 6vw, 95px); font-style: italic; letter-spacing: -.06em; text-shadow: 0 7px 45px #09241a; }
.hero-caption { position: absolute; bottom: 25px; color: #d8e0cd; font-size: 13px; font-weight: 500; letter-spacing: .32em; }

main { padding: 34px 32px 170px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 50px 0 25px; }
.section-kicker { color: #ac8550; }
.section-head h2 { margin: 8px 0 5px; font-size: 31px; font-weight: 680; letter-spacing: .035em; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.reading-legend { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; color: #707c71; font-size: 12px; white-space: nowrap; }
.legend-swatch { width: 12px; height: 12px; border: 1px solid #d6a654; border-radius: 3px; background: #f4d890; }
.stanza-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 23px; }
.stanza-link { border: 1px solid #d7dcd2; border-radius: 999px; padding: 8px 13px; background: #fffefa; color: #607263; font-size: 12px; font-weight: 600; }
.stanza-link:hover, .stanza-link:focus-visible { outline: 2px solid #a6bda8; outline-offset: 2px; background: #edf3e9; }
.stanza-link.active { border-color: var(--green); background: var(--green); color: #fff; }
.reading-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: start; gap: 20px; }

.catalog-panel { position: sticky; top: 94px; max-height: calc(100vh - 204px); overflow: auto; padding: 22px 18px 18px; border: 1px solid #dddccf; border-radius: 8px; background: #fffdf8; box-shadow: 0 12px 34px rgba(34,57,43,.055); }
.catalog-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 12px; border-bottom: 1px solid #dddccf; color: #203b31; font-size: 16px; font-weight: 700; white-space: nowrap; }
.catalog-heading small { color: #8e9b8d; font-family: Georgia, serif; font-size: 9px; letter-spacing: .12em; }
.catalog-caption { margin: 9px 0 21px; color: #7d897d; font-size: 11px; line-height: 1.65; }
.tree-level { margin: 0; }
.tree-level .tree-level { margin-left: 12px; padding-left: 11px; border-left: 1px solid #cbd5c8; }
.tree-level summary { display: flex; justify-content: space-between; align-items: center; min-height: 36px; color: #4a6852; font-size: 12px; font-weight: 650; list-style: none; cursor: pointer; }
.tree-level summary::-webkit-details-marker { display: none; }
.tree-level summary::before { content: "▸"; margin-right: 7px; color: #9aa99a; font-size: 11px; transition: transform .15s; }
.tree-level[open] > summary::before { transform: rotate(90deg); }
.tree-level summary span { flex: 1; }
.tree-level summary small { color: #93a093; font-family: Georgia, var(--han); font-size: 10px; font-weight: 500; }
.tree-level summary:focus-visible { outline: 2px solid #a5bda6; outline-offset: 2px; }
.chant-list { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.chant-list li { min-height: 54px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #405749; }
.chant-list li a { display: grid; grid-template-columns: 25px minmax(0,1fr); align-items: center; column-gap: 9px; row-gap: 2px; width: 100%; min-height: 54px; padding: 9px 10px; color: inherit; text-decoration: none; }
.chant-list li:not(.current):hover { border-color: #dce5d9; background: #f4f7f0; color: #275844; }
.chant-list li a:focus-visible { outline: 2px solid #a6bda8; outline-offset: 2px; }
.chant-number { width: 25px; color: #b8843a; font-family: Georgia, serif; font-size: 10px; font-weight: 700; }
.chant-name { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.chant-pending { color: #a2aca1; font-size: 9px; white-space: nowrap; }
.chant-list li.current { padding: 0; border-color: #90ac92; background: #edf3e9; }
.chant-list li.current a { min-height: 54px; color: #203b31; text-decoration: none; }
.chant-list li.current a:focus-visible { outline: 2px solid #d3aa68; outline-offset: 2px; }
.chant-list li.current .chant-number { color: #275844; }
.chant-live { grid-column: 2; color: #9a7b41; font-size: 9px; white-space: nowrap; }
.chant-list li.current .chant-live { color: #9a7136; }
.catalog-foot { display: flex; align-items: center; gap: 7px; margin-top: 22px; padding-top: 14px; border-top: 1px solid #d4dcd0; color: #7d8c7d; font-size: 11px; }
.catalog-dot { width: 7px; height: 7px; border-radius: 50%; background: #caa063; }
.catalog-panel .chant-list { margin-top: 12px; }
.catalog-panel .chant-list li { min-height: 54px; }
.catalog-panel .chant-list li a { min-height: 54px; }
.catalog-panel .reading-legend { margin-top: 17px; padding-top: 15px; border-top: 1px solid #d4dcd0; }
.load-more { padding: 14px 20px; border: 1px solid #c8d5c6; border-radius: 8px; background: #eef3e9; color: var(--green); font-weight: 650; }

.verses { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.chant-subsection { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 24px; border: 2px solid #cbb27a; border-radius: 12px; background: #faf7ef; box-shadow: 0 8px 24px rgba(33,73,57,.06); }
.chant-subsection h3 { margin: 0 0 2px; color: var(--theme-header); font-size: 16px; font-weight: 700; }
.verse { scroll-margin-top: 24px; padding: 24px 26px 25px; border: 1px solid #e0e3da; border-radius: 9px; background: var(--card); transition: border-color .2s, box-shadow .2s; }
.verse.active { border-color: #a7bea8; box-shadow: 0 6px 24px #4c705419; }
.verse-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 21px; }
.verse-number { display: flex; align-items: center; gap: 10px; color: #8b978b; font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.verse-number b { color: #ae8450; font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.line-play { padding: 7px 11px; border: 1px solid #d5decf; border-radius: 999px; background: #f5f8f1; color: var(--green); font-size: 11px; font-weight: 700; white-space: nowrap; }
.line-play:hover, .line-play:focus-visible { background: #e6f0e3; outline: none; }
.word-row { display: flex; flex-wrap: nowrap; column-gap: 15px; align-items: start; min-height: 80px; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 0 4px 20px; scrollbar-width: thin; scrollbar-color: #bdcdbd transparent; }
.word { flex: none; max-width: none; margin: 0; padding: 6px 2px 7px; border: 0; border-radius: 5px; background: transparent; color: inherit; text-align: left; transition: background .16s, box-shadow .16s; }
.word:hover { background: #f7f0e3; }
.word:focus-visible { outline: 2px solid #cba56a; outline-offset: 3px; }
.word.selected { background: #edf3e9; box-shadow: 0 0 0 3px #edf3e9; }
.word.active { background: #f4dda3; box-shadow: 0 0 0 5px #f4dda3; }
.word-pali { display: block; font-family: Georgia, serif; font-size: 23px; line-height: 1.25; letter-spacing: .005em; white-space: nowrap; }
.word-gloss { display: block; margin-top: 6px; color: #849186; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.word.active .word-pali { color: #264c35; }
.word.active .word-gloss { color: #735623; font-weight: 700; }
.word-pending .word-gloss { color: #a4aba3; }
.translation { display: flex; align-items: baseline; gap: 15px; padding-top: 17px; border-top: 1px solid #e6e9df; color: #3b5944; font-size: 15px; font-weight: 550; line-height: 1.8; }
.translation-label { flex: none; color: #98a498; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.translation-en { display: none !important; }
.reading-supplement{scroll-margin-top:24px;margin-top:14px}.reading-supplement h2{margin:0;color:var(--green);font-size:24px}.reading-supplement h3{margin:27px 0 12px;color:var(--green);font-size:17px}.reading-supplement .supplement-status,.reading-supplement .merit-source{margin:8px 0 0;color:#78877b;font-size:12px;line-height:1.7}.reading-supplement .merit-verses{overflow:hidden;border:1px solid var(--line);border-radius:8px;background:var(--card)}.reading-supplement .merit-verse{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;padding:17px 18px}.reading-supplement .merit-verse+.merit-verse{border-top:1px solid var(--line)}.reading-supplement .merit-verse p{margin:0;line-height:1.65}.reading-supplement .merit-verse>p{color:var(--green);font-family:Georgia,serif;font-size:15px}.reading-supplement .merit-verse div p{color:#3b5944;font-size:13px}.reading-supplement .merit-verse div p[lang="en"]{margin-top:8px;color:#7c897e;font-family:Arial,sans-serif;font-size:11px}.reading-supplement .merit-verse small{font-family:var(--han);font-size:11px}
@media(max-width:650px){.reading-supplement .merit-verse{grid-template-columns:1fr;gap:8px;padding:15px}.reading-supplement h2{font-size:21px}}

.source-footer { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 34px; padding: 22px 0 0; border-top: 1px solid var(--line); color: #89958b; font-size: 11px; line-height: 1.7; }

.player-wrap { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; padding: 0 26px 20px; pointer-events: none; }
.player { display: flex; align-items: center; gap: 18px; max-width: 1320px; min-height: 83px; margin: auto; padding: 16px 24px; border-radius: 11px; background: var(--deep); box-shadow: 0 17px 45px #112d2240; color: #f5f2e7; pointer-events: auto; }
.play-button { display: grid; place-items: center; width: 48px; height: 48px; flex: none; padding-left: 3px; border: 0; border-radius: 50%; background: #d6aa65; color: #173b2b; font-size: 19px; }
.play-button:hover { background: #e4bd80; }
.player-current { display: flex; flex-direction: column; gap: 4px; width: 172px; flex: none; }
.player-overline { color: #a4b9a5; font-size: 9px; }
.player-current strong { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.player-timeline { min-width: 100px; flex: 1; }
input[type=range] { width: 100%; height: 4px; margin: 0; appearance: none; border-radius: 10px; background: linear-gradient(to right, #dcb675 var(--progress,0%), #6b8a72 var(--progress,0%)); cursor: pointer; }
input[type=range]::-webkit-slider-thumb { width: 13px; height: 13px; appearance: none; border: 2px solid var(--deep); border-radius: 50%; background: #f2d398; box-shadow: 0 0 0 1px #d4aa67; }
.time-row { display: flex; justify-content: space-between; margin-top: 9px; color: #b5c9b7; font-family: Georgia, serif; font-size: 11px; }
.follow-button, .speed-button { padding: 8px 10px; border: 1px solid #668773; border-radius: 5px; background: transparent; color: #e7eddf; font-size: 11px; font-weight: 600; white-space: nowrap; }
.follow-button:hover, .speed-button:hover, .follow-button:focus-visible, .speed-button:focus-visible { background: #345a42; }
.follow-button[aria-pressed="false"] { opacity: .65; }

@media (max-width: 850px) {
  .masthead { padding: 0 27px; }
  main { padding: 26px 27px 170px; }
  .intro { grid-template-columns: 1fr; gap: 16px; padding: 47px 0 40px; }
  .hero-art { min-height: 235px; border-left: 0; border-top: 1px solid #e8e7d922; }
  .reading-layout { display: flex; flex-direction: column; }
  .catalog-panel, .verses { width: 100%; }
  .catalog-panel { position: static; max-height: none; }
  .source-footer { flex-direction: column; }
}
.stanza-nav { max-height: 100px; overflow: auto; }
@media (max-width: 600px) {
  .masthead { padding: 0 18px; }
  main { padding: 20px 18px 155px; }
  .topbar { height: 70px; }
  .brand { gap: 9px; font-size: 14px; }
  .brand-mark { width: 29px; height: 29px; font-size: 15px; }
  .brand small, .header-series { display: none; }
  .preview-pill { padding: 6px 9px; font-size: 9px; }
  .intro { padding: 35px 0 32px; }
  .eyebrow { gap: 6px; font-size: 9px; letter-spacing: .08em; }
  .eyebrow-rule { width: 15px; margin: 0 2px; }
  .title-row { gap: 13px; margin-top: 16px; }
  .title-index { font-size: 35px; }
  .intro h1 { font-size: 70px; }
  .pali-title { margin-left: 62px; font-size: 23px; }
  .intro-lead { font-size: 15px; }
  .intro-facts { gap: 9px; margin-top: 22px; font-size: 10px; }
  .intro-facts b { font-size: 15px; }
  .intro-note { margin-top: 21px; font-size: 10px; }
  .hero-art { min-height: 170px; }
  .halo { width: 270px; height: 270px; }
  .halo-2 { width: 200px; height: 200px; }
  .halo-3 { width: 125px; height: 125px; }
  .hero-glyph { font-size: 53px; }
  .hero-caption { bottom: 10px; font-size: 10px; }
  .section-head { align-items: start; margin: 33px 0 18px; }
  .section-head h2 { font-size: 23px; }
  .section-head p { font-size: 11px; }
  .reading-legend { padding-top: 7px; font-size: 10px; }
  .stanza-nav { gap: 6px; }
  .stanza-link { padding: 6px 9px; font-size: 10px; }
  .chant-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chant-list li { font-size: 11px; }
  .chant-pending, .chant-live { font-size: 8px; }
  .verse { padding: 19px 18px 20px; }
  .chant-subsection { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 24px; border: 2px solid #cbb27a; border-radius: 12px; background: #faf7ef; box-shadow: 0 8px 24px rgba(33,73,57,.06); }
  .word-row { row-gap: 7px; min-height: 0; }
  .word-pali { font-size: 20px; }
  .word-gloss { font-size: 11px; }
  .translation { gap: 10px; font-size: 13px; }
  .translation-label { font-size: 9px; }
  .player-wrap { padding: 0 8px 8px; }
  .player { gap: 8px; min-height: 75px; padding: 11px 12px; }
  .play-button { width: 42px; height: 42px; font-size: 16px; }
  .player-current { width: 81px; }
  .player-current strong { font-size: 10px; }
  .player-overline { font-size: 7px; }
  .follow-button { padding: 6px 4px; font-size: 9px; }
  .speed-button { min-width: 31px; padding: 6px 5px; font-size: 10px; }
}

/* The standalone project uses a quieter header across desktop, pad and phone. */
.brand { color: inherit; text-decoration: none; }
.back-link { color: #e1e8dd; font-size: 13px; text-decoration: none; }
.back-link:hover, .back-link:focus-visible { color: #f1d09a; text-decoration: underline; }
.intro { display: block; min-height: 0; padding: 48px 0 45px; }
.title-row { margin-top: 13px; }
.intro h1 { font-size: clamp(50px, 6vw, 76px); }
.pali-title { margin: 1px 0 0; font-size: 25px; }
.intro-facts { margin-top: 22px; }
.intro-note { margin-top: 18px; }
.section-head { margin-top: 38px; }
html[data-sutta="2"] .masthead { background: #e6e6e6; color: #111; box-shadow: none; }
html[data-sutta="2"] .masthead::after { display: none; }
html[data-sutta="2"] .eyebrow,
html[data-sutta="2"] .pali-title,
html[data-sutta="2"] .intro-facts,
html[data-sutta="2"] .intro-facts b,
html[data-sutta="2"] .intro-note { color: #111; }
@media (max-width: 600px) {
  .back-link { font-size: 11px; }
  .intro { padding: 32px 0; }
  .intro h1 { font-size: clamp(32px, 9vw, 46px); }
  .pali-title { font-size: 21px; }
}
@media (max-width: 600px) {
  .chant-list { grid-template-columns: 1fr; }
  .chant-list li, .chant-list li.current a { min-height: 46px; }
  .chant-name { overflow-wrap: normal; }
  .catalog-panel { padding: 18px 16px; }
}

.chant-subsection { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 24px; border: 2px solid #cbb27a; border-radius: 12px; background: #faf7ef; box-shadow: 0 8px 24px rgba(33,73,57,.06); }
.chant-subsection h3 { margin: 0 0 6px; padding-bottom: 12px; border-bottom: 1px solid #e5d9bd; color: #214939; font-size: 18px; font-weight: 700; letter-spacing: .04em; }
.speaker-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.speaker-junior { background: #f1e4ca; color: #8c6328; }
.speaker-elder { background: #d8e5d9; color: #214939; }

.catalog-group { margin-top: 16px; }
.catalog-group-title { padding: 4px 6px; color: #8e6938; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid #ebd3ad; margin-bottom: 8px; }
.chant-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chant-name { font-weight: 700; font-size: 13px; color: #203b31; line-height: 1.3; }
.chant-sub { color: #768578; font-size: 10px; font-weight: 400; line-height: 1.3; margin-top: 2px; }
.chant-list li a { min-height: 58px; padding: 10px; }
