/*  mitthesis-style.css

    v1.25, 2026-11-20
	Author: John H. Lienhard
	License: MIT License, https://ctan.org/license/mit
    This css code styles the HTML rendering of the mitthesis class
*/

/* --- Resilience & typography --- */

*, *::before, *::after { box-sizing: border-box; }
math, math * { box-sizing: content-box; }

html 
	{ 
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: none;
    text-size-adjust: 100%;
	}
:root
	{
	color-scheme: light dark;
	--ui-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "DejaVu Sans", Arial, sans-serif;
	--ui-mono: ui-monospace, SFMono-Regular, Consolas, "DejaVu Sans Mono", "Liberation Mono", "Noto Sans Mono", Menlo, monospace;
	--math-font: "STIX Two Math", "Latin Modern Math", "XITS Math", "Cambria Math", math;
    --math-fallback-bold:    var(--math-font); 
	--code-color:         #3333b3;   /* sometimes called 'structure' */
	--footnote-color:     #1f4e79;   /* a medium grayish blue */
	--fg-color:           #111;      
	--bg-color:           #fff;
	--hr-color:           #b3b3b3;
	--link-color:         #0033a0;   /* #0000ee, browser defaults */
	--link-visited-color: #663366;   /* #551a8b */
	--link-hover-color:   #0b0080;   /* #ee0000 */
	--xref-color:         #00626b;   
	--xref-visited-color: #6b4e16;
	--table-rule:         #767676;   /* midrule, light mode */
	--table-rule-strong:  #404040;   /* toprule, bottomrule, light mode */
	}

/* These settings partially mimic the default printed page size and width. Aims for sans serif font. */
body {
    font-family:    var(--ui-sans);
	font-size: 		12pt;       
	line-height: 	1.2;     	/* ~14pt leading */
	margin: 		36pt auto;
	padding-inline: 1em;
	max-width: 		calc(75ch + 2em);       /* ~75 characters per line */
	hyphens: 		auto;
	overflow-wrap: 	anywhere; 				/* protect narrow columns */
	hanging-punctuation: first allow-end; 	/* improve ragged-right when present */
	color:          var(--fg-color); 
	background:     var(--bg-color);
	}

hr { 
    border-color: var(--hr-color);
    border-style: solid
   }

a[href]                 { color: var(--link-color); text-decoration: underline; }
a[href]:visited         { color: var(--link-visited-color); }
a[href^="#"]            { color: var(--xref-color); }
a[href^="#"]:visited    { color: var(--xref-visited-color); }
a[href]:hover,
   a[href]:focus        { color: var(--link-hover-color); }

/* prevent hanging-punctuation from reaching MathML operators (Safari) */
math, math * 
    {
    hanging-punctuation: none;
    }


/* Adjust fonts of title on title page, prevent hyphenation */

/* div[data-pdf-se-type="Title"] */
h1[data-pdf-se-type-original="Thesis_title"]
	{
	font-size: 20pt;
	font-weight: 700;
	text-align: center;
	hyphens: none;
	overflow-wrap: normal;
	margin-top: 2em; 
	}

/* div[data-pdf-se-type-original="Author"] span */
/* Author's name is wrapped in an unnamed span */
section[data-pdf-se-type-original="Author"] span
	{
	font-size: 14pt;
	}

/* div[data-pdf-se-type-original="Author"] */
section[data-pdf-se-type-original="Author"]
	{
	margin-bottom: 2em;
	}
   
section[data-pdf-se-type-original="Degree"],
    section[data-pdf-se-type-original="Copyright"]
	{
	margin-top: 1em;
	}  
/* Title_sig_block is addressed with presentation tables, below */


/* Adjust fonts and space of committee page */

section[data-pdf-se-type-original="Committee_page"]
	{
	margin-top: 4em;
	}  

/* span[data-pdf-se-type-original="Committee_name"] */
h1[data-pdf-se-type-original="Committee_name"]
	{
	font-size: 18pt;
	font-weight: 700;
	margin-top: 4em;
	hyphens: none;
	overflow-wrap: normal;
	}

