/* Shared responsive analysis surface. Only the outer surface scrolls vertically. */
body.reading .site-header,body.reading #site-header,body.reading .site-navigation {display:none}
body.sheet-open {overscroll-behavior:none}
body.sheet-open .rd-stage,body.sheet-open .sa-passage-scroller {padding-bottom:calc(var(--sheet-height,100dvh) * .62)!important;}
body > .reader-sheet.reader-sheet {
 transform:none!important;transition:none!important;animation:none!important;position:fixed!important;
 inset:auto 0 0!important;top:auto!important;bottom:calc(100dvh - var(--sheet-top,0px) - var(--sheet-height,100dvh))!important;
 width:100%!important;max-width:none!important;height:auto!important;max-height:min(calc(var(--sheet-height,100dvh) * .62),var(--sheet-available-height,100dvh))!important;min-height:0!important;
 margin:0!important;box-sizing:border-box;display:block!important;overflow:auto!important;overscroll-behavior:contain;touch-action:pan-x pan-y;
 padding:0 max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
 background:var(--site-paper,#fffaf0);color:var(--site-ink,#27241e);border:1px solid var(--site-border,#aaa);border-radius:16px 16px 0 0;
 z-index:var(--reader-layer,10002);box-shadow:0 -10px 40px #0003;pointer-events:auto;overflow-wrap:break-word;
}
.reader-sheet-backdrop {position:fixed;inset:0;background:transparent;touch-action:none}
:is(.reader-sheet,.reader-panel) :is(.sa-tab-content,.sa-context,.sa-source-disclosure,.sa-original,.sg-guide,.sg-feed,.sg-messages,.dialog-body,.modal-content,.modal-body) {
 display:block!important;height:auto!important;max-height:none!important;min-height:0!important;overflow:visible!important;flex:none!important;
}
:is(.reader-sheet,.reader-panel) .work-map {overflow:visible!important;max-height:none!important}
:is(.reader-sheet,.reader-panel) :is(.modal-content,.modal-body) {width:auto;max-width:none;margin:0;padding:0;box-shadow:none;border:0;background:transparent}
:is(.reader-sheet,.reader-panel) .reader-header {
 position:sticky!important;top:0!important;z-index:3;background:var(--site-paper,#fffaf0);display:flex!important;flex-wrap:nowrap!important;align-items:center;gap:4px;padding:4px 0!important;margin:0!important;
}
:is(.reader-sheet,.reader-panel) .reader-title {flex:1;min-width:0;font-size:16px!important;line-height:1.4!important;margin:0;display:block;max-height:4.2em;overflow:hidden;overflow-wrap:anywhere}
:is(.reader-sheet,.reader-panel).sa-inspector .reader-title {-webkit-line-clamp:unset!important;-webkit-box-orient:initial!important;max-height:4.2em}
:is(.reader-sheet,.reader-panel) .reader-header .sa-eyebrow {display:none}
:is(.reader-sheet,.reader-panel) :is(button,summary,input,select) {min-height:44px!important;min-width:44px!important;box-sizing:border-box}
:is(.reader-sheet,.reader-panel) button {max-width:100%;overflow-wrap:normal;word-break:normal;white-space:normal}
:is(.reader-sheet,.reader-panel) :is(.reader-close,.reader-back,.reader-size) {flex:none!important;white-space:nowrap!important;background:transparent!important;color:inherit!important;border:1px solid var(--site-border,#aaa)!important;border-radius:8px;padding:4px 10px!important;font-size:14px!important}
:is(.reader-sheet,.reader-panel) .reader-close {font-size:24px!important;width:44px!important}
:is(.reader-sheet,.reader-panel) .sa-tabs {display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity;touch-action:pan-x;overscroll-behavior-x:contain;position:static!important;gap:4px;margin:4px 0!important;max-width:100%;}
:is(.reader-sheet,.reader-panel) .sa-tabs button {flex:0 0 auto!important;width:auto!important;white-space:nowrap;scroll-snap-align:nearest}
:is(.reader-sheet,.reader-panel) .reader-sheet-nav {position:static;bottom:auto;z-index:2;background:var(--site-paper,#fffaf0);display:grid;grid-template-columns:minmax(44px,1fr) minmax(112px,1.2fr) minmax(44px,1fr);grid-auto-rows:minmax(44px,auto);align-items:stretch;gap:4px;padding:4px 0;margin-top:8px;}
:is(.reader-sheet,.reader-panel) .reader-sheet-nav button {font-size:12px!important;line-height:1.2;padding:4px!important;min-width:44px!important;}
:is(.reader-sheet,.reader-panel) .reader-sheet-nav span {font-size:11px;min-width:0;text-align:center;white-space:nowrap;display:flex;align-items:center;justify-content:center}
:is(.reader-sheet,.reader-panel) .sg-composer {position:static!important;background:var(--site-paper,#fffaf0);display:block;padding:8px 0}
:is(.reader-sheet,.reader-panel) .sg-composer-actions {display:flex;flex-wrap:wrap;gap:8px}
:is(.reader-sheet,.reader-panel) .sg-input {width:100%;box-sizing:border-box}
:is(.reader-sheet,.reader-panel) .sa-source-preview {white-space:normal;overflow-wrap:break-word}
:is(.reader-sheet,.reader-panel) .sa-inspector-footer {display:flex;flex-wrap:wrap;gap:8px}
:is(.reader-sheet,.reader-panel) .sa-sense {max-height:none}
:is(.reader-sheet,.reader-panel) .sa-structure-map {display:block;max-width:100%}
:is(.reader-sheet,.reader-panel) svg {max-width:100%;height:auto}
body.sheet-compact > .reader-sheet.reader-sheet,body > .reader-sheet.reader-editing {height:var(--sheet-height,100dvh)!important;max-height:var(--sheet-height,100dvh)!important;border-radius:0}
body.sheet-compact :is(.reader-sheet,.reader-panel) .sa-inspector-top {flex-wrap:nowrap!important;gap:2px!important}
body.sheet-compact :is(.reader-sheet,.reader-panel) .sa-inspector-top .reader-title {font-size:13px!important}
body.sheet-compact :is(.reader-sheet,.reader-panel) .sa-inspector-top .sa-source-disclosure,body.sheet-compact :is(.reader-sheet,.reader-panel) .sa-inspector-top .sa-context {flex:0 1 96px;min-width:44px;max-width:96px;margin:0!important}
body.sheet-compact :is(.reader-sheet,.reader-panel) .sa-inspector-top details summary {font-size:11px;line-height:1.15;padding:2px!important}
body.sheet-compact :is(.reader-sheet,.reader-panel) .sa-inspector-top .sa-source-preview {display:none!important}
body.sheet-compact :is(.reader-sheet,.reader-panel) .sa-inspector-top details summary {white-space:normal;overflow-wrap:anywhere}
.reader-editing .reader-sheet-nav {position:static}
#reader-view.sa-inspecting .rd-bottom {visibility:visible}
.edition-reader .reader-tools {position:sticky;top:var(--site-nav-height,64px);z-index:20;background:var(--site-paper)}
body.sheet-open .edition-reader .reader-tools {position:static}
body.sheet-open #edition-status:not([hidden]):not(:empty) {z-index:11000;top:calc(var(--sheet-top,0px) + 8px);bottom:auto;height:auto;max-height:30vh}
.relations svg {max-width:none;height:auto}
@media(min-width:701px) {
 body > .reader-sheet.reader-sheet {inset:auto!important;left:50%!important;top:calc(var(--sheet-top,0px) + 24px)!important;transform:translateX(-50%)!important;width:min(680px,calc(100vw - 48px))!important;max-height:calc(var(--sheet-height,100dvh) - 48px)!important;border-radius:12px}
 body > .reader-panel.reader-panel {position:fixed!important;transform:none!important;animation:none!important;transition:none!important;opacity:1!important;height:auto!important;min-height:0!important;margin:0!important;right:16px!important;left:auto!important;top:auto!important;bottom:calc(100dvh - var(--sheet-top,0px) - var(--sheet-height,100dvh) + 16px)!important;width:min(460px,48vw)!important;max-height:min(calc(var(--sheet-height,100dvh) * .62),var(--sheet-available-height,100dvh))!important;overflow:auto!important;overscroll-behavior:contain;padding:12px!important;z-index:9000;background:var(--site-paper);box-sizing:border-box}
}
@media(min-width:1200px) {body > .sa-inspector.reader-panel.reader-panel {top:calc(var(--reader-tools-bottom,140px) + 12px)!important;bottom:calc(100dvh - var(--sheet-top,0px) - var(--sheet-height,100dvh) + 24px)!important;width:min(420px,30vw)!important;max-height:none!important}}

:is(.reader-sheet,.reader-panel) details:not([open]) > :not(summary) {display:none!important}

body > .reader-sheet.reader-expanded {max-height:calc(var(--sheet-height,100dvh) * .9)!important}

body.sheet-compact > .reader-panel.reader-panel {top:var(--sheet-top,0px)!important;bottom:auto!important;height:auto!important;max-height:min(calc(var(--sheet-height,100dvh) * .62),var(--sheet-available-height,100dvh))!important}

.reader-sheet::backdrop {background:transparent}
.reader-panel {overflow-wrap:break-word;touch-action:pan-x pan-y}

:is(.reader-sheet,.reader-panel) summary .sa-source-preview {display:none}
.reader-opener {background:color-mix(in srgb,var(--site-accent,#98401d) 18%,var(--site-paper,#fffaf0))!important;color:var(--site-ink,#27241e)!important;outline:1px solid var(--site-accent,#98401d);outline-offset:2px}

:is(.reader-sheet,.reader-panel) :is(.sg-history,.sg-stream) {max-height:none!important;height:auto!important;overflow:visible!important}
:is(.reader-sheet,.reader-panel) textarea.sg-input {max-height:none!important;overflow:hidden!important}
:is(.reader-sheet,.reader-panel) [hidden] {display:none!important}
.reader-editing .reader-header {position:static!important}
.reader-scrolled .reader-title {font-size:14px!important}

:is(.reader-sheet,.reader-panel) :is(.sa-member-form,.sa-member-title,.sa-original,.sa-source-preview,.sa-sound-equation) {overflow-wrap:break-word!important;word-break:normal;hyphens:manual}
/* One Source disclosure row on every surface: native marker plus visible label; the title already names the expression. */
:is(.reader-sheet,.reader-panel) .sa-source-disclosure > summary {display:list-item!important;align-items:initial}
:is(.reader-sheet,.reader-panel) .sa-source-disclosure > summary::before {content:none!important}
:is(.reader-sheet,.reader-panel) .sa-source-disclosure > summary .sa-source-label {display:inline!important;position:static!important;width:auto!important;height:auto!important;overflow:visible!important;clip-path:none!important}

/* Compound map: shared by the workspace, Zen and edition readers (edition pages do not load display.css). */
.sa-structure-map {--sa-structure-serif:'Noto Serif Devanagari',Georgia,serif;display:block;width:100%;height:auto;min-height:150px;overflow:visible;color:var(--text-color);margin:4px 0 6px}
.sa-structure-map path {stroke:color-mix(in srgb,var(--light-text) 70%,transparent);fill:none;stroke-width:1.4}
.sa-structure-map .sa-leaf circle {fill:var(--light-bg);stroke:var(--accent-color);stroke-width:1.8}
.sa-structure-map .sa-branch circle {fill:var(--sa-family,var(--light-text));stroke:var(--light-bg);stroke-width:2}
.sa-structure-map .sa-badge {font:600 12px system-ui,sans-serif;fill:var(--light-bg);pointer-events:none}
.sa-structure-map .sa-form {fill:var(--text-color);font:13px var(--sa-structure-serif)}
.sa-structure-map .sa-gloss {fill:var(--light-text);font:12px system-ui,sans-serif}
.sa-structure-map .sa-leaf{cursor:pointer;outline:none}
.sa-structure-map .sa-leaf:hover circle,.sa-structure-map .sa-leaf:focus-visible circle{fill:var(--primary-color);stroke:var(--primary-color)}
.sa-structure-map .sa-leaf:focus-visible .sa-form{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}
.sa-structure-map [data-family=tatpurusa],.sa-structure-key[data-family=tatpurusa]{--sa-family:light-dark(#2f6f8f,#7fb6d4)}
.sa-structure-map [data-family=karmadharaya],.sa-structure-key[data-family=karmadharaya]{--sa-family:light-dark(#76551e,#d8b878)}
.sa-structure-map [data-family=bahuvrihi],.sa-structure-key[data-family=bahuvrihi]{--sa-family:light-dark(#7a3f6b,#d39ac4)}
.sa-structure-map [data-family=dvandva],.sa-structure-key[data-family=dvandva]{--sa-family:light-dark(#3c663b,#9fcd96)}
.sa-structure-map [data-family=avyayibhava],.sa-structure-key[data-family=avyayibhava],.sa-structure-map [data-family=dvigu],.sa-structure-key[data-family=dvigu]{--sa-family:light-dark(#5a4f8f,#b3aae0)}
.sa-structure-legend{display:flex;flex-wrap:wrap;gap:4px 14px;margin:0 0 8px;font:12px/1.6 system-ui,sans-serif;color:var(--light-text)}
.sa-structure-key{display:inline-flex;align-items:center;gap:6px}
.sa-structure-key b{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 4px;border-radius:10px;background:var(--sa-family,var(--light-text));color:var(--light-bg);font:600 12px system-ui,sans-serif}
@media(max-width:700px){:is(.reader-sheet,.reader-panel) .reader-sheet-nav{display:grid;grid-template-columns:minmax(44px,1fr) minmax(110px,1.6fr) minmax(44px,1fr);gap:3px;padding:4px 0;}:is(.reader-sheet,.reader-panel) .reader-sheet-nav>button{font-size:12px!important;line-height:1.15;padding:2px!important;text-align:center}:is(.reader-sheet,.reader-panel) .reader-sheet-nav>span{font-size:10px;line-height:1.2;text-align:center;white-space:nowrap}}

/* Compact height keeps the tabs and content usable while navigation stays in flow. */
.reader-verse-menu {display:none}
body.sheet-compact > .reader-panel.reader-panel {height:var(--sheet-height,100dvh)!important;max-height:var(--sheet-height,100dvh)!important}
body.sheet-compact :is(.reader-sheet,.reader-panel) .reader-header {position:static!important}
body.sheet-compact :is(.reader-sheet,.reader-panel) .reader-sheet-nav {position:relative;bottom:auto;grid-template-columns:1fr 1.2fr 1fr 44px;grid-auto-rows:44px;max-height:52px}
body.sheet-compact .reader-sheet-nav > :nth-child(n+4):not(.reader-verse-menu) {display:none}
body.sheet-compact .reader-sheet-nav > .reader-verse-menu {display:block;position:relative}
body.sheet-compact .reader-verse-menu summary {display:flex;align-items:center;justify-content:center;cursor:pointer}
body.sheet-compact .reader-verse-menu[open] {background:var(--site-paper);z-index:5}
body.sheet-compact .reader-verse-menu button {background:var(--site-paper);width:100%;min-width:80px!important;position:relative;right:36px}
@media(max-width:700px){
 :is(.reader-sheet,.reader-panel) .sa-tabs {overflow:visible!important;gap:0}
 :is(.reader-sheet,.reader-panel) .sa-tabs button {flex:1 1 0!important;min-width:0!important;padding:4px!important;font-size:11px!important}
}

:is(.reader-sheet,.reader-panel) :is(.sa-source-disclosure,.sa-context) {margin:0!important;padding:0!important}
:is(.reader-sheet,.reader-panel) .reader-title {max-height:4.2em!important}

body.sheet-compact .reader-sheet-nav > span[data-compact-position] {font-size:0!important}
body.sheet-compact .reader-sheet-nav > span[data-compact-position]::after {content:attr(data-compact-position);font-size:11px}

body.reader-panel-open .rd-stage {padding-bottom:calc(var(--sheet-height,100dvh) * .62)!important}
