.nb-reader{--nb-segment-gap:2.9em;--nb-line-gap:8px;--nb-line-height:1.38;background:#fff;color:inherit;font:inherit;font-family:"Plus Jakarta Sans",sans-serif;line-height:inherit;text-align:center;max-width:1100px;margin-left:auto;margin-right:auto}
.nb-reader .nb-segment+.nb-segment{margin-top:var(--nb-segment-gap)}
.nb-reader .nb-line{white-space:pre-wrap;overflow-wrap:break-word;font-size:inherit;line-height:var(--nb-line-height)}
.nb-reader .nb-line+.nb-line{margin-top:var(--nb-line-gap)}
.nb-reader .nb-original{font-family:var(--nb-original-font,inherit);font-size:var(--nb-original-size,inherit);color:var(--nb-original-color,#993300);font-weight:700}
.nb-reader .nb-transcription{font-family:var(--nb-transcription-font,inherit);font-size:var(--nb-transcription-size,inherit);color:var(--nb-transcription-color,#C3892E);font-weight:700}
.nb-reader .nb-french{font-family:var(--nb-french-font,inherit);font-size:var(--nb-french-size,inherit);color:var(--nb-french-color,#333333);font-weight:400}
.nb-reader .nb-original{font-size:var(--nb-original-size,32px);line-height:1.22}
.nb-reader .nb-transcription{font-size:var(--nb-transcription-size,20px);line-height:1.28}
.nb-reader .nb-french{font-size:var(--nb-french-size,20px);line-height:1.34}
.nb-reader .nb-segment{text-align:center}
.nb-reader .nb-line{display:block;width:100%;text-align:center}
.nb-reader button.nb-word,.nb-reader button.nb-word:hover,.nb-reader button.nb-word:focus,.nb-reader button.nb-word:active{display:inline;appearance:none;-webkit-appearance:none;background:transparent;color:inherit;border:0;border-radius:2px;box-shadow:none;padding:0;margin:0;font:inherit;line-height:inherit;letter-spacing:inherit;text-transform:none;text-decoration:none;vertical-align:baseline;cursor:pointer;white-space:pre-wrap;min-width:0;min-height:0}
/* Inverted lexical highlighting, synchronized by the existing reader script. */
.nb-reader .nb-original{--nb-word-highlight:var(--nb-original-color,#993300)}
.nb-reader .nb-transcription{--nb-word-highlight:var(--nb-transcription-color,#C3892E)}
.nb-reader .nb-line button.nb-word{transition:background-color 110ms ease,color 110ms ease!important}
.nb-reader .nb-line button.nb-word:hover,.nb-reader .nb-line button.nb-word.nb-hover,.nb-reader .nb-line button.nb-word.nb-active,.nb-reader .nb-line button.nb-word:focus-visible{background:var(--nb-word-highlight)!important;color:#FFFFFF!important}
@media(prefers-reduced-motion:reduce){.nb-reader .nb-line button.nb-word{transition:none!important}}
@media(forced-colors:active){.nb-reader .nb-line button.nb-word:hover,.nb-reader .nb-line button.nb-word.nb-hover,.nb-reader .nb-line button.nb-word.nb-active,.nb-reader .nb-line button.nb-word:focus-visible{background:Highlight!important;color:HighlightText!important}}
.nb-reader button.nb-word:focus-visible{outline:2px solid #8c3424;outline-offset:2px}
.nb-popup[hidden]{display:none!important}
.nb-popup{position:fixed;z-index:2147483000;box-sizing:border-box;width:min(760px,calc(100vw - 24px));max-height:calc(100vh - 24px);overflow:auto;background:#F9F4E7;border:2px solid #993300;border-radius:8px;box-shadow:0 12px 42px #0002;padding:1.3em 1.5em;color:#333;font-size:inherit;line-height:1.4;font-weight:400;text-align:left;overflow-wrap:anywhere;overscroll-behavior:contain}
.nb-popup:focus{outline:none}
.nb-popup .nb-popup-title{font-size:inherit;padding-right:2em;margin-bottom:.6em;white-space:pre-wrap}
.nb-popup .nb-popup-section+.nb-popup-section{margin-top:.75em}
.nb-popup .nb-popup-section{font-size:inherit;white-space:pre-wrap}
.nb-popup .nb-popup-section ul{padding:0 0 0 1.4em;margin:0;list-style:disc}
.nb-popup .nb-popup-section strong{font-size:inherit;font-weight:700;display:block;margin:0}
.nb-popup button.nb-close,.nb-popup button.nb-close:hover,.nb-popup button.nb-close:focus{position:absolute;right:.55em;top:.45em;color:#993300;background:transparent;border:0;border-radius:4px;font:inherit;font-size:inherit;line-height:1;padding:.35em .55em;cursor:pointer;box-shadow:none;min-width:0;min-height:0}
.nb-popup button.nb-close:focus-visible{outline:2px solid #8c3424}
@media(max-width:600px){.nb-popup{padding:1em;max-height:75vh}}

.nb-popup .nb-popup-section ul li{margin:0!important;padding:0!important;line-height:inherit;font-weight:400}
.nb-popup .nb-inflected{display:block;margin:0 0 .15em}
.nb-popup .nb-lex-original{display:inline;color:#993300;font-weight:700;line-height:1.3;font-family:var(--nb-popup-original-font,inherit)}
.nb-popup .nb-lex-transcription{display:inline;color:#C3892E;font-weight:700;line-height:1.3;font-family:var(--nb-popup-transcription-font,inherit)}
.nb-popup .nb-popup-body{font-weight:400;color:#333;white-space:pre-wrap}
.nb-popup{opacity:0;transform:translateY(3px);transition:opacity 110ms ease,transform 110ms ease;pointer-events:none}
.nb-popup.nb-visible{opacity:1;transform:translateY(0);pointer-events:auto}
@media(prefers-reduced-motion:reduce){.nb-popup{transition:none;transform:none}}

/* Explicit verse rows, insulated from theme paragraph and spacing rules. */
.nb-reader .nb-line .nb-verse-line{display:block!important;margin:0!important;padding:0!important;line-height:var(--nb-line-height)!important;white-space:pre-wrap!important;min-height:0;letter-spacing:inherit;text-align:inherit;font:inherit;line-height:var(--nb-line-height)!important}
.nb-reader .nb-line{margin:0!important;padding:0!important;line-height:var(--nb-line-height)!important}
.nb-reader .nb-line+.nb-line{margin-top:var(--nb-line-gap)!important}
.nb-popup .nb-components{display:block;white-space:normal;font-weight:400;color:#333333}
.nb-popup .nb-component{display:inline;white-space:normal;font-weight:400;color:#333333}

/* Keep the card within its available vertical space, including on small screens. */
.nb-popup{min-height:0;scrollbar-gutter:auto}

/* Keep Elementor button typography from overriding the reading text. */
.nb-reader .nb-segment .nb-line .nb-verse-line button.nb-word{font-family:inherit!important;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important}

/* Nalanda palette: close control and internal notice scrollbar. */
.nb-popup{scrollbar-color:#993300 #F9F4E7;scrollbar-width:thin}
.nb-popup::-webkit-scrollbar{width:10px;height:10px}
.nb-popup::-webkit-scrollbar-track{background:#F9F4E7;border-radius:8px}
.nb-popup::-webkit-scrollbar-thumb{background:#993300;border:2px solid #F9F4E7;border-radius:8px}
.nb-popup::-webkit-scrollbar-corner{background:#F9F4E7}
.nb-popup button.nb-close,.nb-popup button.nb-close:hover,.nb-popup button.nb-close:focus,.nb-popup button.nb-close:active{color:#993300!important;font-size:1.65em!important;font-weight:700!important;background:transparent!important;line-height:1!important;transition:none}
@media(forced-colors:active){.nb-popup{scrollbar-color:auto}}

/* Inset the native scrollbar track so the rounded card corners stay clear. */
@supports selector(::-webkit-scrollbar){
  .nb-popup{scrollbar-color:auto;scrollbar-width:auto}
  .nb-popup::-webkit-scrollbar{width:10px;height:10px;background:transparent}
  .nb-popup::-webkit-scrollbar-track{margin-block:10px;background:#F9F4E7;border-radius:8px}
  .nb-popup::-webkit-scrollbar-thumb{background:#993300;border:2px solid #F9F4E7;border-radius:8px}
  .nb-popup::-webkit-scrollbar-button{display:none;width:0;height:0}
}
.nb-popup button.nb-close,.nb-popup button.nb-close:hover,.nb-popup button.nb-close:focus,.nb-popup button.nb-close:active{top:0.35em;right:0.45em}
@media(forced-colors:active){.nb-popup{scrollbar-color:auto}.nb-popup::-webkit-scrollbar-thumb{background:ButtonText}.nb-popup::-webkit-scrollbar-track{background:Canvas}}

/* Korean body text: intermediate Hangul size, reader only. */
.nb-reader.nb-lang-korean .nb-transcription{font-size:26px}
/* Match the Latin transcription line box while retaining 26px Hangul.
   Override both levels: the shared verse rule uses !important. */
.nb-reader.nb-lang-korean .nb-transcription,
.nb-reader.nb-lang-korean .nb-transcription .nb-verse-line{line-height:calc(var(--nb-line-height) * var(--nb-transcription-size,20px))!important}

/* Korean reading line only: use a traditional serif face, without changing the notice fonts. */
.nb-reader.nb-lang-korean .nb-transcription .nb-verse-line{font-family:"Noto Serif KR",Batang,"AppleMyungjo","Malgun Gothic",serif!important}

/* Classical scripts in the reading text only; popup typography remains unchanged. */
.nb-reader.nb-lang-chinese .nb-original .nb-verse-line,
.nb-reader.nb-lang-korean .nb-original .nb-verse-line{font-family:"Noto Serif TC","PMingLiU","Songti TC","Microsoft JhengHei",serif!important}
.nb-reader.nb-lang-sanskrit .nb-original .nb-verse-line{font-family:"Noto Serif Devanagari","Nirmala UI",Mangal,serif!important}

/* Pinyin only: full Latin diacritic support in the reader and inherited by the lexical notice. */
.nb-reader.nb-lang-chinese .nb-transcription{font-family:"Noto Sans","Plus Jakarta Sans",Arial,sans-serif}
.nb-reader.nb-lang-chinese .nb-transcription .nb-verse-line{font-family:inherit!important}

/* Optical spacing: bring the Latin reading line 7px closer to the Indic script.
   Keep the French line and the Chinese/Korean readers unchanged. */
.nb-reader.nb-lang-sanskrit .nb-original+.nb-transcription,
.nb-reader.nb-lang-pali .nb-original+.nb-transcription{margin-top:max(0px, calc(var(--nb-line-gap) - 7px))!important}

/* Sanskrit original only: a rounded highlight extending 6px above the
   word box and ending 6px before its lower edge, without changing layout. */
@media (forced-colors: none){
  .nb-reader.nb-lang-sanskrit .nb-original button.nb-word{
    position:relative;
    isolation:isolate;
  }
  .nb-reader.nb-lang-sanskrit .nb-original button.nb-word:is(:hover,.nb-hover,.nb-active,:focus-visible){
    background:transparent!important;
    box-shadow:none!important;
  }
  .nb-reader.nb-lang-sanskrit .nb-original button.nb-word:is(:hover,.nb-hover,.nb-active,:focus-visible)::before{
    content:"";
    position:absolute;
    inset:-6px 0 6px;
    background:var(--nb-word-highlight);
    border-radius:2px;
    z-index:-1;
    pointer-events:none;
  }
}

/* Korean transcription only: extend the rounded highlight 4px below
   the word box, without changing text position or line spacing. */
@media (forced-colors: none){
  .nb-reader.nb-lang-korean .nb-transcription button.nb-word{
    position:relative;
    isolation:isolate;
  }
  .nb-reader.nb-lang-korean .nb-transcription button.nb-word:is(:hover,.nb-hover,.nb-active,:focus-visible){
    background:transparent!important;
    box-shadow:none!important;
  }
  .nb-reader.nb-lang-korean .nb-transcription button.nb-word:is(:hover,.nb-hover,.nb-active,:focus-visible)::before{
    content:"";
    position:absolute;
    inset:0 0 -4px;
    background:var(--nb-word-highlight);
    border-radius:2px;
    z-index:-1;
    pointer-events:none;
  }
}