section[data-pdf-se-type-original="Committee_supervisors"],
    section[data-pdf-se-type-original="Committee_readers"]
    {
    }
    
/* For "Thesis Supervisor" and "Thesis Readers" */
/* span[data-pdf-se-type-original="Committee_block_title"] */
h2[data-pdf-se-type-original="Committee_block_title"]
	{
	font-size: 14pt;
	font-weight: 500; /* medium */
	hyphens: none;
	overflow-wrap: normal;
	display: inline-block;
	margin-top: 1.3em;
	margin-bottom: 0.3em;
	font-variant: small-caps;
	}


/* Adjust fonts and space of abstract page */

section[data-pdf-se-type-original="Abstract_page"]
	{
	margin-top: 5em; 
	}  

/* div[data-pdf-se-type-original="Abstract_title"] */
h1[data-pdf-se-type-original="Abstract_title"]
	{
	font-size: 18pt;
	font-weight: 700;
    text-align: center;
	hyphens: none;
	overflow-wrap: normal;
	}
section[data-pdf-se-type-original="Abstract_info"]
    {
    }

h2[data-pdf-se-type-original="Abstract_heading"]
	{
	font-size: 14pt;
	font-weight: 700;
	}
    
/* div[data-pdf-se-type-original="Abstract_text"] */
section[data-pdf-se-type-original="Abstract_text"]
	{
	}

/* div[data-pdf-se-type-original="Abstract_supervisor"] */ 
section[data-pdf-se-type-original="Abstract_supervisor"]
	{
	margin-top: 1em; 
	}
/* div[data-pdf-se-type-original="Abstract_supervisor"] p  */
section[data-pdf-se-type-original="Abstract_supervisor"] p 
	{
	margin-top: 	0.2em;
	margin-bottom: 	0.2em;
	}


/* Headings */

/* Heading font weights */

h1,h2,h3,h4
	{
	font-weight: 700; /* matches UA default */
	}

/* Heading sizes */

h1 { font-size: 20pt; }
h2 { font-size: 18pt; }
h3 { font-size: 16pt; }
h4, h5, h6 
   { font-size: 12pt; }

/* Increase vertical space above headings */

h1 { margin-top: 2em;    }
h2 { margin-top: 1.75em; }
h3 { margin-top: 1.5em;  }
h4 {
	margin-top:    1.5em;  
	margin-bottom: 1.0em;
	}
		
/* Keep h5 (\paragraph) inline with text that follows */

h5 {
    display: inline-block;
    margin-right: 0.5em;
    text-align: left; 
    margin-top: 0.5em;
    margin-bottom: 0;
}
h5 + div
  {
   display: inline;
  }
h5 + div > p:first-child
  {
   display: inline;
  }

/* Keep h6 (\subparagraph) inline with text that follows */

h6 {
   display: inline-block;
   margin-right: 0.5em;
   margin-left:  2.0em;
   margin-top: 0.25em;
   margin-bottom: 0;
   text-align: left; 
  }
h6 + div
  {
   display: inline;
  }
h6 + div > p:first-child
  {
   display: inline;
  }


/* Numbered chapter and section titles are composed of two spans. The margin creates space between them. */

:is(h1,h2,h3,h4)
  > span:is([data-pdf-se-type-original="heading-number"],
            [data-pdf-se-type-original="section-number"])
   {
   margin-inline-end: 0.5em;
   white-space:       nowrap;   /* keep a number like "1.1" from being split */
   }

/* Must come after the rule above: equal specificity, so the later rule wins */

h1 > span:is([data-pdf-se-type-original="heading-number"],
            [data-pdf-se-type-original="section-number"])
   {
   margin-inline-end: 0.75em;
   }

/* Eliminate spurious horizontal space from some doc-pagebreaks. */
[role="doc-pagebreak"] {
margin: 0 !important;
}

/* core MathML */

math, [data-pdf-se-type="Formula"] 
    {
    font-family: var(--math-font);
    }
    
