/* research/vishnu-sahasranama/ — shared rm- styles (from the Rāmāyaṇa/Tirukkural studies) + vs- styles (vishnusahasranama_build). */
.rm { --rm-q: #2f6f86; --rm-g: #5c7f3c; --rm-gold: #a8742a; --rm-plum: #7a4a78; }
html.dark-mode .rm { --rm-q: #8cc4d8; --rm-g: #a9cf86; --rm-gold: #e2b56a; --rm-plum: #cfa3cd; }
.rm .deva { font-family: 'Noto Serif Devanagari', serif; }
.rm i { font-style: italic; }

/* hero */
.rm-hero { padding: 34px 0 26px; background: linear-gradient(180deg, var(--accent-light), transparent); }
.rm-hero-in { display: grid; gap: 22px; align-items: center; }
.rm-hero.has-img .rm-hero-in { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.rm-kicker { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-light); margin: 0 0 10px; }
.rm-kicker a { color: var(--accent); text-decoration: none; }
.rm-hero-deva { color: var(--accent); font-size: 1.35rem; margin: 0 0 4px; }
.rm-hero h1 { font-family: var(--font-heading); font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.12; margin: 0 0 12px; }
.rm-hero .lede { font-size: 1.05rem; line-height: 1.75; color: var(--text-muted); max-width: 760px; margin: 0; }
.rm-hero-img .rm-fig { margin: 0; }
@media (max-width: 820px) { .rm-hero.has-img .rm-hero-in { grid-template-columns: 1fr; } .rm-hero-img { max-width: 460px; } }

/* page tabs */
.rm-tabs { position: sticky; top: var(--header-h, 64px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border-light); }
.rm-tabs .container { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; padding-top: 8px; padding-bottom: 8px; }
.rm-tab { flex: none; padding: 6px 12px; border-radius: 999px; font-size: .86rem; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.rm-tab:hover { color: var(--accent); background: var(--accent-light); }
.rm-tab.is-on { background: var(--accent); color: #fff; }
.rm-main { padding-top: 22px; padding-bottom: 30px; }

/* boxes and headings */
.rm-gh { font-family: var(--font-heading); font-size: clamp(1.35rem, 3vw, 1.75rem); margin: 34px 0 12px; color: var(--text); }
.rm-h { font-family: var(--font-heading); font-size: 1.12rem; margin: 0 0 8px; color: var(--accent-dark, var(--accent)); }
.rm-sub { color: var(--text-muted); margin: -4px 0 12px; }
.rm-box { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 14px; padding: 16px 18px; margin: 0 0 14px; }
.rm-box p { line-height: 1.75; margin: 0 0 8px; }
.rm-box p:last-child { margin-bottom: 0; }
.rm-inner { border-left: 4px solid var(--rm-plum); }
.rm-deep { border-left: 4px solid var(--rm-gold); }
.rm-ramabox { border-left: 4px solid var(--accent); background: var(--accent-light); }
.rm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 14px; }
.rm-lbl { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-light); margin-bottom: 2px; font-style: normal; }
.rm-note { color: var(--text-light); font-size: .82rem; line-height: 1.6; margin: 10px 0 34px; }
.rm-status { color: var(--text-muted); font-size: .88rem; min-height: 1.2em; margin: 6px 0; }

/* figures (line drawings — kept on white in both themes) */
.rm-fig { margin: 0 0 12px; background: #fff; border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; }
.rm-fig img { display: block; width: 100%; height: auto; }
.rm-fig figcaption { padding: 7px 11px; font-size: .82rem; color: #5b5146; background: #fbf8f3; line-height: 1.45; }
html.dark-mode .rm-fig img { filter: brightness(.9); }

/* toolbar */
.rm-bar { position: sticky; top: calc(var(--header-h, 64px) + 46px); z-index: 15; background: var(--bg); padding: 10px 0; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; border-bottom: 1px solid var(--border-light); }
.rm-search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); }
.rm-search i { color: var(--text-light); }
.rm-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: 1rem; }
.rm-search-big { margin: 0 0 8px; padding: 13px 16px; }
.rm-btn, .rm-chips button { font: inherit; font-size: .85rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer; }
.rm-btn[aria-pressed="true"], .rm-chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.rm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rm-chips small { opacity: .75; }
.rm-sel { font-size: .85rem; color: var(--text-muted); display: inline-flex; gap: 6px; align-items: center; }
.rm-sel select { font: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); max-width: 180px; }
.rm-sel input { accent-color: var(--accent); }
.rm-bar-v { position: static; }
@media (max-width: 700px) { .rm-bar { position: static; } }

