/* Minimalist CSS inspired by Medium, compatible with WordPress */

@font-face {
  font-family: "AdiShila";
  src: url("https://adishila.com/wp-content/uploads/2020/05/Adishila.ttf") format("truetype");
} 


html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}
body {
  font-family: 'AdiShila';
  font-size: 25px;
  line-height: 1.6;
  color: #333;
  background-color: #f7f7f7;
  margin: 0;
  padding: 0;
  padding-left: clamp(48px, 5vw, 80px);
  padding-right: 340px;
}


.Mula, .Sarvamula, .pramana, .padya, .Colophon_Mula, .Colophon_Sarvamula {
  margin-bottom: 0.5em;
}

.Mula, .Sarvamula, .Colophon_Mula, .Colophon_Sarvamula{
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.Mula {
    font-size: 30px;
    font-weight: bold;
}

.padya p {
  margin: 0 0 1em;
  text-align: justify;
  line-height:1.2;
 }

.padya {
  margin-bottom: 0.25em;
  margin-top: 0.5em;
}

span.padya {
  display: inline !important;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  color: var(--color-text, #333);
  visibility: visible;
  font-family: 'AdiShila', 'Segoe UI', Arial, sans-serif;
}

span.padya::before {
  content: "";
  display: block;
}

.block-container > span.padya:first-of-type::before,
.block-container > .padya:first-of-type::before,
.block-container > .pramana:first-child > .padya:first-of-type::before,
.block-container > .block-tools + span.padya::before,
.block-container > .block-tools + .padya::before,
.block-container > .block-tools + .pramana > .padya:first-of-type::before {
  display: none !important;
}

/* Add dots via CSS if content is minimal (likely stripped by WordPress) */
.padya span[id]:empty::before {
  content: '… … …';
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #333;
  display: inline;
}

/* New line within same block */
br.new-line {
  display: block;
  content: "";
  margin-top: 0.35em;
}

/* Hierarchical styles for Heading1 to Heading6 */
.Heading1, .Heading0 {
  font-size: 1.5em;
  font-weight: bold;
  color: #1a237e;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  border-bottom: 2px solid #3949ab;
  padding-bottom: 0.2em;
}

.Heading2 {
  font-size: 1.3em;
  font-weight: bold;
  color: #283593;
  margin-top: 1em;
  margin-bottom: 0.4em;
  /*padding-left: 16px;*/
  border-left: 4px solid #5c6bc0;
}

.Heading3 {
  font-size: 1.2em;
  font-weight: bold;
  color: #3949ab;
  margin-top: 0.8em;
  margin-bottom: 0.3em;
  /*padding-left: 32px;*/
  border-left: 3px solid #7986cb;
}

.Heading4 {
  font-size: 1.1em;
  font-weight: bold;
  color: #5c6bc0;
  margin-top: 0.7em;
  margin-bottom: 0.2em;
  /*padding-left: 48px;*/
  border-left: 2px solid #9fa8da;
}

.Heading5 {
  font-size: 1em;
  font-weight: bold;
  color: #7986cb;
  margin-top: 0.6em;
  margin-bottom: 0.2em;
  /*padding-left: 64px;*/
  border-left: 2px dotted #c5cae9;
}

.Heading6 {
  font-size: 0.9em;
  font-weight: bold;
  color: #9fa8da;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
  /*padding-left: 80px;*/
  border-left: 1px dotted #e8eaf6;
}

.Subheading {
  font-size: 1.0em !important;           /* Much smaller font */
  font-weight: normal;                   /* Not bold, adjust if needed */
  color: #3949ab;                        /* Subtle color if you wish */
  position: relative;
  margin-bottom: 0.5em;                /* Space below the subheading */
  padding-left: 40px;                   /* Indentation for the subheading */
}

.Subheading::before {
    content: '(';           
}

.Subheading::after {
    content: ')';           
}
/* BhashyaHeading styles inherit all properties from Heading2 to Heading6, except color */

.BhashyaHeading1 {
  /* All styles from .Heading2 */
  font-size: 1.3em;
  font-weight: bold;
  margin-top: 1em;
  margin-bottom: 0.4em;
  padding-left: 16px;
  border-left: 4px solid #5c6bc0;
  color: #424242; /* Changed color */
}

.BhashyaHeading2 {
  /* All styles from .Heading3 */
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 0.8em;
  margin-bottom: 0.3em;
  padding-left: 32px;
  border-left: 3px solid #7986cb;
  color: #616161 /* Changed color */
}

.BhashyaHeading3 {
  /* All styles from .Heading4 */
  font-size: 0.9em;
  font-weight: bold;
  margin-top: 0.7em;
  margin-bottom: 0.2em;
  padding-left: 48px;
  border-left: 2px solid #9fa8da;
  color: #757575; /* Changed color */
}

.BhashyaHeading4 {
  /* All styles from .Heading5 */
  font-size: 0.8em;
  font-weight: bold;
  margin-top: 0.6em;
  margin-bottom: 0.2em;
  padding-left: 64px;
  border-left: 2px dotted #c5cae9;
  color: #9e9e9e; /* Changed color */
}

.BhashyaHeading5 {
  /* All styles from .Heading6 */
  font-size: 0.7em;
  font-weight: bold;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
  padding-left: 80px;
  border-left: 1px dotted #e8eaf6;
  font-style: italic;
  color: #bdbdbd; /* Changed color */
}

.BhashyaHeading6 {
  /* All styles from .Heading6 (same as above, but different color) */
  font-size: 0.6em;
  font-weight: bold;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
  padding-left: 80px;
  border-left: 1px dotted #e8eaf6;
  font-style: italic;
  color: #e0e0e0; /* Changed color

p {
  margin: 0 0 1em;
  /*font-size: 18px;*/
  /*color: #2c3e50;*/
}

.Sarvamula, .Colophon_Sarvamula {
  border-left: 4px solid #3498db;
  padding-left: 16px;
  /*padding-top: 0px;*/
}

.pramana,
.pramana .padya,
.pramana span.padya,
.pramana .inline,
.pramana span:not(.kutra):not(.pathantara):not(.pathantara-ref):not(.pramana-actual) {
  font-style: italic;
  color: #1d4ed8 !important;
}

.pramana-actual,
.pramana .pramana-actual {
  display: none !important;
}

.pramana {
  display: inline;
  align-items: baseline;
}

.pramana-inline {
  color: #1d4ed8 !important;
  display: inline !important;
  align-items: baseline;
}

.Mula, .Colophon_Mula{
  border-left: 4px solid #2ecc71;
  padding-left: 16px;
}

a {
  color: #3498db;
  text-decoration: none;
  border-bottom: 1px solid #3498db;
}

a:hover {
  color: #2c3e50;
  border-bottom: 1px solid #2c3e50;
}

blockquote {
  font-style: italic;
  color: #7f8c8d;
  padding: 10px 20px;
  margin: 20px 0;
  border-left: 4px solid #bdc3c7;
  background: #ecf0f1;
}

code {
  font-family: 'Courier New', Courier, monospace;
  background: #f7f7f7;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 90%;
}

ul, ol {
  margin: 20px;
  padding: 0 20px;
}

li {
  margin-bottom: 10px;
}




.kutra {
    margin-left: 8px; /* Adds some spacing between the text and the kutra element */
    /*vertical-align: super;  Aligns it with the middle of the text */
    font-style: italic; /* Optional styling for better aesthetics */
    color: #333; /* Adjust text color to suit your design */
    font-size: 16px;
    color:blue;
    display: inline;
    align-items: center;
    white-space: nowrap;

}


/* Make last span of last padya inline with .kutra */
.pramana > .padya:last-of-type span:last-of-type {
  display: inline;
  margin-right: 0.5em;
}

.kutra::before {
  content: "(";
  margin-right: 2px;
}

.kutra::after {
  content: ")";
  margin-left: 2px;
  white-space: pre;
}

.pratika {
  font-weight: bold;
}

.footnote-ref, .pathantara-ref {
  display: inline-block;
  font-size: 0.75em;
  line-height: 1;
  vertical-align: super;
  cursor: pointer;
  color: #1a5276;
  font-weight: 600;
  padding: 1px 3px;
  margin: 0 1px;
  border-radius: 3px;
  background: rgba(26, 82, 118, 0.08);
  text-decoration: none !important;
  transition: all 0.15s ease-in-out;
}

.footnote-ref:hover, .pathantara-ref:hover {
  background: #1a5276;
  color: #ffffff !important;
  transform: scale(1.08);
}

.pathantara-ref {
  color: #8b6914;
  background: rgba(200, 169, 110, 0.18);
}

.pathantara-ref:hover {
  background: #8b6914;
  color: #ffffff !important;
}

/* ── Footnote & Pathantara Popover ── */
.footnote-popover {
  position: absolute;
  z-index: 2000;
  max-width: 380px;
  width: max-content;
  min-width: 240px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 10px 14px 12px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: #1e293b;
  animation: fnFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.footnote-popover.hidden {
  display: none !important;
}

@keyframes fnFadeIn {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.footnote-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e8f0;
}

.footnote-popover-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.footnote-popover.is-pathantara .footnote-popover-title {
  color: #8b6914;
}

.footnote-popover.is-footnote .footnote-popover-title {
  color: #1a5276;
}

.footnote-popover-close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.footnote-popover-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.footnote-popover-body {
  font-size: 14px;
  color: #1e293b;
  word-break: break-word;
}

@media (max-width: 600px) {
  .footnote-popover {
    position: fixed !important;
    top: auto !important;
    bottom: 16px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    border-radius: 12px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.22);
    z-index: 2500;
  }
}

.footnotes-container {
  margin-top: 3rem;
  border-top: 1px solid #ccc;
  font-size: 0.9em;
}

.footnotes-container ol {
  padding-left: 1.5rem;
}


.document-status {
  text-align: center;
  font-weight: bold;  
  padding: 0.75rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: white;
  border-radius: 6px;
}

/* Stage-specific colors */
.document-status.draft {
  background-color: #f39c12;
}

.document-status.review {
  background-color: #3498db;
}

.document-status.final {
  background-color: #27ae60;
}


/* Make the final text node (e.g., इति ब्रह्माण्डे।) inline too */
.Sarvamula::after {
  display: inline;
  margin-left: 6px;
  font-style: normal;
  color: #333;
}

.closing {
  display: inline !important;
  margin-left: 4px;
  color:black;
  font-style: normal;
}


span.pathantara {
    display: inline;
}

span.kutra {
    display: inline;
    color: #475569 !important;
    font-style: normal !important;
    font-size: 0.85em;
    margin-left: 6px;
    font-weight: 500;
}

span.inline-padya,
span.inline,
.inline {
    display: inline !important;
    margin-left: 2px;
    margin-right: 2px;
}

span.pramana {
    display: inline;
}

.toc-right {
  position: fixed;
  top: 100px;
  right: 12px;
  width: 320px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 14px 14px 10px 14px;
  font-size: 14px;
  color: #1e293b;
  z-index: 1100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease-in-out;
}

#toc-content {
  position: relative;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
}

#toc-content strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.toc-right.minimized {
  display: none;
}

#toc-float-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #007acc;
  color: #007acc;
  font-size: 1.6em;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

#toc-float-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(0,122,204,0.3);
}