/* bold/bold-italic variants (fallback styling; Unicode bold glyphs handle most cases) */
math [mathvariant="bold"]
    { font-weight: bold; }
math [mathvariant="bold-italic"] 
    { 
    font-weight: bold; 
    font-style: italic; 
    }

/* Math, wrappers and SVG text inside headings:
   - set math fallback font
   - request bold math face and normal style  */
:is(h1,h2,h3,h4,h5,h6) 
:is(
	math,
    [data-pdf-se-type="Formula"],
	svg text
	) 
	{
	font-family: 	var(--math-fallback-bold);
	font-weight: 	700;
	font-style: 	normal;
	font-size: 		inherit;
	line-height:    inherit;
	}
      
/* Equations: safe centering + scroll */
div[data-pdf-se-type="Formula"] 
    {
    display:flex; 
    justify-content:flex-start; 
    overflow-x:auto; max-width:100%; 
    }

div[data-pdf-se-type="Formula"] > * { margin-inline:auto; }

div[data-pdf-se-type="Formula"] mtable.multline
    {
    width: auto !important; /* Overrides the hardcoded width attribute */
    max-width: 100%;
    }


/* Tables */

/* Assumptions:
   - No <thead>. The HTML parser wraps rows in an implicit <tbody>;
     the "> tr" selectors also cover output that has no <tbody>.
   - A "header row" is a row with no <td>. A <th> in a row that has a <td> is a row header.
   Rules can be adjusted with custom properties (set on :root or any wrapper):
     --toprule, --midrule, --bottomrule, and --midrule-inner (rule under the upper
     row of stacked header rows; default none). */

/* Data tables: centered, tabular figures, no cell spacing
   (column gaps come from padding, so horizontal rules run unbroken) */
table:not(.ARIA-role-presentation)
	{
	border-collapse: 		separate;
	border-spacing: 		0;
	font-variant-numeric: 	tabular-nums;
	margin: 				0.75em auto;
	max-width: 				100%;
	}

/* All cells: no padding; prose wraps at spaces, numbers stay whole
   (cancels the body's char-level breaking) */
table :is(th, td)
	{
	padding: 		0;
	overflow-wrap: 	normal;
	}

/* Column separation in data tables */
table:not(.ARIA-role-presentation) :is(th, td) + :is(th, td)
	{
	padding-left: 1em;
	}

/* Alignment: header cells centered; data cells right (numbers); paragraph cells left */
table th
	{
	text-align: center;
	}
table:not(.ARIA-role-presentation) td
	{
	text-align: right;
	}
/* !important guards against inline text-align from the generator; remove if none appears */
table:not(.ARIA-role-presentation) :is(th, td) p
	{
	text-align: left !important;
	}

/* Tables using p{..cm} columns: tighten paragraph margins */
table :is(th, td) div p
	{
	margin-block: 0.2em;
	}

/* An accommodation that can be used to prevent adjacent wide columns from crushing much smaller columns */
th span[data-pdf-se-type-original="MinWidSpan"]
	{
	display: 	inline-block;
	min-width: 	7rem;
	}

/* Math in header cells follows the cell's weight (UA stylesheet resets <math> to normal) */
table th math
	{
	font-weight: inherit;
	}

/* Table numbers: make MathML numerals use text font so math and text number columns match;
       variables, operators and layout stay in the math font */
table:not(.ARIA-role-presentation) td mn
	{
	font-family: var(--ui-sans);
	}
	

/* --- Booktabs-style horizontal rules --- */

/* Start with no borders (also cancels any border/frame/rules from the generator) */
table:not(.ARIA-role-presentation),
table:not(.ARIA-role-presentation) :is(th, td)
	{
	border: none;
	}

/* Header rows: vertical padding; nothing above; no rule below by default.
   This default applies only to the upper row of stacked header rows, because the midrule rule below overrides it */
table:not(.ARIA-role-presentation) tr:not(:has(> td)) > th
	{
	padding-block: 	0.25em;
	border-bottom: 	var(--midrule-inner, none);
	}

