/* study.css — Study page, citation tree / radial, themes. Every class starts with "st-" (see ARCHITECTURE.md).
   Theme colours: elements with .st-tv carry --thl (light) and --thd (dark); --tc resolves to the right one for Paper/Sepia vs Night. */
.st-tv { --tc: var(--thl, var(--gold)); }
:root[data-theme="dark"] .st-tv { --tc: var(--thd, var(--gold)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .st-tv { --tc: var(--thd, var(--gold)); } }

.st-note { font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin: 0 0 8px; line-height: 1.45; }
.st-none { font-size: 16px; color: var(--muted); margin: 4px 0; }
.st-chk { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 13px; color: var(--ink-2); margin-top: 8px; cursor: pointer; }
.st-chk input { accent-color: var(--rubric); width: 16px; height: 16px; }
.st-more { font-family: var(--sans); font-size: 12.5px; font-weight: 650; text-decoration: none; letter-spacing: 0; text-transform: none; }
.st-lbl { font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--border-2); border-radius: var(--r-pill); padding: 0 7px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.st-sel { font: 600 13px var(--sans); padding: 6px 8px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); color: var(--ink); max-width: 100%; }

/* lists of verses / paragraphs with previews */
.st-list { list-style: none; margin: 0; padding: 0; }
.st-list li { border-top: 1px solid var(--border); }
.st-list li:first-child { border-top: 0; }
.st-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 8px 2px; text-decoration: none; color: var(--ink); min-width: 0; }
.st-list a:hover b { color: var(--rubric); }
.st-list b { font-weight: 600; font-variant: small-caps; letter-spacing: .03em; color: var(--rubric); }
.st-pv { flex-basis: 100%; color: var(--ink-2); font-size: 15.5px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.st-x { margin-left: auto; font: 700 12px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
ol.st-top { counter-reset: st; }

/* Study page */
.st-page { padding-top: 14px; }
.st-title { margin-bottom: 8px; }
.st-passage { margin: 6px 0 10px; }
.st-v { margin: 0 0 .3em; }
.st-vn { font-family: var(--sans); font-size: .62em; font-weight: 700; color: var(--rubric); vertical-align: .35em; margin-right: 2px; }
.st-lat { margin: -.15em 0 .5em; font-style: italic; color: var(--ink-2); font-size: .9em; }
.st-tools { margin: 4px 0 14px; }
.st-pn { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.st-pn:empty { display: none; }
.st-sum { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); padding: 12px 14px; }
.st-sumh { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.st-sumh .st-note { margin: 0; }
.st-rank { font: 700 12px var(--sans); color: var(--rubric); margin-left: auto; }
.st-bars { display: grid; gap: 5px; }
.st-bar { display: grid; grid-template-columns: minmax(5.5rem, 7.2rem) 1fr 3.4rem; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); font-family: var(--sans); font-size: 13px; }
.st-bl { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-bt { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.st-bt i { display: block; height: 100%; border-radius: 5px; background: var(--c, var(--gold)); }
.st-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.st-bar.is-off { opacity: .4; }
.st-bar:hover .st-bl { color: var(--rubric); }
.st-sumth { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 10px; }
.st-sumth:empty { display: none; }
.st-sumth .ui-eyebrow { margin: 0; }
.st-nav { position: sticky; top: var(--nxh); z-index: 5; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 14px -16px 0; padding: 8px 16px;
  background: var(--bar-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); transition: top .2s; }
body.nx-hdaway .st-nav { top: 0; }
.st-nav::-webkit-scrollbar { display: none; }
.st-navc { white-space: nowrap; flex: none; }
.st-navn { color: var(--muted); font-weight: 600; }
.st-sec { margin-top: 28px; scroll-margin-top: calc(var(--nxh) + 60px); }
.st-sec > .ui-sec-h { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.st-sec .ui-ct:empty { display: none; }
.st-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.st-filters .st-chk { margin-top: 0; }
.st-grp { margin: 10px 0 4px; }
.st-gh { font-weight: 700; font-size: 17px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin-bottom: 2px; }
.st-gh a { color: var(--ink); text-decoration: none; }
.st-gh a:hover { color: var(--rubric); }
.st-yr, .st-gcount { font: 600 12px var(--sans); color: var(--muted); }
.st-entry { padding: 10px 0 12px; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--nxh) + 60px); }
.st-grp .st-entry:first-of-type, .st-comm > .st-entry:first-child { border-top: 0; }
.st-eh { display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: baseline; margin-bottom: 4px; font-size: 15px; }
.st-an { font-weight: 700; }
.st-wt { font-style: italic; color: var(--ink-2); }
.st-r { font: 600 11.5px var(--sans); color: var(--muted); }
.st-mt { font: 700 10.5px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--rubric); border: 1px solid currentColor; border-radius: 5px; padding: 0 5px; }
.st-entry.is-mt .ui-prose { color: var(--ink-2); }
.st-open { display: inline-block; margin-top: 4px; font: 650 13px var(--sans); text-decoration: none; }
.st-falist { list-style: none; margin: 0; padding: 0; }
.st-fa { border-top: 1px solid var(--border); }
.st-fa:first-child { border-top: 0; }
.st-fat { display: flex; width: 100%; text-align: left; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; background: none; border: 0; padding: 8px 2px; cursor: pointer; font-size: 16px; color: var(--ink); }
.st-fat:hover .st-lb { color: var(--rubric); }
.st-lb { min-width: 0; overflow-wrap: anywhere; }
.st-qt { color: var(--ink-2); font-style: italic; }
.st-chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.st-fat[aria-expanded="true"] .st-chev { transform: rotate(90deg); }
.st-exp { padding: 2px 4px 12px 12px; border-left: 2px solid var(--gold-2); margin: 0 0 8px 4px; }
.st-fn { font-size: 14px; color: var(--ink-2); margin-top: 6px; display: grid; gap: 4px; }
.st-note-b { margin: 6px 0 10px; }
.st-note-b .ui-eyebrow { margin-bottom: 2px; }
.st-vnotes { border-top: 1px solid var(--border); padding-top: 6px; }
.st-vnotes:first-child { border-top: 0; }
.st-vl { font-variant: small-caps; font-weight: 700; color: var(--rubric); letter-spacing: .03em; }
.st-key { font-weight: 700; font-style: italic; }
.st-aside { color: var(--ink-2); font-size: .94em; }
.st-src { font-family: var(--sans); font-size: .78em; color: var(--muted); }
.st-ann { padding: 8px 0; border-top: 1px solid var(--border); }
.st-ann:first-child { border-top: 0; }
.st-annq { font-size: 14.5px; color: var(--ink-2); }
.st-annt { white-space: pre-wrap; margin-top: 2px; }
.st-annm { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font: 12px var(--sans); color: var(--muted); }
.st-annl { font-weight: 650; text-decoration: none; }
.st-co a { display: grid; grid-template-columns: auto minmax(4.5rem, 7rem); column-gap: 10px; align-items: center; justify-content: start; }
.st-co .st-pv, .st-keyv .st-pv { grid-column: 1 / -1; }
.st-cobar { position: relative; height: 16px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.st-cobar i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--gilt) 55%, transparent); }
.st-cobar em { position: relative; font-style: normal; font-family: var(--sans); font-size: 11px; font-weight: 700; padding-left: 5px; color: var(--ink); line-height: 16px; }
.st-art { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.st-artb { flex: none; width: 150px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-2); padding: 6px; cursor: pointer; text-align: left; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.st-artb img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.st-lbox .st-lbimg { display: block; max-width: 100%; max-height: 64vh; margin: 0 auto 10px; border-radius: 6px; }
.st-lbcap b { font-size: 18px; }

/* theme chips */
.st-throw, .st-thlist { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-thc { display: inline-flex; align-items: center; gap: 7px; font: 600 13.5px var(--sans); color: var(--ink); text-decoration: none; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--tc) 55%, var(--border)); border-radius: var(--r-pill); padding: 3px 11px 3px 3px; line-height: 1.2; max-width: 100%; }
button.st-thc { cursor: pointer; }
a.st-thc:hover, button.st-thc:hover { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 8%, var(--surface)); }
.st-thc.is-on { background: color-mix(in srgb, var(--tc) 16%, var(--surface)); border-color: var(--tc); box-shadow: inset 0 0 0 1px var(--tc); }
.st-thc.is-on .st-thl::before { content: "✓ "; }
.st-thg { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--tc); color: var(--paper); font-size: 14px; line-height: 1; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", var(--sans); }
.st-thl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-thc.is-sm { font-size: 12.5px; padding: 2px 9px 2px 2px; gap: 5px; }
.st-thc.is-sm .st-thg { width: 20px; height: 20px; font-size: 12px; }
.st-thw { width: 34px; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; flex: none; }
.st-thw i { display: block; height: 100%; background: var(--tc); }
.st-thn { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-topics { margin-top: 12px; display: grid; gap: 10px; }
.st-tg { display: grid; gap: 5px; }
.st-tgl { font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.st-mini { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--tc); color: var(--paper); font-size: 11px; line-height: 1; margin-left: 2px; }
.st-thgl { display: inline-flex; gap: 2px; }

/* graph stage (tree, radial, theme network) */
.st-tree, .st-tpage { padding-top: 14px; }
.st-thead { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; align-items: flex-end; }
.st-thead-t { min-width: 0; flex: 1 1 22rem; }
.st-thead .ui-ptitle { margin: 2px 0 0; }
.st-tvt { max-width: 44rem; margin: 4px 0 6px; color: var(--ink-2); font-size: 17px; }
.st-opts { margin: 8px 0 6px; }
.st-opts > summary { cursor: pointer; font: 700 12.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); padding: 4px 0; }
.st-osum { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.st-opts[open] .st-osum { display: none; }
.st-ctl { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 6px 0 8px; font-family: var(--sans); }
.st-tc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.st-tl { font: 700 11.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.st-tl b { color: var(--ink); font-variant-numeric: tabular-nums; }
.st-ctl input[type=range] { width: 120px; accent-color: var(--rubric); }
.st-ctl .ui-seg button { padding: 6px 10px; font-size: 13px; }
.st-ctl .st-chk { margin-top: 0; }
.st-corp.is-on { background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--ink); border-color: var(--c); }
.st-frow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 10px; }
.st-frow:empty { display: none; }
.st-frow .st-note { margin: 0; }
.st-clear { font-weight: 700; }
@media (max-width: 699px) {
  .st-frow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 2px -16px 8px; padding: 2px 16px 4px; }
  .st-frow::-webkit-scrollbar { display: none; }
  .st-frow > * { flex: none; }
  .st-frow .st-note { white-space: nowrap; }
  .st-thhead .st-thbig.is-xl { width: 48px; height: 48px; font-size: 26px; }
  .st-thd { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.st-tbody { display: grid; gap: 16px; min-width: 0; }
.st-tmain { min-width: 0; }
@media (min-width: 980px) { .st-tbody { grid-template-columns: minmax(0, 1fr) 300px; } }
.st-stage { position: relative; height: 62vh; height: 62svh; min-height: 340px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); overflow: hidden; }
@media (min-width: 980px) { .st-stage { height: calc(100vh - 300px); min-height: 460px; } }
@media (max-width: 699px) { .st-tvt { font-size: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }
.st-gsvg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.st-gsvg:active { cursor: grabbing; }
.st-gsvg text { font-family: var(--serif); }
.st-gsvg .st-gg { font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", var(--sans); pointer-events: none; }
.st-gn { cursor: pointer; outline: none; }
.st-gn:hover circle, .st-gn.is-hi circle, .st-gn.is-sel circle, .st-gn:focus-visible circle { stroke: var(--ink); stroke-width: 2.6; }
.st-gn.is-hi text, .st-gn.is-sel text { font-weight: 700; }
.st-ge { cursor: pointer; }
.st-ge:hover .st-gev, .st-ge.is-hi .st-gev { stroke: var(--rubric); stroke-opacity: .9; }
.st-geh { pointer-events: stroke; }
.st-zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; }
.st-zb { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); color: var(--ink-2); cursor: pointer; font: 600 18px/1 var(--sans); }
.st-zb:hover { background: var(--surface-2); }
.st-gmsg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 80%; text-align: center; font: 600 14px var(--sans); color: var(--muted); background: var(--surface); padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); }
.st-tip { position: absolute; z-index: 3; width: min(320px, calc(100% - 12px)); background: var(--surface); color: var(--ink); border: 1px solid var(--border-2); border-radius: var(--r-2); box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 15px; line-height: 1.35; display: grid; gap: 5px; }
.st-tip > b { font-size: 16px; }
/* phones: the tip is nearly as wide as the stage, so it goes above or below the verse; cap its height so it never covers it (tap again = make root) */
@media (max-width: 699px) { .st-tip { max-height: 45%; overflow-y: auto; overscroll-behavior: contain; } }
.st-tipv { color: var(--ink-2); font-size: 14.5px; }
.st-tipn { display: flex; flex-wrap: wrap; gap: 3px 10px; font: 600 12px var(--sans); color: var(--ink-2); }
.st-tipn i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.st-tipn .is-off { opacity: .45; }
.st-tipau { font: 12px var(--sans); color: var(--muted); }
.st-tipth { display: grid; gap: 5px; }
.st-tipth:empty { display: none; }
.st-tipsh { font: 12.5px var(--sans); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.st-tipa { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font: 12px var(--sans); color: var(--ink-2); margin: 8px 0 2px; }
.st-lgh { color: var(--muted); font-weight: 600; }
.st-lg { display: inline-flex; align-items: center; gap: 5px; }
.st-lg i { display: inline-block; border-radius: 50%; width: 10px; height: 10px; }
.st-lg i.st-lgl { width: 20px; height: 0; border-radius: 0; border-top: 2.5px solid var(--gilt); }
.st-lg i.st-lgl.is-d { border-top-style: dashed; }
.st-tside { display: grid; gap: 18px; align-content: start; min-width: 0; }
.st-tside .ui-sec-h { margin-bottom: 6px; }
.st-rl { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 13px; }
.st-rl li { display: grid; grid-template-columns: minmax(5rem, 7rem) 1fr 2.8rem auto; gap: 8px; align-items: center; padding: 3px 0; }
.st-troot .st-rl li, .st-tauth .st-rl li { grid-template-columns: minmax(5rem, 8rem) 1fr 2.6rem; }
.st-rl a { text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.st-rl b { text-align: right; font-variant-numeric: tabular-nums; }
.st-rb { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.st-rb i { display: block; height: 100%; background: var(--gold-2); }
.st-rls { font-size: 12px; font-weight: 600 !important; color: var(--muted); }
.st-trank .st-rl { max-height: 60vh; overflow-y: auto; }
.st-tauth { margin-top: 12px; }

/* Themes browser */
.st-tres { margin: 12px 0 4px; }
.st-tlist a { align-items: center; }
.st-tlist b { font-variant: normal; letter-spacing: 0; }
.st-fam { --famc: var(--tc); }
.st-famh { color: var(--ink-2); }
.st-famsw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--tc); }
.st-thgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.st-thcard { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--tc); border-radius: var(--r-2); padding: 10px 12px; min-width: 0; }
.st-thcard:hover { border-color: var(--tc); }
.st-thbig { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--tc); color: var(--paper); font-size: 22px; line-height: 1; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", var(--sans); }
.st-thbig.is-xl { width: 64px; height: 64px; font-size: 34px; }
.st-thct { display: grid; gap: 2px; min-width: 0; }
.st-thct b { font-size: 17.5px; }
.st-thd { font-size: 14.5px; color: var(--ink-2); line-height: 1.35; }
.st-thm { font: 600 12px var(--sans); color: var(--muted); }
.st-credit { margin-top: 28px; }

/* Theme page */
.st-thhead { display: flex; gap: 16px; align-items: flex-start; }
.st-thhead > div { min-width: 0; }
.st-thhead .ui-ptitle { margin: 2px 0 4px; }
.st-thhead .ui-psub { margin: 0; }
.st-thhead .ui-eyebrow a { color: inherit; text-decoration: none; }
.st-thhead .ui-row .st-note { margin: 0; }
.st-tops { display: grid; gap: 10px; }
.st-keyv a { display: grid; grid-template-columns: 1.8rem auto minmax(4.5rem, 7rem); column-gap: 10px; align-items: center; justify-content: start; }
.st-kn { font: 700 12px var(--sans); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Topic page */
.st-sub { margin-top: 18px; }
.st-subh { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.st-refs { display: flex; flex-wrap: wrap; gap: 6px; }
/* "Part of the parable" and "In the glossary & dictionary" chips under the passage */
.st-ext:empty { display: none; }
.st-ext { display: grid; gap: 8px; margin: 12px 0 4px; }
.st-extrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.st-extl { font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); flex: none; }
.st-extc { display: flex; flex-wrap: wrap; gap: 6px; }
.st-ext .wd-see { font-size: 15px; padding: 3px 11px; }