.toc-right ul {
  list-style: none;
  padding-left: 14px;
  margin: 0;
}

.toc-right > #toc-content > ul {
  padding-left: 0;
}

.toc-right li {
  margin: 3px 0;
  line-height: 1.35;
  white-space: normal;
}

.toc-right a {
  text-decoration: none !important;
  color: #1a5276 !important;
  transition: background 0.15s, color 0.15s;
  padding: 2px 5px;
  border-radius: 4px;
  display: inline;
  word-break: break-word;
  font-size: 13.5px;
  opacity: 1 !important;
  visibility: visible !important;
}

.toc-right a:hover {
  background: #f0f7ff;
  color: #0b5394 !important;
}

.toc-right a.active {
  background: #e3f2fd;
  color: #0d47a1 !important;
  font-weight: bold;
}

.toc-toggle-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  width: 16px;
  height: 16px;
  padding: 0;
  margin-right: 4px;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.toc-toggle-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

#toc-toggle {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 1101;
  background: #ffffff;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
}

#toc-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}
@media (max-width: 800px) {
  body {
    padding-right: 20px;
    padding-left: 20px;
    font-family: 'AdiShila', sans-serif;
    font-size: 20px;
  }
  .Mula {
    font-size: 26px;
  }
  .Heading1, .Heading0 {
    font-size: 1.4em;
  }
  .Heading2 {
    font-size: 1.25em;
  }
  .Heading3 {
    font-size: 1.15em;
  }
  .Heading4 {
    font-size: 1.1em;
  }
  .Heading5 {
    font-size: 1.05em;
  }
  .Heading6 {
    font-size: 1em;
  }
  .BhashyaHeading1 {
    font-size: 1.2em;
  }
  .BhashyaHeading2 {
    font-size: 1.1em;
  }
  .BhashyaHeading3 {
    font-size: 1em;
  }
  .BhashyaHeading4 {
    font-size: 0.95em;
  }
  .BhashyaHeading5 {
    font-size: 0.9em;
  }
  .BhashyaHeading6 {
    font-size: 0.85em;
  }
  .toc-right {
    width: 95vw;
    left: 2.5vw;
    right: unset;
    top: auto;
    bottom: 20px;
    border-radius: 8px 8px 0 0;
    padding: 12px 12px 6px 12px;
    font-size: 16px;
    max-height: 60vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  #toc-content {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
  }
  #toc-float-toggle {
    bottom: 20px;
    right: 20px;
  }
}
@media (max-width: 500px) {
  body {
    padding-right: 16px;
    padding-left: 16px;
    font-family: 'AdiShila', sans-serif;
    font-size: 18px;
  }
  .Mula, .Sarvamula, .Colophon_Mula, .Colophon_Sarvamula {
    padding: 14px 16px;
  }
  .Mula {
    font-size: 24px;
  }
  .Heading1, .Heading0 {
    font-size: 1.3em;
  }
  .Heading2 {
    font-size: 1.2em;
  }
  .Heading3 {
    font-size: 1.15em;
  }
  .Heading4 {
    font-size: 1.1em;
  }
  .Heading5 {
    font-size: 1.05em;
  }
  .Heading6 {
    font-size: 1em;
  }
  .BhashyaHeading1 {
    font-size: 1.15em;
  }
  .BhashyaHeading2 {
    font-size: 1.05em;
  }
  .BhashyaHeading3 {
    font-size: 0.95em;
  }
  .BhashyaHeading4 {
    font-size: 0.9em;
  }
  .BhashyaHeading5 {
    font-size: 0.85em;
  }
  .BhashyaHeading6 {
    font-size: 0.8em;
  }
  .toc-right {
    width: 100vw;
    left: 0;
    right: unset;
    bottom: 0;
    border-radius: 8px 8px 0 0;
    padding: 10px 8px 4px 8px;
    font-size: 14px;
    max-height: 50vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  #toc-content {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
  }
}

