@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Literata:ital,opsz,wght@0,7..72,400;0,7..72,600;0,7..72,700;1,7..72,400&display=swap");

/* Patched Devanagari Fonts - Zero Shirorekha on Visarga */
@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-weight: 400;
  src: url('/sanskrit/fonts/NotoSansDevanagari-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-weight: 700;
  src: url('/sanskrit/fonts/NotoSansDevanagari-Bold.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  font-style: normal;
  font-weight: 400;
  src: url('/sanskrit/fonts/NotoSerifDevanagari-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  font-style: normal;
  font-weight: 700;
  src: url('/sanskrit/fonts/NotoSerifDevanagari-Bold.ttf') format('truetype');
  font-display: swap;
}

/* Shared library atlas. Loaded after each page's own styles. */

/* The site palette, written once. The home page reads these, and so do the dark
   rules below; scripts/check_library_nav.py (test_one_palette) fails if the home
   page declares colours of its own or a book stylesheet's cream page, ink and link
   drift from the light values here. */
:root {
  --site-bg: #fdf6e9;
  --site-panel: #fffaf0;
  --site-panel-hover: #ffffff;
  --site-ink: #2c221a;
  --site-muted: #6e5e50;
  --site-accent: #b5451d;
  --site-accent-hover: #8a3414;
  --site-line: #e7d8bf;
  --site-chip: #f4ecdc;
  --site-chip-ink: #4a3c2e;
  --site-ochre: #b57c1e;
  --site-leaf: #2f6b5a;
  --site-slate: #3b5971;
  --site-plum: #6d3b68;
  --site-font-display: "Literata", "Noto Serif Devanagari", Georgia, serif;
  --site-font-sans: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --site-radius-sm: 6px;
  --site-radius-md: 12px;
  --site-radius-pill: 999px;
  --site-measure-reading: 48rem;
  --site-measure-hub: 58rem;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --site-bg: #1c1612;
  --site-panel: #2a221c;
  --site-panel-hover: #342a22;
  --site-ink: #f3e6d4;
  --site-muted: #bdafa3;
  --site-accent: #f0b089;
  --site-accent-hover: #ffd0a8;
  --site-line: rgba(243, 230, 212, 0.18);
  --site-chip: #1c1612;
  --site-chip-ink: #ded1c4;
  --site-plum: #c490be;
}
body {
  font-family: var(--site-font-sans);
  font-size: 1rem;
  line-height: 1.62;
}
:where(h1, h2, .brand-display, .section-title, .card-title, .stream-title) {
  font-family: var(--site-font-display);
}
:where(h1, h2, .card-title, .section-title) .deva {
  font-family: "Noto Serif Devanagari", "Noto Sans Devanagari", serif;
}
html { scroll-padding-top: 4.6rem; scroll-padding-bottom: 4.8rem; }
html[data-pillar="shruti"] {
  --pillar: #D97706;
  --pillar-bright: #D97706;
  --pillar-soft: rgba(217, 119, 6, 0.14);
}
html[data-pillar="darsana"] {
  --pillar: #4F46E5;
  --pillar-bright: #2563EB;
  --pillar-soft: rgba(79, 70, 229, 0.12);
}
html[data-pillar="itihasa"] {
  --pillar: #DC2626;
  --pillar-bright: #DC2626;
  --pillar-soft: rgba(220, 38, 38, 0.12);
}
html[data-pillar="purana"] {
  --pillar: #0D9488;
  --pillar-bright: #0D9488;
  --pillar-soft: rgba(13, 148, 136, 0.14);
}

html[data-pillar="shruti"] header.top,
html[data-pillar="darsana"] header.top,
html[data-pillar="itihasa"] header.top,
html[data-pillar="purana"] header.top,
html[data-pillar="shruti"] .atlas-toolsbar,
html[data-pillar="darsana"] .atlas-toolsbar,
html[data-pillar="itihasa"] .atlas-toolsbar,
html[data-pillar="purana"] .atlas-toolsbar {
  border-top: 3px solid var(--pillar);
  border-bottom-color: var(--pillar);
}

.atlas-tools, .atlas-toolsbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.atlas-tools { margin-left: auto; flex: 0 0 auto; }
.atlas-toolsbar {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 0.45rem 1rem;
  background: rgba(253, 246, 233, 0.96);
  border-bottom: 1px solid rgba(44, 34, 26, 0.12);
}
.atlas-tools button, .atlas-toolsbar button {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 999px;
  border: 1px solid var(--site-line);
  background: var(--site-panel);
  color: var(--site-ink);
  padding: 0.28rem 0.65rem;
  cursor: pointer;
}
.atlas-open {
  border-color: var(--pillar, var(--site-accent)) !important;
  color: var(--pillar, var(--site-accent)) !important;
}
.atlas-open[aria-expanded="true"] {
  background: var(--pillar, var(--site-accent));
  color: var(--site-panel) !important;
}
.atlas-tools button:focus-visible,
.atlas-toolsbar button:focus-visible,
.lib-pager a:focus-visible,
.atlas-panel a:focus-visible,
.atlas-search-panel a:focus-visible,
.atlas-search-panel input:focus-visible {
  outline: 2px solid var(--pillar, var(--site-accent));
  outline-offset: 2px;
}

/* The reading bar already says where the page is. Hide the in-page path under it. */
html[data-pills] .where,
html[data-shelf="hindu"] .where,
html[data-shelf="readings"] .where,
html[data-shelf="katha"] .where,
html[data-shelf="buddhist"] .where,
html[data-shelf="sanskrit"] .where,
html[data-shelf="sanskrit"] .site-home,
html[data-shelf="stoic"] .where { display: none; }

.bridge {
  margin: 0.9rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--pillar, #b5451d);
  border-radius: 0.45rem;
  background: var(--pillar-soft, rgba(181, 69, 29, 0.08));
}

.atlas-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 22, 18, 0.46);
}
.atlas-drawer, .atlas-search {
  position: fixed;
  inset: 0;
  z-index: 40;
}
.atlas-search { z-index: 50; }
.atlas-drawer[hidden], .atlas-search[hidden] { display: none; }
.atlas-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(24rem, 92vw);
  overflow: auto;
  background: var(--site-panel);
  color: var(--site-ink);
  box-shadow: -16px 0 40px rgba(44, 34, 26, 0.18);
  padding: 0.85rem 0.9rem 2rem;
}
.atlas-panel h2 {
  margin: 0;
  font-size: 1.15rem;
}
.atlas-head, .atlas-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.atlas-fold { margin: 0.15rem 0; }
.atlas-fold > summary {
  cursor: pointer;
  font-weight: 750;
  padding: 0.38rem 0.4rem 0.38rem 0.55rem;
  border-radius: 0.35rem;
  list-style: none;
}
.atlas-fold > summary::-webkit-details-marker { display: none; }
.atlas-fold > summary::before { content: "▸ "; font-weight: 500; }
.atlas-fold[open] > summary::before { content: "▾ "; }
.atlas-fold[data-pillar="shruti"] > summary { box-shadow: inset 3px 0 0 #D97706; }
.atlas-fold[data-pillar="darsana"] > summary { box-shadow: inset 3px 0 0 #4F46E5; }
.atlas-fold[data-pillar="itihasa"] > summary { box-shadow: inset 3px 0 0 #DC2626; }
.atlas-fold[data-pillar="purana"] > summary { box-shadow: inset 3px 0 0 #0D9488; }
.atlas-kids { margin: 0 0 0.25rem 0.7rem; }
.atlas-panel a, .atlas-search-panel a {
  display: block;
  padding: 0.32rem 0.45rem;
  border-radius: 0.35rem;
  color: var(--site-ink);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
}
.atlas-panel a.atlas-current {
  background: var(--pillar-soft, var(--site-chip));
  box-shadow: inset 3px 0 0 var(--pillar, var(--site-accent));
}
.atlas-search-panel {
  position: relative;
  width: min(36rem, calc(100% - 1.5rem));
  margin: 12vh auto 0;
  background: var(--site-panel);
  color: var(--site-ink);
  border-radius: 0.8rem;
  box-shadow: 0 18px 50px rgba(44, 34, 26, 0.28);
  padding: 0.85rem;
}
.atlas-search-panel input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--site-line);
  background: var(--site-panel-hover);
  color: var(--site-ink);
}
.atlas-results { list-style: none; margin: 0.55rem 0 0; padding: 0; max-height: min(50vh, 22rem); overflow: auto; }
.atlas-results li { margin: 0; }
.atlas-results a small {
  display: block;
  font-weight: 500;
  color: var(--site-muted);
}
.atlas-results a[aria-selected="true"] { background: var(--pillar-soft, rgba(181, 69, 29, 0.1)); }
.atlas-hint { margin: 0.35rem 0 0; font-size: 0.88rem; color: var(--site-muted); }

/* The pager every reading page carries after </main>: the page before, the
   contents page above, the page after. It is stamped by fix_library_nav.py,
   works with scripts off, and stays on screen at the foot of the window. */
.lib-pager {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  /* The band stays the width of the window. The three links sit in the same
     column as the article (48rem; Stoic Philosophy is 50rem). */
  --pager-column: 48rem;
  padding: 0.35rem max(0px, calc((100% - var(--pager-column)) / 2)) calc(0.35rem + env(safe-area-inset-bottom));
  background: var(--site-bg);
  border-top: 3px solid var(--pillar, var(--site-line));
  box-shadow: 0 -8px 18px rgba(44, 34, 26, 0.06);
  font-size: 0.92rem;
  line-height: 1.25;
}
.lib-pager a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  text-decoration: none;
  font-weight: 700;
  color: inherit;
}
.lib-pager small {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--pillar, var(--site-accent));
}
.lib-pager-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-pager .step-prev { grid-column: 1; justify-self: start; max-width: 100%; }
.lib-pager .step-up { grid-column: 2; text-align: center; max-width: 16rem; }
.lib-pager .step-next { grid-column: 3; justify-self: end; text-align: right; max-width: 100%; }
body.atlas-lock { overflow: hidden; }