/* Body rows: slight extra separation (readability) */
table:not(.ARIA-role-presentation) tr:has(> td) > :is(th, td)
	{
	padding-top: 0.1em;
	}

/* midrule: under any header row (first or mid-table) that is followed by a body row */
table:not(.ARIA-role-presentation) tr:not(:has(> td)):has(+ tr > td) > th
	{
	border-bottom: var(--midrule, 1px solid var(--table-rule));
	}

/* midrule for header cells spanning stacked header rows: the border falls at the bottom of the span.
   :where() keeps specificity low, so the bottomrule still wins. */
table:not(.ARIA-role-presentation) tr:not(:has(> td)) > th:where([rowspan]:not([rowspan="1"]))
	{
	border-bottom: var(--midrule, 1px solid var(--table-rule));
	}

/* toprule: every cell of the first row, th or td */
table:not(.ARIA-role-presentation) > tbody:first-of-type > tr:first-child > :is(th, td),
table:not(.ARIA-role-presentation) > tr:first-of-type > :is(th, td)
	{
	border-top: 	var(--toprule, 2px solid var(--table-rule-strong));
	padding-top: 	0.25em;
	}

/* bottomrule: every cell of the last row */
table:not(.ARIA-role-presentation) > tbody:last-of-type > tr:last-child > :is(th, td),
table:not(.ARIA-role-presentation) > tr:last-of-type > :is(th, td)
	{
	border-bottom: 	var(--bottomrule, 2px solid var(--table-rule-strong));
	padding-bottom: 0.25em;
	}

/* If the user tags th cells as having a \cmidrule, this will draw a bottom border 
   \tagstructbegin{tag = Cmidrule} ...cell content \tagstructend  */
   
td:has(span[data-pdf-se-type-original="Cmidrule"]),
th:has(span[data-pdf-se-type-original="Cmidrule"]) 
   {
   padding-bottom: 0.1em;
   border-bottom: 1px solid var(--table-rule-strong) !important;
   }


/* --- Presentation (layout) tables --- */

/* Keep presentation tables at the left margin, with tight column gaps */
table.ARIA-role-presentation
	{
	border-collapse: collapse;
	}
table.ARIA-role-presentation :is(th, td) + :is(th, td)
	{
	padding-inline: 0.5em;
	}

/* Title page presentation table holding author, certifier, acceptor */
/* div[data-pdf-se-type-original="Title_sig_block"] table.ARIA-role-presentation */
section[data-pdf-se-type-original="Title_sig_block"] table.ARIA-role-presentation
	{
	margin-top: 1em;
	}
/* div[data-pdf-se-type-original="Title_sig_block"] table.ARIA-role-presentation td */
section[data-pdf-se-type-original="Title_sig_block"] table.ARIA-role-presentation td
	{
	vertical-align: baseline;
	}
/* div[data-pdf-se-type-original="Title_sig_block"] table.ARIA-role-presentation tr td span */
section[data-pdf-se-type-original="Title_sig_block"] table.ARIA-role-presentation tr td span
	{
	margin-top: 	0.5em;
	display: 		inline-block;
	}


/* Captions */
/* The effectiveness of all this is changed/reduced by loading the caption/subcaption packages */

div[data-pdf-se-type="Caption"]
    {
    text-align: center;
    }

/* Let's keep caption labels on the same line as caption text */
div[data-pdf-se-type="Caption"]  p 
	{    
	display: inline;
	font-weight: bold;  /* make all caption text bold; note math-fallback below */
	}
	
/* Later caption paragraphs start on a new line (the first runs in after the label) */
div[data-pdf-se-type="Caption"] p ~ p
	{
	display:      block;
	margin-block: 0.5em 0;
	}

/* boldface labels on captions, with space after label */	
div[data-pdf-se-type="Caption"] > span[data-pdf-se-type="Lbl"] 
	{
	font-weight: bold;
	}
	