@media (max-width: 380px) {
  body {
    padding-right: 12px;
    padding-left: 12px;
  }
  .Mula, .Sarvamula, .Colophon_Mula, .Colophon_Sarvamula {
    padding: 12px 12px;
  }
}


.padya span.kutra {
  display: inline !important;
  vertical-align: baseline;
  margin-left: 8px;
  font-style: italic;
  color: #555;
  white-space: nowrap;
}

.padya span.kutra::before {
  content: "(";
  margin-right: 2px;
}

.padya span.kutra::after {
  content: ")";
  margin-left: 2px;
}

/*.padya span:last-of-type:not(.kutra) {
  display: contents !important;
}*/

.inline {
  display: inline !important;
}

/* Apply these styles to all your numbered heading classes */
.Heading1,
.Heading2,
.Heading3,
.Heading4,
.Heading5,
.Heading6,
.Heading7 {
    /* Ensure the heading itself contains the floated elements correctly */
    overflow: hidden; /* Creates a new Block Formatting Context */
    /* You might want to remove/adjust default browser margins for h-tags */
    margin-top: 0.83em;
    margin-bottom: 0.83em;
    padding-left: 20px; /* Ensure no extra padding pushes text right */
    text-indent: 0; /* Ensure no existing text-indent interferes */
}