@media (max-width: 640px) {
  .lib-pager { gap: 0.3rem; padding-left: 0.5rem; padding-right: 0.5rem; }
  .lib-pager .lib-pager-name { display: none; }
  .lib-pager small { font-size: 0.86rem; }
  .atlas-tools button, .atlas-toolsbar button { padding: 0.28rem 0.5rem; }

  html[data-shelf] .lang-switch { gap: 0.2rem; }
  html[data-shelf] .lang-switch button { padding: 0.18rem 0.45rem; font-size: 0.8rem; }
  .lang-short { display: inline; }
  .lang-long { display: none; }
}
@media (min-width: 641px) {
  .lang-short { display: none; }
  .lang-long { display: inline; }
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"]:not([data-shelf="music"]) body {
  background: var(--site-bg);
  color: var(--site-ink);
}
html[data-theme="dark"] .atlas-toolsbar,
html[data-theme="dark"] .side {
  background: rgba(28, 22, 18, 0.96);
  color: var(--site-ink);
}
html[data-theme="dark"] .lib-pager {
  background: var(--site-bg);
  color: var(--site-ink);
}
html[data-theme="dark"] .lib-pager small { color: var(--pillar, #f0a070); }
html[data-theme="dark"] .lib-ext { color: #c4b2a0; }
html[data-theme="dark"][data-pillar="shruti"] {
  --pillar: #f5a640;
  --pillar-bright: #f5a640;
  --pillar-soft: rgba(245, 166, 64, 0.16);
}
html[data-theme="dark"][data-pillar="darsana"] {
  --pillar: #8ea2ff;
  --pillar-bright: #8ea2ff;
  --pillar-soft: rgba(142, 162, 255, 0.16);
}
html[data-theme="dark"][data-pillar="itihasa"] {
  --pillar: #ff8888;
  --pillar-bright: #ff8888;
  --pillar-soft: rgba(255, 136, 136, 0.16);
}
html[data-theme="dark"][data-pillar="purana"] {
  --pillar: #45d6c8;
  --pillar-bright: #45d6c8;
  --pillar-soft: rgba(69, 214, 200, 0.16);
}
html[data-theme="dark"] .atlas-panel,
html[data-theme="dark"] .atlas-search-panel,
html[data-theme="dark"] .atlas-tools button,
html[data-theme="dark"] .atlas-toolsbar button {
  background: var(--site-panel);
  color: var(--site-ink);
  border-color: var(--site-line);
}
html[data-theme="dark"]:not([data-shelf="music"]) .card,
html[data-theme="dark"]:not([data-shelf="music"]) .bridge {
  background: var(--site-panel);
  color: var(--site-ink);
  border-color: var(--site-line);
}
html[data-theme="dark"]:not([data-shelf="music"]) .deva {
  color: #ddcbb8;
  font-weight: 400;
}
html[data-theme="dark"]:not([data-shelf="music"]) h1 .deva,
html[data-theme="dark"]:not([data-shelf="music"]) h2 .deva,
html[data-theme="dark"]:not([data-shelf="music"]) h3 .deva {
  color: inherit;
  font-weight: 500;
}
html[data-theme="dark"]:not([data-shelf="music"]) a { color: var(--site-accent); }
html[data-theme="dark"]:not([data-shelf="music"]) a:hover { color: var(--site-accent-hover); }
html[data-theme="dark"]:not([data-shelf="music"]) p,
html[data-theme="dark"]:not([data-shelf="music"]) li,
html[data-theme="dark"]:not([data-shelf="music"]) td,
html[data-theme="dark"]:not([data-shelf="music"]) dd,
html[data-theme="dark"]:not([data-shelf="music"]) .lead,
html[data-theme="dark"]:not([data-shelf="music"]) .hero-lead,
html[data-theme="dark"]:not([data-shelf="music"]) .level-intro {
  color: #ded1c4;
}
html[data-theme="dark"]:not([data-shelf="music"]) strong,
html[data-theme="dark"]:not([data-shelf="music"]) b {
  color: #fffaf0;
}
html[data-theme="dark"]:not([data-shelf="music"]) .card { color: var(--site-ink); }
html[data-theme="dark"]:not([data-shelf="music"]) .card strong,
html[data-theme="dark"]:not([data-shelf="music"]) h1,
html[data-theme="dark"]:not([data-shelf="music"]) h2,
html[data-theme="dark"]:not([data-shelf="music"]) h3,
html[data-theme="dark"]:not([data-shelf="music"]) h4,
html[data-theme="dark"]:not([data-shelf="music"]) h5,
html[data-theme="dark"]:not([data-shelf="music"]) h6,
html[data-theme="dark"] .atlas-panel a,
html[data-theme="dark"] .atlas-search-panel a { color: #f6ead8; }

/* Callouts, Executive Summaries & Aside Boxes in Dark Mode */
html[data-theme="dark"]:not([data-shelf="music"]) .exec-summary,
html[data-theme="dark"]:not([data-shelf="music"]) aside.exec-summary,
html[data-theme="dark"]:not([data-shelf="music"]) .callout,
html[data-theme="dark"]:not([data-shelf="music"]) .dialogue-box,
html[data-theme="dark"]:not([data-shelf="music"]) blockquote {
  background: #241e1a !important;
  border-color: var(--site-line) !important;
  border-left-color: #e07043 !important;
  color: #ded1c4 !important;
}
html[data-theme="dark"]:not([data-shelf="music"]) .exec-summary p,
html[data-theme="dark"]:not([data-shelf="music"]) aside.exec-summary p,
html[data-theme="dark"]:not([data-shelf="music"]) .callout p,
html[data-theme="dark"]:not([data-shelf="music"]) blockquote p {
  color: #ded1c4 !important;
}
html[data-theme="dark"]:not([data-shelf="music"]) .exec-summary h2,
html[data-theme="dark"]:not([data-shelf="music"]) .exec-summary h3,
html[data-theme="dark"]:not([data-shelf="music"]) .exec-summary h4,
html[data-theme="dark"]:not([data-shelf="music"]) .callout-title {
  color: #f0a070 !important;
}

/* Universal Table Styles in Dark Mode */
html[data-theme="dark"]:not([data-shelf="music"]) table {
  border-color: var(--site-line);
}
html[data-theme="dark"]:not([data-shelf="music"]) th {
  background: rgba(240, 217, 168, 0.1);
  color: #f0d9a8;
  border-color: var(--site-line);
}
html[data-theme="dark"]:not([data-shelf="music"]) td {
  border-color: rgba(243, 230, 212, 0.1);
  color: #ded1c4;
}
html[data-theme="dark"]:not([data-shelf="music"]) tr:hover td {
  background: rgba(240, 217, 168, 0.05);
}
html[data-theme="dark"] .atlas-hint,
html[data-theme="dark"] .atlas-results a small { color: #d7c4b4; }
html[data-theme="dark"] .atlas-search-panel input {
  background: var(--site-bg);
  color: var(--site-ink);
  border-color: rgba(243, 230, 212, 0.22);
}
html[data-theme="dark"] .atlas-open[aria-expanded="true"] { color: var(--site-bg) !important; }

/* The reading bar: Home, then each step down to this page. Each step's arrow
   opens what sits under it, and the last step's opens what sits beside it. */
header.top {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(253, 246, 233, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(44, 34, 26, 0.14);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
header.top.is-unpinned { transform: translateY(-100%); }
html[data-theme="dark"] header.top {
  background: rgba(24, 20, 17, 0.96);
  border-bottom-color: rgba(245, 236, 226, 0.14);
}
p.where { display: none; }

.lib-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.25rem;
  max-width: 58rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 0.4rem;
  font-size: 0.92rem;
  line-height: 1.3;
  color: #7b6452;
}
.lib-bar a { text-decoration: none; }
.lib-crumb {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.lib-crumb + .lib-crumb::before {
  content: "›";
  margin: 0 0.3rem 0 0.1rem;
  color: rgba(44, 34, 26, 0.4);
}
.lib-here::before,
.lib-authors::before { content: none !important; }
.lib-here { margin-left: 0.4rem; }
.lib-authors { margin: 0 0.15rem 0 0.4rem; }
.lib-crumb > a,
.lib-solo > summary {
  display: inline-block;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.22rem 0.2rem;
  color: #b5451d;
  font-weight: 700;
}
.lib-crumb > a:hover { color: #8a3414; text-decoration: underline; }
.lib-crumb > a[aria-current="page"] { color: #2c221a; }
.lib-menu { position: static; }
.lib-menu > summary {
  cursor: pointer;
  list-style: none;
  border-radius: 999px;
  padding: 0.22rem 0.4rem;
  color: #b5451d;
  font-weight: 700;
}
.lib-menu > summary::-webkit-details-marker { display: none; }
.lib-menu > summary::after { content: "▾"; font-size: 0.8em; opacity: 0.8; }
.lib-solo > summary::after { content: " ▾"; }
.lib-menu > summary:hover,
.lib-menu[open] > summary { background: #ead9bf; color: #8a3414; }
.lib-here > .lib-menu > summary,
.lib-authors > .lib-menu > summary {
  padding: 0.22rem 0.7rem;
  border: 1px solid rgba(181, 69, 29, 0.35);
  background: #fffaf3;
  font-size: 0.88rem;
}
.lib-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 16rem;
  max-width: min(26rem, 92vw);
  max-height: min(78vh, 32rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.45rem;
  background: #fffdfa;
  border: 1px solid rgba(44, 34, 26, 0.16);
  border-radius: 0.65rem;
  box-shadow: 0 12px 32px rgba(44, 34, 26, 0.18);
  z-index: 40;
  font-size: 0.9rem;
}
.lib-here .lib-panel { left: auto; right: 0; }
.lib-panel a {
  display: block;
  padding: 0.35rem 0.65rem;
  border-radius: 0.4rem;
  color: #2c221a;
  font-weight: 550;
  line-height: 1.35;
}
.lib-panel a:hover,
.lib-panel a:focus-visible { background: rgba(181, 69, 29, 0.08); color: #8a3414; }
.lib-panel a[aria-current="page"] {
  background: #ead9bf;
  color: #8a3414;
  font-weight: 750;
  box-shadow: inset 3px 0 0 var(--pillar, #b5451d);
}
.lib-panel a.lib-sub { margin-left: 0.85rem; font-weight: 500; }
.lib-panel a.lib-sub::before { content: "• "; color: #8a3414; }
.lib-panel a[hidden],
.lib-group[hidden] { display: none; }
.lib-filter-wrap {
  position: sticky;
  top: -0.45rem;
  margin: -0.45rem -0.45rem 0.35rem;
  padding: 0.45rem;
  background: #fffdfa;
  border-bottom: 1px solid rgba(44, 34, 26, 0.12);
  z-index: 2;
}
.lib-filter {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.86rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(44, 34, 26, 0.22);
  background: #fff;
  color: #2c221a;
}
.lib-filter:focus {
  outline: 2px solid var(--pillar, #b5451d);
  outline-offset: 1px;
}
.lib-ext { font-size: 0.85em; color: #8a7262; }
.lib-group { border-top: 1px solid rgba(44, 34, 26, 0.08); }
.lib-group:first-child { border-top: none; }
.lib-group > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.42rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8a3414;
  cursor: pointer;
  list-style: none;
  border-radius: 0.35rem;
}
.lib-group > summary::-webkit-details-marker { display: none; }
.lib-group > summary::after { content: "▸"; margin-left: 0.5rem; opacity: 0.65; }
.lib-group[open] > summary::after { content: "▾"; }
.lib-group > summary:hover,
.lib-group[open] > summary { background: rgba(181, 69, 29, 0.06); }
.lib-up { display: none; }
.lib-bar a:focus-visible,
.lib-bar summary:focus-visible {
  outline: 2px solid var(--pillar, #b5451d);
  outline-offset: 2px;
}
.lib-bar > .atlas-bar-tools { margin-left: auto; }

html[data-theme="dark"] .lib-bar { color: #d7c4b4; }
html[data-theme="dark"] .lib-crumb + .lib-crumb::before { color: rgba(243, 230, 212, 0.4); }
html[data-theme="dark"] .lib-crumb > a,
html[data-theme="dark"] .lib-menu > summary { color: #f0a070; }
html[data-theme="dark"] .lib-crumb > a[aria-current="page"] { color: var(--site-ink); }
html[data-theme="dark"] .lib-menu > summary:hover,
html[data-theme="dark"] .lib-menu[open] > summary { background: #3d2f24; color: #f6d56a; }
html[data-theme="dark"] .lib-here > .lib-menu > summary,
html[data-theme="dark"] .lib-authors > .lib-menu > summary { background: var(--site-panel); border-color: rgba(243, 230, 212, 0.22); }
html[data-theme="dark"] .lib-panel {
  background: #241c16;
  border-color: var(--site-line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .lib-panel a { color: var(--site-ink); }
html[data-theme="dark"] .lib-panel a:hover { background: rgba(224, 112, 64, 0.16); color: #ffb888; }
html[data-theme="dark"] .lib-panel a[aria-current="page"] { background: #3d2b20; color: #f0a070; box-shadow: inset 3px 0 0 #e07043; }
html[data-theme="dark"] .lib-panel a.lib-sub::before { color: var(--site-accent); }
html[data-theme="dark"] .lib-filter-wrap {
  background: #241c16;
  border-bottom-color: var(--site-line);
}
html[data-theme="dark"] .lib-filter {
  background: var(--site-bg);
  color: var(--site-ink);
  border-color: var(--site-line);
}
html[data-theme="dark"] .lib-filter::placeholder { color: var(--site-muted); }
html[data-theme="dark"] .lib-group { border-top-color: rgba(243, 230, 212, 0.1); }
html[data-theme="dark"] .lib-group > summary { color: #f0a070; }
html[data-theme="dark"] .lib-group > summary:hover,
html[data-theme="dark"] .lib-group[open] > summary { background: rgba(224, 112, 64, 0.14); }

/* On a phone the bar shows the last two steps, with ‹ to the step above, and
   an open menu is a full-width sheet under the bar with links big enough to tap. */
@media (max-width: 640px) {
  .lib-bar { padding: 0.35rem 0.65rem 0.3rem; font-size: 0.88rem; }
  .lib-crumb.lib-far { display: none; }
  .lib-up {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #b5451d;
  }
  .lib-crumb { position: static; }
  .lib-far + .lib-crumb:not(.lib-far)::before { content: none; }
  .lib-crumb > a,
  .lib-solo > summary { max-width: 11rem; }
  .lib-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 0;
    max-width: none;
    max-height: 72vh;
    border-radius: 0 0 0.65rem 0.65rem;
  }
  .lib-here .lib-panel { left: 0; right: 0; }
  .lib-panel a,
  .lib-group > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    box-sizing: border-box;
  }
  .lib-bar > .atlas-bar-tools { margin-left: auto; }
  html[data-theme="dark"] .lib-up { color: #f0a070; }
}

/* Universal Bar Utility Tools (Search, Light/Dark, Language) */
html[data-shelf] .atlas-bar-tools,
.atlas-bar-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex: 0 0 auto;
}
html[data-shelf] .atlas-find,
html[data-shelf] .atlas-theme,
.atlas-find,
.atlas-theme {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #5c4636;
  background: #fffaf3;
  border: 1px solid rgba(44, 34, 26, 0.24);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.25;
  flex: 0 0 auto;
}
html[data-shelf] .atlas-find:hover,
html[data-shelf] .atlas-theme:hover,
.atlas-find:hover,
.atlas-theme:hover {
  border-color: #b5451d;
  color: #b5451d;
}
html[data-shelf] .atlas-find-kbd,
.atlas-find-kbd {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.08rem 0.32rem;
  border-radius: 4px;
  background: rgba(44, 34, 26, 0.08);
  border: 1px solid rgba(44, 34, 26, 0.18);
  color: #7b6452;
}
html[data-theme="dark"][data-shelf] .atlas-find,
html[data-theme="dark"][data-shelf] .atlas-theme,
html[data-theme="dark"] .atlas-find,
html[data-theme="dark"] .atlas-theme {
  background: var(--site-panel);
  color: var(--site-ink);
  border-color: var(--site-line);
}
html[data-theme="dark"][data-shelf] .atlas-find:hover,
html[data-theme="dark"][data-shelf] .atlas-theme:hover,
html[data-theme="dark"] .atlas-find:hover,
html[data-theme="dark"] .atlas-theme:hover {
  border-color: #f0a070;
  color: #f0a070;
}
html[data-theme="dark"][data-shelf] .atlas-find-kbd,
html[data-theme="dark"] .atlas-find-kbd {
  background: rgba(243, 230, 212, 0.1);
  border-color: rgba(243, 230, 212, 0.2);
  color: #d7c4b4;
}

@media (max-width: 720px) {
  .atlas-find-kbd,
  .atlas-find .atlas-find-label,
  .atlas-theme .atlas-theme-label {
    display: none;
  }
}

.atlas-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}
.atlas-search-head h2 {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0;
  color: #8b2500;
}
.atlas-search-head .atlas-close {
  background: transparent;
  border: 1px solid rgba(44, 34, 26, 0.2);
  border-radius: 6px;
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #5c4636;
}
.atlas-search-head .atlas-close:hover {
  background: rgba(44, 34, 26, 0.08);
}
.atlas-results a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 0.4rem;
  text-decoration: none;
  color: inherit;
}
.atlas-results a:hover,
.atlas-results a[aria-selected="true"] {
  background: var(--pillar-soft, rgba(181, 69, 29, 0.12));
}
.atlas-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
}
.atlas-empty-result {
  padding: 1.25rem 0.5rem;
  text-align: center;
  font-style: italic;
  color: #7b6452;
}
html[data-theme="dark"] .atlas-search-head h2 {
  color: #f0a070;
}
html[data-theme="dark"] .atlas-search-head .atlas-close {
  border-color: rgba(243, 230, 212, 0.2);
  color: var(--site-ink);
}
html[data-theme="dark"] .atlas-search-head .atlas-close:hover {
  background: rgba(243, 230, 212, 0.1);
}
html[data-theme="dark"] .atlas-results a:hover,
html[data-theme="dark"] .atlas-results a[aria-selected="true"] {
  background: rgba(240, 160, 112, 0.18);
}
html[data-theme="dark"] .atlas-empty-result {
  color: #a89484;
}

/* Household stories: the six doors sit in one dropdown pill, the sections of
   that page sit in the next dropdown pill, then English / नेपाली. */
/* Universal Language Switcher across all shelves */
html[data-shelf] .lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}
html[data-shelf] .lang-switch button {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #5c4636;
  background: #fffaf3;
  border: 1px solid rgba(44, 34, 26, 0.24);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.25;
}
html[data-shelf] .lang-switch button:hover {
  border-color: #b5451d;
  color: #b5451d;
}
html[data-shelf] .lang-switch button[aria-pressed="true"] {
  color: #8a3414;
  background: #ead9bf;
  border-color: #ead9bf;
  font-weight: 750;
}
html[data-shelf] .lang-switch button:focus-visible {
  outline: 2px solid #b5451d;
  outline-offset: 2px;
}
html[data-shelf] .katha-lang-label { display: none; }

/* Universal text display toggles across all doors */
html[data-lang="ne"] .lang-en { display: none !important; }

html:not([data-lang="ne"]) .lang-ne { display: none !important; }

/* Universal Plate figcaptions toggle */
html[data-lang="ne"] figure.plate figcaption .lang-en { display: none !important; }

html:not([data-lang="ne"]) figure.plate figcaption .lang-ne { display: none !important; }
html:not([data-lang="ne"]) figure.plate figcaption .deva { display: none !important; }
html[data-lang="ne"] figure.plate figcaption .deva {
  display: block;
  margin-top: 0;
  font-size: 1rem;
}
html[data-shelf="katha"] .door-group { margin: 1.8rem 0 0.4rem; }
html[data-shelf="katha"] .door-part { margin-top: 1.4rem; }
html[data-shelf="katha"] .year-stories > article.door-part {
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(181, 69, 29, 0.22);
}
html[data-shelf="katha"] .year-list {
  list-style: none;
  margin: 0.4rem 0 1.4rem;
  padding: 0;
}
html[data-shelf="katha"] .year-list > li {
  margin: 0;
  border-top: 1px solid rgba(181, 69, 29, 0.18);
}
html[data-shelf="katha"] .year-list > li:last-child {
  border-bottom: 1px solid rgba(181, 69, 29, 0.18);
}
html[data-shelf="katha"] .year-list > li > a {
  display: inline-block;
  margin: 0.7rem 0;
  font-weight: 650;
}
html[data-shelf="katha"] .year-list > li > p {
  margin: 0 0 0.85rem;
}
html[data-shelf="katha"] .door-part,
html[data-shelf="katha"] .door-group,
html[data-shelf="katha"] .door-part h1[id],
html[data-shelf="katha"] .door-part h2[id],
html[data-shelf="katha"] .door-part h3[id] { scroll-margin-top: 5.5rem; }
html[data-theme="dark"][data-shelf] .lang-switch button {
  background: var(--site-panel);
  color: var(--site-ink);
  border-color: var(--site-line);
}
html[data-theme="dark"][data-shelf] .lang-switch button:hover {
  border-color: #f0a070;
  color: #f0a070;
}
html[data-theme="dark"][data-shelf] .lang-switch button[aria-pressed="true"] {
  background: #4a3324;
  color: #fff2e2;
  border-color: #f0a070;
}

html[data-shelf="hindu"][data-lang="ne"] .lang-en { display: none !important; }
html[data-shelf="hindu"]:not([data-lang="ne"]) .lang-ne { display: none !important; }

.site-footer {
  margin-top: 2.5rem;
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid var(--site-line);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--site-muted);
}
.site-footer a {
  color: var(--site-accent);
  text-decoration: none;
  font-weight: 600;
}
.site-footer a:hover {
  color: var(--site-accent-hover);
  text-decoration: underline;
}