div[data-pdf-se-type="Caption"]  span[data-pdf-se-type="Lbl"]::after 
	{
	content: "";
	display: inline-block;
	width: 0.5em;
	}

/* Math fallback for math/formula-like children and SVG text */
div[data-pdf-se-type="Caption"] 
:is(
  math,
  [data-pdf-se-type="Formula"],
  svg text
) 
	{
	font-family: 	var(--math-fallback-bold);    
    font-weight: 	700;
    font-style: 	normal;
	line-height: 	inherit;
	}


/* Footnotes */

div[data-pdf-se-type-original="footnote"]
    { 
    margin-bottom: 0.25em; 
    margin-top:    0.25em;
    }

div[data-pdf-se-type-original="footnote"] > span[data-pdf-se-type-original="footnotelabel"]
	{ 
	font-size: smaller;        
	color: var(--footnote-color);
	margin-right: 0.25em;
	}
	
span[data-pdf-se-type-original="footnote"]
    { 
	font-size: smaller;        
	color: var(--footnote-color);
	}

 div[data-pdf-se-type-original="footnote"] [data-pdf-se-type="Part"] 
	{
	display: contents;
	}

div[data-pdf-se-type-original="footnote"] [data-pdf-se-type="Part"] > p 
	{
    display: 	 	inline;
    font-size: 	 	smaller;
    font-weight: 	normal; 
    color: 			var(--footnote-color);
    --hang:         0em; /* in case footnote is inside a description list */
	}


/* Listing code lines (no wrapping) */

code[data-pdf-se-type-original="codeline"]
	{
	font-family: 	var(--ui-mono);
	font-size: 		10pt;
	color: 			var(--code-color);
	white-space:    pre; 
	overflow-wrap:  normal;
	hyphens:        manual; 
	hanging-punctuation: none;
	}
:has(> code[data-pdf-se-type-original="codeline"]) { overflow-x: auto; }

code[data-pdf-se-type="Code"]	
	{
	font-family: 	var(--ui-mono);
	font-size: 		12pt;
	color: 			var(--code-color);
	overflow-wrap:  normal;
	hyphens:        none;
	hanging-punctuation: none;
	}

	
/* TOC, LOF, LOT layout */

/* Baseline: flush all TOC containers */
ol[data-pdf-se-type="TOC"] 
	{
	padding-inline-start: 	0;
	margin-inline-start: 	0em;
	list-style: 			none; 
	}

/* Indent any nested TOC level (works with wrapper <li> too) */
ol[data-pdf-se-type="TOC"] ol[data-pdf-se-type="TOC"] 
	{
	padding-inline-start: 2em;
	}

/* TOCI items: spacing + no markers */
li[data-pdf-se-type="TOCI"] 
	{
	list-style: 			none;
	margin-inline-start: 	0;
	margin-bottom: 			0.25em;
	}

  
/* Label spacing inside link */
li[data-pdf-se-type="TOCI"] > a > span[data-pdf-se-type="Lbl"]
	{
	font-weight: 600;
	display: inline-block;
	margin-inline-end: 0.5em;
	}

/* Ensure a gap between the link and the trailing page number text node */
li[data-pdf-se-type="TOCI"] > a::after 
	{
	content: 	"";
	display: 	inline-block;
	width: 		0.5em; 
	}

/* Extra space above chapter-level entries:
   outermost TOC list only (:not), main TOC only (:has; LOF/LOT have no nested lists) */

ol[data-pdf-se-type="TOC"]:has(ol[data-pdf-se-type="TOC"]):not(ol[data-pdf-se-type="TOC"] *)
  > li[data-pdf-se-type="TOCI"]
	{
	padding-block-start: 0.5em;
	}
	
/* Reduce gap after the entire TOC block to 0.5em */
:is(ul, ol)[data-pdf-se-type="TOC"] 
	{ 
	margin-block-end: 0.5em; 
	}
/* but NOT after nested TOC lists */
li > :is(ul, ol)[data-pdf-se-type="TOC"] 
	{ 
	margin-block-end: 0em; 
	}


/* Description lists */