/* The numbering part (e.g., "1.1.") */
.heading-prefix {
    float: left;         /* Floats the number to the left */
    white-space: nowrap; /* Prevents the number itself from wrapping */
    margin-right: 0.5em; /* Creates space between the number and the main text */
    /* Adjust margin-right to fine-tune the gap */
}

/* The main text content (e.g., "Narayanasya sadaya") */
.heading-text {
    /* This element will automatically flow around the floated .heading-prefix.
       Its lines will start after the prefix on the first line,
       and then subsequent lines will start at the element's own left edge,
       which achieves the desired alignment under "Narayanasya". */
    /*display: block;*/ /* Ensure it behaves as a block element for wrapping */
    /* No need for text-indent/padding-left here for this specific effect */
}

.rev_reference {
  display: list-item;
  font-size: 0.85em;
  color: #555;
  margin-left: 2em;
  margin-top: 0.2em;
}
.rev_reference a {
  display: inline-block;
  margin-right: 0.5em;
}
.rev_reference-number {
  font-weight: bold;
  margin-right: 0.3em;
  color: #888;
}

.pramana-inline span {
    display: contents;
}
.toggle-headings-btn {
    display: block;
    width: 100%;
    padding: 8px 0;
    margin-bottom: 12px;
    background-color: #1976d2;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: normal;
    cursor: pointer;
    transition: background 0.2s;
    position: sticky;
    top: 0;
    z-index: 10;
}

