/* Shared appearance; loaded after each page's existing styles. */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="system"] { color-scheme: light dark; }
.theme-control {
  display: flex; align-items: center; justify-content: flex-end; gap: .5rem;
  margin: 0 0 1.25rem; padding: .35rem 0; clear: both;
  font: 14px/1.5 Arial, sans-serif;
}
.theme-control select { font: inherit; padding: .3rem .5rem; }
html[data-theme] a:focus-visible,
html[data-theme] select:focus-visible,
html[data-theme] input:focus-visible { outline: 2px solid #b35a00; outline-offset: 3px; }
/* Abstracts are ordinary, wrapping prose, never preformatted code boxes. */
p.paper-abstract {
  font: 1rem/1.65 Georgia, "Times New Roman", serif;
  margin: 1.5em 0; padding: 0; border: 0; border-radius: 0;
  background: transparent !important; box-shadow: none;
  white-space: normal; text-align: justify; text-align-last: left;
}
p.paper-abstract strong { font-variant: small-caps; }

html[data-theme="dark"] { color-scheme: dark; background: #181c22 !important; color: #e4e8ee; }
html[data-theme="dark"] body { background: #181c22 !important; color: #e4e8ee !important; }
html[data-theme="dark"] :is(main, article, section, header, footer, aside, nav, div, table, thead, tbody, tr, td, th) {
  background-color: transparent !important;
}
html[data-theme="dark"] :is(p, li, dt, dd, td, th, blockquote, label, legend, .rendered_html, .text_cell_render, .output, .output_area, .text, .content, #content, #main, #sidebar) { color: #e4e8ee !important; }
html[data-theme="dark"] :is(a:link, a:visited, h1, h2, h3, h4, h5, h6, #blog-title, .post-title) { color: #8fc7ff !important; }
html[data-theme="dark"] a:hover { color: #ffd08a !important; }
html[data-theme="dark"] :is(h1, h2, h3, h4, h5, h6) { border-color: #566170 !important; background: transparent !important; }
html[data-theme="dark"] :is(h4, .url, .date, .post-footer, #description) { color: #bcc5d1 !important; }
html[data-theme="dark"] hr { border: 0; border-top: 1px solid #566170; }
html[data-theme="dark"] #nav-menu li a { background: #252d38 !important; color: #b9dafa !important; }
html[data-theme="dark"] #nav-menu li a:hover { background: #354255 !important; color: #fff !important; }
html[data-theme="dark"] :is(input, select, textarea, button) { background: #252d38 !important; color: #e4e8ee !important; border: 1px solid #748195; }
html[data-theme="dark"] :is(pre, code, .input_area, .codeinput, .codeoutput) { background: #202630 !important; color: #e4e8ee !important; border-color: #566170 !important; }
html[data-theme="dark"] :is(pre, code) :is(span, font) { color: inherit; }
html[data-theme="dark"] :is(.comment, .c, .c1, .cm, .cs) { color: #a4c49b !important; }
html[data-theme="dark"] :is(.keyword, .k, .kn, .kd, .kc) { color: #c6a9ff !important; }
html[data-theme="dark"] :is(.string, .s, .s1, .s2) { color: #efb88d !important; }
html[data-theme="dark"] :is(.Author, .error, .err) { color: #ffa7a7 !important; }
html[data-theme="dark"] :is(.MathJax, .MathJax_Display, .MathJax_SVG) { color: #e4e8ee !important; }
/* White-backed monochrome images blend into the page without changing files. */
html[data-theme="dark"] img:is([src$="email.png"], [src$="ucilogo.jpg"], [src*="_eq"]) {
  background: transparent; filter: grayscale(1) invert(1); mix-blend-mode: screen;
}
html[data-theme="dark"] :is(a, select, input, button):focus-visible { outline-color: #ffd08a; }

/* Follow the OS even when JavaScript is disabled. */
@media (prefers-color-scheme: dark) {

html[data-theme="system"] { color-scheme: dark; background: #181c22 !important; color: #e4e8ee; }
html[data-theme="system"] body { background: #181c22 !important; color: #e4e8ee !important; }
html[data-theme="system"] :is(main, article, section, header, footer, aside, nav, div, table, thead, tbody, tr, td, th) {
  background-color: transparent !important;
}
html[data-theme="system"] :is(p, li, dt, dd, td, th, blockquote, label, legend, .rendered_html, .text_cell_render, .output, .output_area, .text, .content, #content, #main, #sidebar) { color: #e4e8ee !important; }
html[data-theme="system"] :is(a:link, a:visited, h1, h2, h3, h4, h5, h6, #blog-title, .post-title) { color: #8fc7ff !important; }
html[data-theme="system"] a:hover { color: #ffd08a !important; }
html[data-theme="system"] :is(h1, h2, h3, h4, h5, h6) { border-color: #566170 !important; background: transparent !important; }
html[data-theme="system"] :is(h4, .url, .date, .post-footer, #description) { color: #bcc5d1 !important; }
html[data-theme="system"] hr { border: 0; border-top: 1px solid #566170; }
html[data-theme="system"] #nav-menu li a { background: #252d38 !important; color: #b9dafa !important; }
html[data-theme="system"] #nav-menu li a:hover { background: #354255 !important; color: #fff !important; }
html[data-theme="system"] :is(input, select, textarea, button) { background: #252d38 !important; color: #e4e8ee !important; border: 1px solid #748195; }
html[data-theme="system"] :is(pre, code, .input_area, .codeinput, .codeoutput) { background: #202630 !important; color: #e4e8ee !important; border-color: #566170 !important; }
html[data-theme="system"] :is(pre, code) :is(span, font) { color: inherit; }
html[data-theme="system"] :is(.comment, .c, .c1, .cm, .cs) { color: #a4c49b !important; }
html[data-theme="system"] :is(.keyword, .k, .kn, .kd, .kc) { color: #c6a9ff !important; }
html[data-theme="system"] :is(.string, .s, .s1, .s2) { color: #efb88d !important; }
html[data-theme="system"] :is(.Author, .error, .err) { color: #ffa7a7 !important; }
html[data-theme="system"] :is(.MathJax, .MathJax_Display, .MathJax_SVG) { color: #e4e8ee !important; }
/* White-backed monochrome images blend into the page without changing files. */
html[data-theme="system"] img:is([src$="email.png"], [src$="ucilogo.jpg"], [src*="_eq"]) {
  background: transparent; filter: grayscale(1) invert(1); mix-blend-mode: screen;
}
html[data-theme="system"] :is(a, select, input, button):focus-visible { outline-color: #ffd08a; }
}

@media print {
  .theme-control { display: none !important; }
  html[data-theme], html[data-theme] body { background: white !important; color: black !important; }
  html[data-theme] :is(p, li, dt, dd, td, th, blockquote, a:link, a:visited, h1, h2, h3, h4, h5, h6, .url, pre, code, .rendered_html, .text_cell_render) { color: black !important; background: transparent !important; }
  html[data-theme] img { filter: none !important; mix-blend-mode: normal !important; }
}

/* Justify legacy bibliography abstracts as well as standalone paper pages. */
p.Annote { text-align: justify; text-align-last: left; }

/* Each list keeps the CV item values; a year separator is decoration, not an item. */
ol.publication-list { padding-left: 2.5em; }
ol.publication-list > li { margin-bottom: .6em; }
ol.publication-list > li.publication-year-last {
  border-bottom: 1px solid #888;
  padding-bottom: .8em;
  margin-bottom: .8em;
}


/* Compact question launcher shared by the site footers. */
.chatgpt-footer { display: inline-block; max-width: 100%; margin: 0; text-align: right; }
.chatgpt-footer-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4em; }
.chatgpt-footer input { min-width: 8em; width: 16em; max-width: 100%; box-sizing: border-box; padding: .45em .6em; border-radius: .3em; }
.chatgpt-footer button { padding: .45em .65em; border-radius: .3em; cursor: pointer; white-space: nowrap; }
.chatgpt-footer small { display: block; margin-top: .3em; font-size: .75em; font-weight: normal; }