/* overview */
.rm-hits { display: grid; gap: 6px; margin: 0 0 18px; }
.rm-hit { display: block; padding: 9px 13px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border-light); text-decoration: none; color: var(--text); }
.rm-hit b { color: var(--text); } .rm-hit small { color: var(--accent); font-weight: 600; margin-right: 6px; text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; }
.rm-hit span { display: block; color: var(--text-muted); font-size: .88rem; margin-top: 2px; }
.rm-steps { margin: 0; padding-left: 20px; line-height: 1.7; } .rm-steps li { margin-bottom: 6px; }
.rm-kcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.rm-kcard { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 0 0 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-light); background: var(--bg-card); text-decoration: none; color: var(--text); }
.rm-kcard:hover { border-color: var(--accent); }
.rm-kcard img, .rm-kcard-blank { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #fff; margin-bottom: 8px; }
.rm-kcard-blank { display: grid; place-items: center; font-size: 2.6rem; color: var(--accent); background: var(--accent-light); }
.rm-kcard > b, .rm-kcard > i, .rm-kcard > .rm-kg, .rm-kcard > .rm-km { padding: 0 14px; }
.rm-kcard > b { font-family: var(--font-heading); font-size: 1.2rem; }
.rm-kcard > i { color: var(--text-muted); }
.rm-kn { position: absolute; top: 10px; left: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.rm-kg { font-size: .88rem; line-height: 1.55; color: var(--text-muted); }
.rm-km { font-size: .76rem; color: var(--text-light); margin-top: 4px; }
.rm-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 8px; }
.rm-q { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border-light); text-decoration: none; color: var(--text); }
.rm-q:hover { border-color: var(--accent); }
.rm-q b { color: var(--accent-dark, var(--accent)); } .rm-q i { font-size: .8rem; color: var(--text-light); } .rm-q span { font-size: .84rem; color: var(--text-muted); line-height: 1.5; }
.rm-pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 46%), 1fr)); gap: 10px; }
.rm-pc { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-light); background: var(--bg-card); text-decoration: none; color: var(--text); padding-bottom: 10px; }
.rm-pc img, .rm-pc-blank { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #fff; margin-bottom: 6px; }
.rm-pc-blank { display: grid; place-items: center; font-size: 2rem; color: var(--accent); background: var(--accent-light); }
.rm-pc b, .rm-pc span { padding: 0 10px; } .rm-pc span { font-size: .78rem; color: var(--text-muted); line-height: 1.4; }
.rm-pc-more { justify-content: center; align-items: center; background: var(--accent-light); padding: 16px; }
.rm-catcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.rm-catcard { display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border-light); border-top: 4px solid var(--c); background: var(--bg-card); text-decoration: none; color: var(--text); }
.rm-catcard span { font-size: .86rem; color: var(--text-muted); } .rm-catcard small { color: var(--text-light); }
.rm-ixs { columns: 3 260px; column-gap: 12px; }
.rm-ix { break-inside: avoid; margin: 0 0 6px; border: 1px solid var(--border-light); border-radius: 10px; background: var(--bg-card); }
.rm-ix > summary { cursor: pointer; padding: 8px 12px; font-weight: 600; list-style: none; }
.rm-ix > summary::-webkit-details-marker { display: none; }
.rm-ix > summary small { font-weight: 400; color: var(--text-light); font-size: .76rem; margin-left: 4px; }
.rm-ix[open] > summary { color: var(--accent); }
.rm-ix > div { padding: 0 12px 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .88rem; }
.rm-ix a { color: var(--text); } .rm-ix a.rm-iv { color: var(--accent); }
.rm-sks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px 18px; }
.rm-sk h3 { font-family: var(--font-heading); font-size: 1.05rem; margin: 0 0 4px; } .rm-sk h3 a { color: var(--accent); text-decoration: none; }
.rm-sk ol { margin: 0; padding-left: 20px; font-size: .9rem; line-height: 1.6; } .rm-sk a { color: var(--text); }