dl.description 
	{
	--hang: 3em;      /* hanging width for dd paragraphs */
	--gap: 0.5em;     /* space between label and body */
	margin: 0;
	padding: 0 0 0 1em;
	}

/* Each LI wrapper: contain float + add spacing between items */
dl.description > div 
	{
	display: flow-root;
	margin-bottom: 1em; /* 1em gap between list items */
	}
dl.description > div:last-child 
	{
	margin-bottom: 0;   /* no extra space after final item */
	}

/* Label floats left; reserve hanging width + gap */
dl.description dt 
	{
	float: left;
	font-weight: 700;
	margin: 0 calc(var(--hang) + var(--gap)) 0 0;
  /* optional: prevent wrapping of label text */
  /* white-space: nowrap; */
	}

/* Definition follows the float */
dl.description dd 
	{ margin: 0; }

/* Ignore PDF wrapper divs */
dl.description dd > div 
	{ display: contents; }

/* 3em hanging indent for body paragraphs */
dl.description dd p 
	{
	margin: 0;
	padding-left: var(--hang);
	text-indent: calc(var(--hang) * -1);
	}

/* Additional paragraphs: same hanging + 1em vertical gap */
dl.description dd > div + div > p
	{ 
	margin-top: 1em; 
	text-indent: 0;
	}


/* Special layout for nomenclature list, two column */

div[data-pdf-se-type-original="Nomenclature_list"] ul li
	{
	margin-bottom: 0.2em;	/* spacing between entries */
	}
div[data-pdf-se-type-original="Nomenclature_list"] ul li p
	{
	margin-bottom: 0;
	}

div[data-pdf-se-type-original="Nomenclature_list"] ul  
	{
	column-gap: 2em; /* Adds space between columns  */
	columns: 2 16em  /* Drop to one column on small screens */
	}
div[data-pdf-se-type-original="Nomenclature_list"] ul li 
    {
    break-inside: avoid;
    }

/* Nomenclature entry heading (e.g., "Greek letters") */
ul.list span[data-pdf-se-type-original="Nomenclature_entry_heading"]
	{
	margin-top:    0.5em;
	margin-bottom: 0.5em; /* some additional space */
	display: inline-block;
	}


/* Other enumerated and itemized lists (References are "list") */

/* Label inline with first line, paragraphs preserved */
:where(ol[data-pdf-se-type-original="enumerate"],
	ul[data-pdf-se-type-original="list"],
    ul[data-pdf-se-type-original="itemize"]) 
      li 
	{
	display: 		flex;      	/* put label and body on the same row 	*/
	align-items: 	flex-start;	/* align label with top of body 		*/
	column-gap: 	0.25em;     /* space between label and text 		*/
	margin-bottom: 	1.0em;		/* vertical separation between items 	*/
	}

/* Label stays in the left column */
:where(ol[data-pdf-se-type-original="enumerate"],
	ul[data-pdf-se-type-original="list"],
    ul[data-pdf-se-type-original="itemize"])
      li > span[data-pdf-se-type="Lbl"] 
	{
	flex: 0 0 auto;  /* no grow/shrink */
	}

/* Body flows in the right column; override inline-block from generator */
:where(ol[data-pdf-se-type-original="enumerate"],
	ul[data-pdf-se-type-original="list"],
    ul[data-pdf-se-type-original="itemize"])
      li > [data-pdf-se-type="LBody"]
	{
	flex: 		1 1 auto;
	display: 	block !important;   /* ensures normal block flow   */
	min-width: 	0;                  /* allow wrapping in flex item */
	}

/* Inner wrappers transparent to layout */
:where(ol[data-pdf-se-type-original="enumerate"],
	ul[data-pdf-se-type-original="list"],
    ul[data-pdf-se-type-original="itemize"])
      li > [data-pdf-se-type="LBody"] > [data-pdf-se-type="Part"] 
	{
	display: contents;
	}