.toggle-headings-btn:hover,
.toggle-headings-btn:focus {
    background-color: #1565c0;
    outline: none;
}

.patha-toggle-container {
    margin: 16px 0 8px 0;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 50px;
    background: #f9f9f9;
    z-index: 9;
}

/* Footer Controls */
.footer-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 12px 20px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

.footer-controls-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-right: 8px;
}

.footer-dropdown {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.footer-dropdown:hover {
    border-color: #999;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.footer-dropdown:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

/* Adjust body padding to account for footer */
body {
    padding-bottom: 70px;
}

/* Hide Aksharamukha navbar */
#aksharamukha-navbar {
    display: none !important;
}

.devanagari {
     font-family: 'AdiShila', 'Segoe UI', Arial, sans-serif;
   
}

/* Mobile responsive footer */
@media (max-width: 768px) {
    .footer-controls {
        padding: 12px 16px;
    }
    
    .footer-controls-container {
        gap: 16px;
        flex-wrap: wrap;
    }
    
    .footer-label {
        font-size: 13px;
        margin-right: 6px;
    }
    
    .footer-dropdown {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    body {
        padding-bottom: 75px;
    }
}

/* Smaller tablets and phones */
@media (max-width: 600px) {
    .footer-controls {
        padding: 10px 10px;
    }
    
    .footer-controls-container {
        gap: 8px;
        justify-content: space-between;
    }
    
    .footer-label {
        display: none;
    }
    
    .footer-dropdown {
        padding: 5px 8px;
        font-size: 12px;
        flex: 1;
        min-width: 0;
    }
    
    body {
        padding-bottom: 65px;
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    .footer-controls {
        padding: 8px 8px;
    }
    
    .footer-controls-container {
        gap: 4px;
    }
    
    .footer-dropdown {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    body {
        padding-bottom: 60px;
    }
}

/* Block Tools (Corner Copy Link & Actions) */
.block-container {
    position: relative;
}
.block-tools {
    position: absolute;
    top: 2px;
    right: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    z-index: 10;
    pointer-events: none;
}
.block-container:hover > .block-tools,
.block-container:hover .block-tools {
    opacity: 0.6;
}
.block-tools:hover {
    opacity: 1 !important;
}
.block-tools > span {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    cursor: pointer;
    padding: 0;
    font-size: 11px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #4b5563;
    font-family: sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
    user-select: none;
}
.block-tools > span:hover {
    background: #ffffff;
    border-color: #9ca3af;
    color: #8b6914;
    transform: scale(1.08);
}
.block-container.collapsed > *:not(.heading-number):not(.heading-text):not(.block-tools) {
    display: none !important;
}

/* Ensure Devanagari text uses the AdiShila font */
.devanagari {
    font-family: "AdiShila" !important;
}

/* ==========================================================================
   Google Scholar-Style Reverse References (Citations)
   ========================================================================== */

.st-citation-wrapper {
    display: inline-flex;
    align-items: center;
    margin: 0 4px;
    vertical-align: middle;
}

.st-citation-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 2px 8px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #3730a3;
    cursor: pointer;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: baseline;
    user-select: none;
}

.st-citation-badge:hover {
    background: #e0e7ff;
    border-color: #818cf8;
    color: #1e1b4b;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(55, 48, 163, 0.15);
}

.st-cite-icon {
    font-size: 12px;
    line-height: 1;
}

.st-cite-label {
    font-size: 11px;
    font-family: 'Noto Serif Devanagari', 'AdiShila', serif;
}

.st-cite-sep {
    font-size: 11px;
    font-weight: bold;
    color: #6366f1;
    margin: 0 1px;
}

.st-cite-count {
    background: #4f46e5;
    color: #ffffff;
    border-radius: 10px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
}

/* ── Scholar Citations Modal & Drawer ─────────────────────────────────────── */
.st-citation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.st-citation-modal-overlay.st-open {
    opacity: 1;
    visibility: visible;
}

.st-citation-drawer {
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-14px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', system-ui, sans-serif;
}

.st-citation-modal-overlay.st-open .st-citation-drawer {
    transform: translateY(0) scale(1);
}

.st-citation-drawer-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.st-citation-drawer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.st-cite-header-icon {
    font-size: 18px;
}

.st-cite-close-btn {
    background: #e2e8f0;
    border: none;
    color: #475569;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.st-cite-close-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.st-citation-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.st-citation-cards-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.st-citation-card {
    background: #fdfcf9;
    border: 1px solid #e2ded5;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.15s ease;
}

.st-citation-card:hover {
    border-color: #3730a3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

.st-citation-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.st-citation-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.st-cite-badge-work {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Noto Serif Devanagari', 'AdiShila', serif;
}

.st-cite-badge-kutra {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Noto Serif Devanagari', serif;
}

.st-cite-badge-source {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Noto Serif Devanagari', serif;
}

.st-cite-copy-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.st-cite-copy-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.st-citation-snippet {
    font-family: 'Noto Serif Devanagari', 'AdiShila', serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1e293b;
    background: #faf8f5;
    border-left: 3px solid #6366f1;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
}

.st-citation-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.st-citation-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4338ca;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.st-citation-link-btn:hover {
    background: #eef2ff;
    color: #312e81;
}

.st-cite-arrow {
    transition: transform 0.15s ease;
}

.st-citation-link-btn:hover .st-cite-arrow {
    transform: translateX(3px);
}

.st-citation-drawer-footer {
    padding: 10px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
}

.st-citation-drawer-footer kbd {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
}

/* ── Hide subheadings when 'Show top level headers' selected ── */
body.st-hide-subheadings [class*="Heading"]:not(.Heading0):not(.Heading1) {
    display: none !important;
}