/* category colours */
.c-philosophy { --c: #7a4a78; } .c-concept { --c: #2f6f86; } .c-ideal { --c: #a8742a; } .c-spiritual { --c: #b5523b; } .c-subtle { --c: #4f5d8f; } .c-life { --c: #5c7f3c; }
html.dark-mode .c-philosophy { --c: #cfa3cd; } html.dark-mode .c-concept { --c: #8cc4d8; } html.dark-mode .c-ideal { --c: #e2b56a; }
html.dark-mode .c-spiritual { --c: #ef9a83; } html.dark-mode .c-subtle { --c: #a9b6ea; } html.dark-mode .c-life { --c: #a9cf86; }
.rm-cat { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: var(--c); border: 1px solid var(--c); text-decoration: none; }
.rm-legend { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; } .rm-legend b { margin-right: 6px; }

/* kāṇḍa page */
.rm-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 14px; color: var(--text-muted); }
.rm-facts b { font-family: var(--font-heading); font-size: 1.3rem; color: var(--accent); margin-right: 4px; }
.rm-toc { margin: 4px 0 14px; } .rm-toc ol { columns: 2 280px; margin: 0; padding-left: 22px; line-height: 1.75; }
.rm-toc a { color: var(--text); } .rm-toc small { color: var(--text-light); }
.rm-read { color: var(--text-muted); font-size: .88rem; margin: 8px 0 0; }
.rm-eps { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.rm-ep { border: 1px solid var(--border-light); border-radius: 16px; background: var(--bg-surface); scroll-margin-top: 170px; }
.rm-ep > summary { cursor: pointer; list-style: none; padding: 15px 18px 13px 40px; position: relative; display: flex; flex-direction: column; gap: 2px; }
.rm-ep > summary::-webkit-details-marker { display: none; }
.rm-ep > summary::before { content: "▸"; position: absolute; left: 16px; top: 16px; color: var(--accent); transition: transform .15s; }
.rm-ep[open] > summary::before { transform: rotate(90deg); }
.rm-ep-t { font-family: var(--font-heading); font-size: 1.22rem; color: var(--text); }
.rm-ep-s { color: var(--text-muted); } .rm-ep-m { font-size: .78rem; color: var(--text-light); }
.rm-ep-body { padding: 0 18px 18px; }
.rm-story { background: var(--bg-card); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; overflow: hidden; }
.rm-story p { line-height: 1.8; margin: 0 0 10px; }
.rm-figs { float: right; width: min(380px, 44%); margin: 0 0 8px 18px; }
@media (max-width: 700px) { .rm-figs { float: none; width: 100%; margin: 0 0 10px; } }
.rm-ramabox ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; line-height: 1.6; }
.rm-asp { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: #fff !important; text-decoration: none; margin-right: 4px; }
.rm-ep-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; }
.rm-foot-l { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-light); margin: 0 2px 0 8px; }
.rm-foot-l:first-child { margin-left: 0; }
.rm-person, .rm-idea { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); background: var(--bg-card); }
.rm-idea { border-style: dashed; }
.rm-pn { display: flex; justify-content: space-between; gap: 10px; margin: 26px 0 0; }
.rm-pn a { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border); text-decoration: none; color: var(--accent); font-weight: 600; }

/* verse cards */
.rm-verses { display: flex; flex-direction: column; gap: 12px; margin: 0 0 14px; }
.rm-verse { background: var(--bg-card); border: 1px solid var(--border-light); border-left: 4px solid var(--accent); border-radius: 14px; padding: 15px 18px; scroll-margin-top: 170px; }
.rm-verse > header { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.rm-vref { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.rm-vwho { font-size: .82rem; color: var(--text-light); }
.rm-verse h4 { font-family: var(--font-heading); font-size: 1.12rem; margin: 4px 0 10px; }
.rm-dev { font-size: 1.2rem; line-height: 1.95; color: var(--text); }
.rm-iast { font-style: italic; color: var(--text-muted); line-height: 1.7; margin: 6px 0 10px; }
.rm-wbw > summary { cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--accent); }
.rm-wbw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 4px 14px; margin: 8px 0 4px; font-size: .9rem; }
.rm-wbw-grid div { padding: 4px 0; border-bottom: 1px dotted var(--border-light); }
.rm-wbw-grid b { color: var(--rm-q); font-style: italic; font-weight: 600; margin-right: 6px; }
.rm-wbw-grid span { color: var(--text-muted); }
.rm-tr, .rm-expl, .rm-phil { line-height: 1.75; margin: 10px 0 0; }
.rm-tr { font-size: 1.02rem; }
.rm-phil { padding: 8px 12px; border-radius: 0 10px 10px 0; border-left: 3px solid var(--rm-plum); background: color-mix(in srgb, var(--rm-plum) 7%, transparent); }
.rm-verse > footer { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 12px; }
.rm-vlink { margin-left: auto; color: var(--text-light); text-decoration: none; }
body.rm-practice .rm-allverses .rm-tr, body.rm-practice .rm-allverses .rm-wbw, body.rm-practice .rm-allverses .rm-expl, body.rm-practice .rm-allverses .rm-phil { filter: blur(6px); cursor: pointer; }
body.rm-practice .rm-allverses .is-shown .rm-tr, body.rm-practice .rm-allverses .is-shown .rm-wbw, body.rm-practice .rm-allverses .is-shown .rm-expl, body.rm-practice .rm-allverses .is-shown .rm-phil { filter: none; }
body.rm-nowbw .rm-wbw { display: none; }

/* characters */
.rm-who { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 4px; font-size: .88rem; } .rm-who a { color: var(--accent); }
.rm-chars { display: grid; gap: 12px; }
.rm-char { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 18px; border-radius: 16px; background: var(--bg-card); border: 1px solid var(--border-light); scroll-margin-top: 170px; }
.rm-char:has(.rm-fig-char) { grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); }
@media (max-width: 700px) { .rm-char:has(.rm-fig-char) { grid-template-columns: 1fr; } }
.rm-char .rm-fig { margin: 0; align-self: start; }
.rm-char h3 { font-family: var(--font-heading); font-size: 1.4rem; margin: 0 0 2px; } .rm-char h3 .deva { font-size: 1rem; color: var(--accent); margin-left: 6px; }
.rm-also { color: var(--text-light); font-size: .86rem; margin: 0 0 6px; }
.rm-role { font-weight: 600; margin: 0 0 8px; }
.rm-char p { line-height: 1.7; margin: 0 0 9px; }
.rm-great { padding: 8px 12px; border-left: 3px solid var(--rm-gold); background: color-mix(in srgb, var(--rm-gold) 8%, transparent); border-radius: 0 10px 10px 0; }
.rm-sym { color: var(--text-muted); }
.rm-links { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: .88rem; } .rm-links .rm-lbl { width: 100%; } .rm-links a { color: var(--accent); }