/* Keep paragraphs as blocks so breaks are preserved */
:where(ol[data-pdf-se-type-original="enumerate"],
	ul[data-pdf-se-type-original="list"],
    ul[data-pdf-se-type-original="itemize"])
      li p 
	{
	display: 	block;
	margin: 	0 0 0.5em 0;   /* paragraph spacing inside the body */
	}

/* The last paragraph of an item adds no space; item spacing lives on the li */
:where(ol[data-pdf-se-type-original="enumerate"],
	ul[data-pdf-se-type-original="list"],
    ul[data-pdf-se-type-original="itemize"])
      li > [data-pdf-se-type="LBody"] > p:last-child,
:where(ol[data-pdf-se-type-original="enumerate"],
	ul[data-pdf-se-type-original="list"],
    ul[data-pdf-se-type-original="itemize"])
      li > [data-pdf-se-type="LBody"] > [data-pdf-se-type="Part"]:last-child > p:last-child
	{
	margin-bottom: 0;
	}

/* Ragged right for all ul.list paragraphs (references, nomenclature, other list environments) */
ul[data-pdf-se-type-original="list"] li div[data-pdf-se-type="LBody"] p
	{
	text-align: left !important;
	}
	
/* Reference (ul.list) item spacing; :where keeps specificity equal to the general li rule */
:where(ul[data-pdf-se-type-original="list"]) li
	{
	margin-bottom: 0.75em;
	}

/* space above figures and tables (asides) */

aside { margin-top: 3em; }

/* Double figure width, but don't exceed 90% of page width */
    
aside p.center img 
    {
    display: block !important;
    margin:  1em auto !important;
    width:   min(2 * var(--native-w, 45%), 90%) !important;
    height:  auto !important;
    }

aside div[data-pdf-se-type="Caption"] 
    { 
    max-width:90%; 
    margin:0.5em auto 0; 
    }


/* Figure text (target is any subcaption text in the figure) */
 aside div[data-pdf-se-type-original="text-unit"] > p.justify
 	{
	text-align: center!important;
	}


/* --- Dark mode adjustments --- */

@media (prefers-color-scheme: dark) {
	:root {
	    --table-rule:         #7e7e7e; 
	    --table-rule-strong:  #b3b3b3; 
        --code-color:         #7cb0ff; /* light sky blue — high contrast on #121212 */
        --footnote-color:     #9ec3ff;
        --fg-color:           #e8eaed;
		--bg-color:           #121212;
		--hr-color:           #4a4a4a;
		--link-color:         #82b1ff;  /* light blue, accessible on #121212 */
		--link-visited-color: #b388ff;  /* distinct violet for visited links */
		--link-hover-color:   #bbdefb;  /* even lighter on hover/focus */
		--xref-color:         #5fd4cf;  
	    --xref-visited-color: #d9b26a;
	}
	aside img { background:#fff; }
}


/* --- Print: layout, breaks, widows/orphans --- */

@media print {
    :root { 
           color-scheme:         light;
           --fg-color:           #111; 
           --bg-color:           #fff; 
           --hr-color:           #b3b3b3;
           --link-color:         #0033a0; 
           --link-visited-color: #663366;
           --link-hover-color:   #0b0080;
           --xref-color:         #00626b;
           --xref-visited-color: #6b4e16;
           --footnote-color:     #1f4e79; 
           --code-color:         #3333b3;
           --table-rule:         #404040;  /* midrule:   ~10:1 on white */
           --table-rule-strong:  #000;     /* top/bottom: 21:1 on white */
    }
	@page {
		size: 	Letter;    /* or A4 */
		margin: 0.5in;     /* matches ~36pt intent */
	}
	body {
		margin: 0;         /* @page controls it on print */
		max-width: none;
		padding-inline: 0; 
	}
  
	/* Avoid splitting key elements across pages */
	h1, h2, h3, h4,
	    table,
	    div[data-pdf-se-type="Caption"],
	    aside  
		{
		break-inside: avoid-page;
		}

	/* Widow & orphan control */
	p, li, dd, blockquote 
	{
		orphans: 	2;
		widows: 	2;
	}
}