/* Rāma page and lists */
.rm-roles { margin: 0 0 8px; padding-left: 18px; line-height: 1.7; }
.rm-qsec { padding: 18px 0 6px; border-top: 1px solid var(--border-light); scroll-margin-top: 130px; }
.rm-qsec h2 { font-family: var(--font-heading); font-size: 1.4rem; margin: 0 0 4px; } .rm-qsec h2 small { font-family: inherit; font-size: .9rem; font-style: italic; color: var(--text-light); font-weight: 400; }
.rm-qbrief { font-size: 1.05rem; color: var(--accent-dark, var(--accent)); font-weight: 600; margin: 0 0 6px; }
.rm-qsec > p { line-height: 1.75; }
.rm-where { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; } .rm-where li { margin-bottom: 4px; } .rm-where a { color: var(--accent); }
.rm-wk { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light) !important; text-decoration: none; margin-right: 4px; }

/* inner */
.rm-sym-t { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 12px; overflow: hidden; }
.rm-sym-t th, .rm-sym-t td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); text-align: left; vertical-align: top; line-height: 1.6; }
.rm-sym-t th { width: 28%; font-family: var(--font-heading); color: var(--accent); font-weight: 600; }
@media (max-width: 600px) { .rm-sym-t th, .rm-sym-t td { display: block; width: auto; } .rm-sym-t th { border-bottom: 0; padding-bottom: 0; } }
.rm-kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }

/* long compounds must not widen the page on phones */
.rm-dev, .rm-iast, .rm-wbw-grid, .rm-story, .rm-char, .rm-box, .rm-hit { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .rm-ep > summary::before { transition: none; } }

/* ── The study companion (the earlier research page, kept whole) ── */
.rm-comp { margin-top: 30px; padding-top: 6px; border-top: 2px solid var(--border-light); scroll-margin-top: 200px; }
.rm-comp-head { max-width: 900px; margin-bottom: 8px; }
.rm-comp .kanda-index { font-family: var(--font-heading); font-style: italic; font-size: .95rem; color: var(--accent); display: block; margin-bottom: 2px; }
.rm-comp-head h3 { font-family: var(--font-heading); font-size: 1.25rem; margin: 0 0 4px; }
.rm-comp .kanda-meta { font-size: .8rem; color: var(--text-light); margin-bottom: 8px; }
.rm-comp .kanda-essence { color: var(--text-muted); line-height: 1.75; }
.rm-comp-key { font-size: .8rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.rm-key { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; }
.rm-key-gold { background: #FBF3D9; color: #8A6D1C; } .rm-key-green { background: #EEF3EA; color: #4A7043; } .rm-key-verse { background: #F0EAF5; color: #6B4E8E; }
.rm-bar-c { position: static; border: 0; padding: 8px 0; }
.rm-ctopics { display: flex; flex-direction: column; gap: 10px; }
.rm-ctopic { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 14px; scroll-margin-top: 200px; }
.rm-ctopic > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 14px 18px 14px 38px; position: relative; }
.rm-ctopic > summary::-webkit-details-marker { display: none; }
.rm-ctopic > summary::before { content: "▸"; position: absolute; left: 16px; top: 15px; color: var(--accent); transition: transform .15s; }
.rm-ctopic[open] > summary::before { transform: rotate(90deg); }
.rm-ct-t { flex: 1 1 320px; display: flex; flex-direction: column; }
.rm-ct-t b { font-family: var(--font-heading); font-weight: 500; font-size: 1.06rem; color: var(--text); }
.rm-ct-t small { font-size: .74rem; color: var(--text-light); }
.rm-comp .topic-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.rm-comp .topic-tag { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 9px; border-radius: 100px; background: var(--accent-light); color: var(--accent); }
.rm-comp .topic-tag.t-kamba { background: #EEF3EA; color: #4A7043; } .rm-comp .topic-tag.t-verse { background: #F0EAF5; color: #6B4E8E; } .rm-comp .topic-tag.t-rama { background: #FBF3D9; color: #8A6D1C; }
.rm-ct-body { padding: 0 20px 18px; }
.rm-ct-body > p { color: var(--text-muted); line-height: 1.75; margin: 0 0 14px; }
.rm-comp .subtopic { margin: 16px 0; padding-left: 16px; border-left: 2px solid var(--border); }
.rm-comp .subtopic h4 { font-size: .98rem; margin: 0 0 6px; color: var(--text); }
.rm-comp .subtopic p { color: var(--text-muted); line-height: 1.7; }
.rm-comp .story-box { background: var(--bg-surface); border-radius: 10px; padding: 14px 16px; margin: 14px 0; }
.rm-comp .story-label, .rm-comp .rama-label, .rm-comp .kamba-label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; display: block; margin-bottom: 6px; }
.rm-comp .story-label { color: var(--accent); }
.rm-comp .story-box h5 { font-family: var(--font-heading); font-size: 1rem; margin: 0 0 6px; }
.rm-comp .story-box p { color: var(--text-muted); line-height: 1.7; margin: 0; }
.rm-comp .rama-marker { background: linear-gradient(135deg, #FDF8E7 0%, #FBF3D9 100%); border: 1px solid #EBDCA8; border-left: 4px solid #C9A227; border-radius: 10px; padding: 13px 17px; margin: 14px 0; }
.rm-comp .rama-label { color: #8A6D1C; } .rm-comp .rama-label::before { content: '❖ '; }
.rm-comp .rama-marker p { color: #57492A; line-height: 1.7; margin: 0; }
.rm-comp .rama-marker strong, .rm-comp .rama-marker em { color: #3E3115; }
.rm-comp .kamba-note { background: #F3F6F0; border: 1px solid #DDE6D6; border-left: 4px solid #6E9160; border-radius: 10px; padding: 13px 17px; margin: 14px 0; }
.rm-comp .kamba-label { color: #4A7043; } .rm-comp .kamba-note p { color: #44503E; line-height: 1.7; margin: 0; }
html.dark-mode .rm-comp .rama-marker { background: rgba(201,162,39,.12); border-color: rgba(201,162,39,.35); }
html.dark-mode .rm-comp .rama-marker p, html.dark-mode .rm-comp .rama-marker strong, html.dark-mode .rm-comp .rama-marker em { color: #eadfbf; }
html.dark-mode .rm-comp .rama-label, html.dark-mode .rm-key-gold { color: #e2c46a; }
html.dark-mode .rm-comp .kamba-note { background: rgba(110,145,96,.14); border-color: rgba(110,145,96,.4); }
html.dark-mode .rm-comp .kamba-note p { color: #d3e2cc; } html.dark-mode .rm-comp .kamba-label { color: #a9cf86; }
html.dark-mode .rm-key-gold, html.dark-mode .rm-key-green, html.dark-mode .rm-key-verse, html.dark-mode .rm-comp .topic-tag { background: var(--bg-surface); }
.rm-comp .verse-card { border: 1px solid var(--border); border-left: 4px solid var(--rm-plum); border-radius: 14px; padding: 18px 20px; margin: 16px 0; background: var(--bg-card); }
.rm-comp .verse-ref { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 10px; display: block; }
.rm-comp .verse-dev { font-family: 'Noto Serif Devanagari', serif; font-size: 1.18rem; line-height: 1.95; color: var(--text); margin-bottom: 8px; }
.rm-comp .verse-iast { font-style: italic; color: var(--text-muted); line-height: 1.75; margin-bottom: 14px; }
.rm-comp .word-meanings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 6px 20px; margin-bottom: 14px; padding: 12px 14px; background: var(--bg-surface); border-radius: 10px; }
.rm-comp .word-meanings div { font-size: .85rem; color: var(--text-muted); }
.rm-comp .word-meanings b { color: var(--rm-q); font-style: italic; font-weight: 600; }
.rm-comp .verse-expl { color: var(--text-muted); line-height: 1.75; }
.rm-comp .guna-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 8px; margin: 14px 0; }
.rm-comp .guna-item { background: var(--bg-surface); border-radius: 10px; padding: 11px 13px; font-size: .86rem; color: var(--text-muted); }
.rm-comp .guna-item b { font-family: var(--font-heading); font-style: italic; color: var(--text); display: block; }
.rm-comp .roles-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .9rem; }
.rm-comp .roles-table th, .rm-comp .roles-table td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--border-light); vertical-align: top; color: var(--text-muted); line-height: 1.65; }
.rm-comp .roles-table th { font-family: var(--font-heading); font-style: italic; color: var(--text); width: 170px; }
@media (max-width: 700px) { .rm-comp .roles-table th, .rm-comp .roles-table td { display: block; width: auto; } .rm-comp .roles-table th { border: 0; padding-bottom: 0; } .rm-comp .topic-tags { display: none; } }
.rm-comp .rm-ct-body, .rm-cindex { overflow-wrap: anywhere; }
/* overview: the companion index */
.rm-cindex { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px 18px; }
.rm-cgrp ul { margin: 0; padding-left: 18px; font-size: .9rem; line-height: 1.6; }
.rm-cgrp a { color: var(--text); }
.rm-gold { color: #C9A227; font-size: .8rem; } .rm-green { color: #6E9160; font-size: .68rem; font-weight: 700; border: 1px solid currentColor; border-radius: 4px; padding: 0 3px; }
.rm-comp-note p { font-size: .9rem; color: var(--text-muted); }

/* ── Yoga Vāsiṣṭha additions ── */
/* the earlier part pages: open topics must grow with the verses placed inside them */
.acc-item.open .acc-panel { max-height: none !important; }
.yv-studybar { margin: 26px 0 0; padding: 14px 18px; border-radius: 14px; background: var(--accent-light); border: 1px solid var(--border-light); }
.yv-studybar p { margin: 0 0 10px; color: var(--text); line-height: 1.65; }
.yv-studybar-b { display: flex; flex-wrap: wrap; gap: 8px; }
.yv-studybar .rm-btn { text-decoration: none; }
.yv-vblock { margin: 22px 0 6px; padding-top: 14px; border-top: 2px dashed var(--border); }
.yv-vh { font-family: var(--font-heading); font-size: 1.05rem; color: var(--accent-dark, var(--accent)); margin: 0 0 10px; }
.yv-vh small { font-family: var(--font-body, inherit); font-size: .78rem; color: var(--text-light); font-weight: 400; margin-left: 6px; }
.yv-vcount { display: inline-block; margin-left: 8px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; background: #F0EAF5; color: #6B4E8E; }
html.dark-mode .yv-vcount { background: var(--bg-surface); color: #cfa3cd; }
.yv-tfig { max-width: 520px; margin: 0 auto 16px; }
.yv-hfig { max-width: 560px; margin: 26px auto 0; text-align: left; }
.yv-credit { color: #8b7d6f; font-size: .76rem; }
.yv-more { padding-top: 10px; }
.yv-rbox ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.8; } .yv-rbox a { color: var(--accent); }
.yv-sg { margin-left: auto; font-size: .68rem; font-weight: 700; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; background: #FBF3D9; color: #8A6D1C; }
html.dark-mode .yv-sg { background: rgba(201,162,39,.15); color: #e2c46a; }
.yv-qual { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #EEF3EA; color: #4A7043; text-decoration: none; }
html.dark-mode .yv-qual { background: rgba(110,145,96,.18); color: #a9cf86; }
.yv-quals { display: flex; flex-wrap: wrap; gap: 8px; }
.yv-qual-lg { font-size: .9rem; padding: 6px 13px; } .yv-qual-lg small { opacity: .7; }
.yv-sglist { columns: 2 380px; column-gap: 26px; padding-left: 0; list-style: none; margin: 0; }
.yv-sglist li { break-inside: avoid; padding: 5px 0; border-bottom: 1px dotted var(--border-light); line-height: 1.5; }
.yv-sglist a { color: var(--text); font-weight: 600; } .yv-sglist small { color: var(--text-light); margin-left: 4px; }
.yv-sgn { display: inline-block; min-width: 46px; font-size: .74rem; font-weight: 700; color: #8A6D1C; }
.rm-ix > div span { color: var(--text-muted); font-size: .86rem; }
.rm-kcard .deva { font-style: normal; }
.rm-fig-hero img, .yv-hfig img { max-height: 420px; width: auto; max-width: 100%; margin: 0 auto; object-fit: contain; }
.rm-fig-hero, .yv-hfig { background: #fff; }
/* the earlier pages style every h4 in a topic as a small capital label — not verse titles */
.rm-verse h4, .acc-body .rm-verse h4 { text-transform: none; letter-spacing: 0; font-family: var(--font-heading); font-size: 1.12rem; font-weight: 600; color: var(--text); margin: 4px 0 10px; }
.yv-vh { text-transform: none !important; letter-spacing: 0 !important; }
.rm-verse > footer a { font-size: .74rem; line-height: 1.4; }
.rm-verse > footer .rm-idea { padding: 2px 9px; }
.rm-verse p { margin-bottom: 0; }
/* the three kinds the Rāmāyaṇa study does not have */
.c-quality { --c: #4A7043; } .c-sadhana { --c: #b5523b; } .c-story { --c: #6b5b2e; }
html.dark-mode .c-quality { --c: #a9cf86; } html.dark-mode .c-sadhana { --c: #ef9a83; } html.dark-mode .c-story { --c: #d6c08a; }
/* the earlier concept-index tables: let the reference column wrap on phones */
@media (max-width: 600px) { table.concept-index td.ref { white-space: normal; } table.concept-index { word-break: break-word; } }

/* ── Tirukkural ── */
.tk-bg { display: flex; flex-direction: column; gap: 10px; }
.tk-bgd > summary { cursor: pointer; list-style: none; } .tk-bgd > summary::-webkit-details-marker { display: none; }
.tk-bgd > summary h3 { display: inline; } .tk-bgd > summary::after { content: " ▾"; color: var(--accent); }
.tk-bgd[open] > summary { margin-bottom: 8px; }
.tk-bgfig { float: right; width: min(240px, 40%); margin: 0 0 8px 16px; }
@media (max-width: 600px) { .tk-bgfig { float: none; width: 100%; margin: 0 0 10px; } }
.tk-palfig { margin: 0; align-self: start; }

/* ── Viṣṇu Sahasranāma ── */
.vs { --vs: #4a3a8c; --vs-l: #efecfb; }
html.dark-mode .vs { --vs: #b3a8f0; --vs-l: rgba(140,125,220,.14); }
.vs .rm-hero-deva, .vs-nd, .vs-kd, .vs-cd, .vs-dev, .vs-d { font-family: 'Noto Serif Devanagari', serif; }
.vs-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; align-items: center; }
.vs-quick a { font-size: .86rem; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; background: var(--bg-card); }
.vs-quick a.vs-cta { background: var(--vs); border-color: var(--vs); color: #fff; font-weight: 600; }
html.dark-mode .vs-quick a.vs-cta { color: #1d1838; }
.vs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.vs-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; padding: 3px 10px 3px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); color: var(--text-muted); cursor: pointer; }
.vs-chip.is-on { background: var(--vs); border-color: var(--vs); color: #fff; }
.vs-ci { width: 26px; height: 20px; border-radius: 4px; }
.vs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 46%), 1fr)); gap: 10px; margin: 12px 0 18px; }
.vs-tile { display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 10px; border: 1px solid var(--border-light); border-radius: 14px; background: var(--bg-card); text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.vs-tile:hover { transform: translateY(-2px); border-color: var(--vs); }
.vs-tile .vs-qi { width: 100%; height: auto; border-radius: 10px; margin-bottom: 4px; }
.vs-tile b { font-family: var(--font-heading); font-size: .98rem; line-height: 1.25; }
.vs-tile i { font-style: normal; font-family: 'Noto Serif Devanagari', serif; color: var(--vs); font-size: .86rem; }
.vs-tile span { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.vs-qs { display: flex; flex-direction: column; gap: 10px; }
.vs-q { border: 1px solid var(--border-light); border-radius: 16px; background: var(--bg-surface); scroll-margin-top: 90px; }
.vs-q > summary { cursor: pointer; list-style: none; display: flex; gap: 14px; align-items: center; padding: 10px 14px; }
.vs-q > summary::-webkit-details-marker { display: none; }
.vs-qi-s { width: 64px; height: 48px; border-radius: 8px; flex: none; }
.vs-qt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.vs-qt b { font-family: var(--font-heading); font-size: 1.12rem; color: var(--text); }
.vs-qt i { font-style: normal; font-family: 'Noto Serif Devanagari', serif; color: var(--vs); }
.vs-qt small { font-size: .74rem; color: var(--text-light); }
.vs-q > summary::after { content: "▾"; color: var(--vs); } .vs-q[open] > summary::after { content: "▴"; }
.vs-qb { padding: 0 16px 16px; }
.vs-qintro { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; line-height: 1.7; }
.vs-qintro p { margin: 0 0 8px; } .vs-qintro em { color: var(--vs); }
.vs-qi-l { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border-light); }
@media (max-width: 640px) { .vs-qintro { grid-template-columns: 1fr; } .vs-qi-l { max-width: 260px; } }
.vs-h4 { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-light); margin: 16px 0 8px; font-weight: 600; }
.vs-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px; }
.vs-key { background: var(--bg-card); border: 1px solid var(--border-light); border-left: 4px solid var(--vs); border-radius: 12px; padding: 10px 14px; }
.vs-key p { margin: 6px 0 0; font-size: .9rem; color: var(--text-muted); line-height: 1.6; }
.vs-key-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.vs-kd { font-size: 1.25rem; color: var(--text); } .vs-ki { font-family: var(--font-heading); font-style: italic; color: var(--vs); }
.vs-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 0 18px; }
.vs-n { display: grid; grid-template-columns: 44px 1fr; column-gap: 8px; padding: 6px 0; border-bottom: 1px dotted var(--border-light); }
.vs-nn { grid-row: span 3; font-weight: 700; font-size: .8rem; color: var(--vs); text-decoration: none; padding-top: 3px; }
.vs-nd { font-size: 1.08rem; color: var(--text); } .vs-ni { font-family: var(--font-heading); font-style: italic; color: var(--text-muted); font-size: .9rem; }
.vs-nm { font-size: .88rem; color: var(--text-muted); }
.vs-hits { margin: 8px 0 18px; }
.vs-set { border-left: 3px solid var(--vs-l); padding-left: 12px; margin: 10px 0; }
.vs-set p { margin: 0 0 4px; } .vs-set .rm-dev { font-size: 1.08rem; line-height: 1.8; }
.vs-qa { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
.vs-qa th, .vs-qa td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.vs-qa th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-light); }
@media (max-width: 600px) { .vs-qa thead { display: none; } .vs-qa tr { display: block; padding: 6px 0; border-bottom: 1px solid var(--border-light); } .vs-qa td { display: block; border: 0; padding: 2px 0; } }
.vs-rep { columns: 2 340px; column-gap: 26px; padding-left: 18px; font-size: .9rem; line-height: 1.6; }
.vs-rep li { break-inside: avoid; margin-bottom: 6px; } .vs-rep b { font-family: 'Noto Serif Devanagari', serif; font-weight: 400; }

/* chant page */
.vs-how { margin-bottom: 16px; }
.vs-g-demo { font-weight: 700; color: var(--vs); }
.vs-bar { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-bottom: 1px solid var(--border-light); }
.vs-size { display: inline-flex; gap: 4px; }
.vs-jump { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-muted); }
.vs-jump input { width: 64px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text); }
.vs-prog { position: relative; height: 22px; background: var(--vs-l); border-radius: 999px; margin: 10px 0 16px; overflow: hidden; }
.vs-prog-b { height: 100%; width: 0; background: var(--vs); opacity: .55; transition: width .3s; }
.vs-prog span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .76rem; color: var(--text); }
.vs-ss { display: flex; flex-direction: column; gap: 12px; }
.vs-s { --fs: 1.3rem; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 16px; padding: 14px 18px; scroll-margin-top: 90px; }
.vs-s.is-learnt { border-left: 4px solid #5f8a3a; }
.vs-s > header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.vs-sn { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px; background: var(--vs); color: #fff; display: grid; place-items: center; font-weight: 700; text-decoration: none; font-size: .9rem; }
html.dark-mode .vs-sn { color: #1d1838; }
.vs-range { font-size: .76rem; color: var(--text-light); letter-spacing: .04em; flex: 1; }
.vs-learn { font-size: .8rem; color: var(--text-muted); display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.vs-dev { font-size: var(--fs); line-height: 1.9; color: var(--text); margin: 0 0 4px; }
.vs-ia { font-family: var(--font-heading); font-style: italic; color: var(--vs); line-height: 1.7; margin: 0 0 8px; }
.vs-tr { color: var(--text-muted); line-height: 1.7; margin: 0; }
.vs-rh { display: none; margin: 0 0 8px; font-family: var(--font-heading); line-height: 2.1; }
.vs-pada { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0 12px 4px 0; padding: 2px 6px; border-radius: 8px; background: var(--vs-l); max-width: 100%; }
@media (max-width: 600px) { .vs-pada { display: flex; width: fit-content; } .vs-pada i { padding: 0 2px; } }
.vs-pada i { font-style: normal; padding: 0 3px; border-bottom: 2px solid transparent; }
.vs-pada i.g { font-weight: 700; color: var(--vs); border-bottom-color: var(--vs); }
.vs-pada i.l { color: var(--text-muted); }
body.vs-rh-on .vs-rh { display: block; }
body.vs-noia .vs-ia { display: none; }
body.vs-nonames .vs-chips2 { display: none; }
.vs-chips2 { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 4px 14px; border-top: 1px solid var(--border-light); padding-top: 8px; }
.vs-c { display: grid; grid-template-columns: 38px 1fr; column-gap: 6px; font-size: .88rem; padding: 3px 0; }
.vs-c b { grid-row: span 3; color: var(--vs); font-size: .78rem; padding-top: 4px; }
.vs-cd { font-size: 1.02rem; color: var(--text); } .vs-ci2 { font-family: var(--font-heading); font-style: italic; color: var(--text-muted); } .vs-cm { color: var(--text-muted); font-size: .84rem; }
body.vs-mem1 .vs-ss .vs-dev, body.vs-mem2 .vs-ss .vs-dev { color: var(--vs); }
body.vs-mem2 .vs-ss .vs-dev, body.vs-mem2 .vs-ss .vs-ia, body.vs-mem1 .vs-ss .vs-ia { filter: blur(7px); cursor: pointer; }
body.vs-mem1 .vs-s.is-shown .vs-ia, body.vs-mem2 .vs-s.is-shown .vs-dev, body.vs-mem2 .vs-s.is-shown .vs-ia { filter: none; }
.vs-ov { position: fixed; inset: 0; z-index: 2000; background: rgba(20,16,40,.72); display: grid; place-items: center; padding: 16px; }
.vs-ov[hidden] { display: none; }
.vs-ov-in { width: min(820px, 100%); max-height: 92vh; overflow: auto; background: var(--bg-card); border-radius: 20px; padding: 18px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.vs-ov-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--vs); }
.vs-ov-body { padding: 14px 0; } .vs-ov-body .vs-dev { --fs: clamp(1.4rem, 4.2vw, 2.1rem); text-align: center; }
.vs-ov-body .vs-ia { text-align: center; font-size: 1.05rem; } .vs-ov-body .vs-chips2 { display: grid; }
.vs-ov-body.is-hidden .vs-dev, .vs-ov-body.is-hidden .vs-ia { filter: blur(9px); }
.vs-ov-nav { display: flex; justify-content: space-between; gap: 8px; }
.vs-ia, .vs-dev, .vs-ci2, .vs-ni, .vs-nd, .vs-cd, .vs-ki, .vs-kd { overflow-wrap: anywhere; }
