/*
  Overrides for this static (file://) build.
*/

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap");

:root {
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site-title,
.author__name,
.page__title,
.page__content h1,
.page__content h2,
.page__content h3,
.page__content h4,
.research-projects h3,
.research-rep h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.site-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page__title {
  font-weight: 700;
  font-size: 2.15em;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page__content h2 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.author__name {
  font-weight: 600;
}

/* Fix masthead to top so JS-added body padding-top doesn't create a blank gap above it.
   Explicit background needed because position:fixed removes it from the normal flow. */
.masthead {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #fff;
  border-bottom: none;
}

.greedy-nav button {
  z-index: 30;
}

/* Horizontal top nav — all links visible; wraps on small viewports (no hamburger). */
#site-nav.greedy-nav.masthead-nav-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem 0.5rem;
  padding: 0.4rem 1em;
  width: 100%;
  max-width: 100%;
  clear: both;
  overflow: hidden;
}

/* Site name + nav links + theme on one row (scroll horizontally if needed on narrow screens). */
#site-nav.masthead-nav-bar .site-title {
  flex: 0 0 auto;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
  padding: 0.35em 0;
  white-space: nowrap;
}

#site-nav.masthead-nav-bar .visible-links {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.1rem 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

#site-nav.masthead-nav-bar .visible-links li {
  display: list-item !important;
  list-style: none;
}

#site-nav.masthead-nav-bar .visible-links li:first-child {
  font-weight: inherit;
}

#site-nav.masthead-nav-bar .masthead__menu-item {
  margin: 0;
  padding: 0;
}

#site-nav.masthead-nav-bar .masthead__menu-item a {
  display: inline-block;
  margin: 0 0.05rem;
  padding: 0.45em 0.4em;
  white-space: nowrap;
}

/* Course notes keep the name and the theme button. The site menu stays on the personal pages. */
body.page-courses:not(.site-nav-full) #site-nav.masthead-nav-bar .visible-links {
  display: none !important;
}

body.page-courses:not(.site-nav-full) #site-nav.masthead-nav-bar {
  justify-content: space-between;
}

body.page-courses:not(.site-nav-full) #site-nav.masthead-nav-bar #theme-toggle {
  margin-left: auto;
}

body.page-courses:not(.site-nav-full) .masthead__inner-wrap {
  padding: 0.2em 1em;
}

body.page-courses:not(.site-nav-full) #site-nav.greedy-nav.masthead-nav-bar {
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

/*
  Wide layout: three columns —
  left sidebar (profile), middle content (full-width justified lines),
  right rail (short one-line table of contents).
*/
@media (min-width: 57.8125em) {
  #main {
    display: grid;
    /* minmax(0, …) keeps tracks from growing with TOC or sidebar content. */
    grid-template-columns: minmax(0, 18%) minmax(0, 64%) minmax(0, 14%);
    column-gap: 2%;
    align-items: start;
    width: 100%;
  }

  #main > .sidebar {
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    float: none !important;
    margin-right: 0 !important;
    grid-column: 1;
    grid-row: 1;
  }

  #main > .page {
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    float: none !important;
    margin-right: 0 !important;
    /* Use the full middle column (drop theme’s large right padding). */
    padding-left: 0.75rem !important;
    padding-right: 0 !important;
    grid-column: 2;
    grid-row: 1;
  }

  /* Empty right column fallback (half of left); replaced by .sidebar-right when present. */
  #main::after {
    content: "" !important;
    display: block !important;
    clear: none !important;
    width: auto !important;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    min-height: 1px;
    grid-column: 3;
    grid-row: 1;
  }

  #main:has(.sidebar-right)::after {
    content: none !important;
    display: none !important;
  }

  #main > .sidebar-right {
    grid-column: 3;
    grid-row: 1;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding-left: 0.45rem;
    padding-right: 0.1rem;
  }

  #site-nav.masthead-nav-bar .visible-links {
    margin-left: calc(18% + 2% + 1em - 3cm - 1cm);
  }

  #site-nav.masthead-nav-bar .visible-links .masthead__menu-item:first-child a {
    margin-left: 0;
    padding-left: 0;
  }

  /* Full-line justified body text in the middle column. */
  #main > .page .page__content {
    text-align: justify !important;
    text-justify: inter-word;
    hyphens: auto;
  }

  #main > .page .page__content p,
  #main > .page .page__content li,
  #main > .page .page__content dd,
  #main > .page .page__content .news-body {
    text-align: justify !important;
    text-justify: inter-word;
  }

  #main > .page .page__content figcaption {
    text-align: left !important;
    text-justify: auto;
    hyphens: manual;
  }

  #main > .page .page__content .news-body {
    display: block;
    width: 100%;
  }

  #main > .page .page__content h1,
  #main > .page .page__content h2,
  #main > .page .page__content h3,
  #main > .page .page__content h4,
  #main > .page .page__title,
  #main > .page header {
    text-align: left !important;
  }
}

@media (max-width: 57.8124em) {
  #site-nav.masthead-nav-bar .visible-links {
    margin-left: 0 !important;
  }

  .sidebar-right {
    display: none;
  }
}

.page-toc {
  position: sticky;
  top: calc(var(--masthead-height, 4rem) + 0.85rem);
  max-height: calc(100vh - var(--masthead-height, 4rem) - 1.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.35;
}

.page-toc__title {
  margin: 0 0 0.45em;
  padding-left: 0.45em;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5f6368;
  white-space: nowrap;
}

.page-toc__list,
.page-toc__sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-toc__list > li {
  margin: 0 0 0.45em;
}

.page-toc__sublist {
  margin-top: 0.3em;
  margin-left: 0;
  padding-left: 0;
}

.page-toc__sublist > li {
  margin: 0 0 0.3em;
}

.page-toc a {
  display: block;
  color: #3c4043;
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.45em;
  margin-left: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-toc a:hover {
  color: #1a73e8;
}

.page-toc a.is-active {
  color: #1a73e8;
  font-weight: 600;
  border-left-color: #1a73e8;
}

.page-toc__weeks {
  margin-bottom: 1.15em;
  font-size: 0.78rem;
  line-height: 1.35;
}

.page-toc__weeks .page-toc__title {
  font-size: 0.68rem;
  margin-bottom: 0.55em;
}

.page-toc__weeks .page-toc__list > li {
  margin: 0 0 0.38em;
}

.course-week-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 0.55em;
  margin: 0 0 1.2em;
}

.course-week-jump a {
  min-width: 1.7em;
  padding: 0.15em 0.35em;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #d0d0d0;
}

.course-week-jump a.is-active {
  color: #1a73e8;
  border-color: #1a73e8;
}

@media (min-width: 57.8125em) {
  .course-week-jump {
    display: none;
  }
}

#main > .page .page__content h2,
#main > .page .page__content h3 {
  scroll-margin-top: calc(var(--masthead-height, 4rem) + 0.75rem);
}

#site-nav.masthead-nav-bar #theme-toggle {
  position: relative !important;
  right: auto !important;
  top: auto !important;
  height: auto !important;
  flex: 0 0 auto;
  margin-left: 0.35rem;
  align-self: center;
  z-index: 31;
  background-color: #fff;
}

@media (max-width: 28rem) {
  #site-nav.masthead-nav-bar #theme-toggle {
    margin-left: 0;
  }
}

/* Remove theme’s animated underline bar under nav links. */
#site-nav.masthead-nav-bar .visible-links a::before {
  display: none !important;
}

#site-nav.masthead-nav-bar .masthead__menu-item a.active {
  border-bottom: none;
}

/* Home is the site title; show current page on index (no horizontal rule). */
#site-nav.masthead-nav-bar .site-title.site-title--current {
  font-weight: 700;
}

/* Research page: numbered projects with headings inside list items */
ol.research-projects {
  margin-top: 0.75em;
  padding-left: 1.35rem;
}

ol.research-projects > li {
  margin-bottom: 1.75em;
}

ol.research-projects > li:last-child {
  margin-bottom: 0;
}

ol.research-projects h3 {
  margin: 0.35em 0 0.5em;
  font-size: 1.05em;
  line-height: 1.35;
  font-weight: 700;
}

/* News page: date + entry list. */
ul.news-list {
  list-style: none;
  margin: 1em 0 0;
  padding: 0;
}

ul.news-list > li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em 1em;
  padding: 0.75em 0;
  border-bottom: 1px solid #e3e3e3;
}

ul.news-list > li:last-child {
  border-bottom: none;
}

ul.news-list .news-date {
  flex: 0 0 8.5em;
  white-space: nowrap;
  font-weight: 700;
  color: #1a73e8;
}

ul.news-list .news-body {
  flex: 1 1 16em;
  min-width: 0;
  text-align: justify;
  text-justify: inter-word;
}

html[data-theme="dark"] ul.news-list > li {
  border-bottom-color: #5e5e5e;
}

html[data-theme="dark"] ul.news-list .news-date {
  color: #58a6ff;
}

/* Courses listing and course hub. */
body.page-courses ul.course-list {
  list-style: none;
  margin: 1em 0 0;
  padding: 0;
}

body.page-courses ul.course-list > li {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #e3e3e3;
}

body.page-courses ul.course-list > li:last-child {
  border-bottom: none;
}

body.page-courses a.course-card {
  display: block;
  padding: 1em 0;
  text-decoration: none;
  color: inherit;
}

body.page-courses a.course-card .course-card__title {
  color: #0b57d0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

body.page-courses a.course-card:hover .course-card__title {
  color: #084298;
}

.course-card__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15em;
  margin: 0 0 0.3em;
}

.course-card__meta {
  display: block;
  color: #5f6368;
  font-size: 0.95em;
}

.course-meta {
  margin: 0 0 1em;
  color: #5f6368;
}

.course-placeholder {
  color: #5f6368;
}

.course-schedule {
  width: 100%;
  border-collapse: collapse;
  margin: 0.15em 0 1.1em;
}

.course-schedule th,
.course-schedule td {
  text-align: left;
  padding: 0.4em 0.7em 0.4em 0.7em;
  border-bottom: 1px solid #e3e3e3;
  vertical-align: top;
}

.course-schedule th {
  font-family: var(--font-display);
  font-weight: 600;
}

.page-courses .course-due-list {
  margin: 0.15em 0 1.1em;
  padding-left: 1.25em;
}

.page-courses .course-due-list li {
  margin: 0.35em 0;
}

html[data-theme="dark"] .course-schedule th,
html[data-theme="dark"] .course-schedule td {
  border-bottom-color: #5e5e5e;
}

html[data-theme="dark"] ul.course-list > li {
  border-bottom-color: #5e5e5e;
}

html[data-theme="dark"] a.course-card .course-card__title,
html[data-theme="dark"] a.course-card:hover .course-card__title {
  color: #79c0ff;
}

html[data-theme="dark"] .course-card__meta,
html[data-theme="dark"] .course-meta,
html[data-theme="dark"] .course-placeholder {
  color: #b0b0b0;
}

/* Solid blue vertical rule between sidebar and main content (two-column layout). */
@media (min-width: 57.8125em) {
  #main > .sidebar.sticky {
    position: relative;
    padding-right: 1.1rem;
    border-right: none;
  }

  #main > .sidebar.sticky::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 1cm;
    width: 2px;
    background-color: #1a73e8;
  }
}

/* Keep each sidebar bio line on one row on desktop (intentional <br> breaks still apply). */
.author__bio {
  font-size: 0.9em;
  line-height: 1.4;
}

@media (min-width: 57.8125em) {
  .author__bio {
    white-space: nowrap;
  }
}

/* Content links are blue across the site. */
.page__content a {
  color: #0b57d0;
}

.page__content a:hover {
  color: #084298;
}

/* ==========================================================================
   DARK MODE
   The compiled main.css uses hardcoded light-theme colors. These rules
   override them when JS sets data-theme="dark" on <html>.
   ========================================================================== */

html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color: #474747;
  color: #fff;
}

html[data-theme="dark"] a {
  color: #0ea1c5;
}

html[data-theme="dark"] a:hover {
  color: #0b7fa0;
}

html[data-theme="dark"] .masthead {
  background-color: #474747;
  border-bottom: none;
}

/* .greedy-nav has its own hardcoded background:#fff in main.css — must override it */
html[data-theme="dark"] .greedy-nav {
  background: #474747;
}

html[data-theme="dark"] .masthead a,
html[data-theme="dark"] .masthead .site-title,
html[data-theme="dark"] .masthead .masthead__menu-item a {
  color: #fff;
}

html[data-theme="dark"] .masthead .masthead__menu-item a:hover {
  color: #0ea1c5;
}

html[data-theme="dark"] .masthead .masthead__menu-item a.active {
  color: #fff;
  border-bottom: none;
}

html[data-theme="dark"] #site-nav.masthead-nav-bar .site-title.site-title--current {
  color: #fff;
  border-bottom-color: #fff;
}

html[data-theme="dark"] #theme-toggle,
html[data-theme="dark"] .greedy-nav__toggle {
  color: #fff;
  background-color: #474747;
}

html[data-theme="dark"] #main > .sidebar.sticky {
  border-right: none;
}

html[data-theme="dark"] #main > .sidebar.sticky::after {
  background-color: #58a6ff;
}

html[data-theme="dark"] .page-toc__title {
  color: #b0b0b0;
}

html[data-theme="dark"] .page-toc a {
  color: #ddd;
}

html[data-theme="dark"] .page-toc a:hover,
html[data-theme="dark"] .page-toc a.is-active {
  color: #79c0ff;
}

html[data-theme="dark"] .course-week-jump a {
  border-color: #5e5e5e;
}

html[data-theme="dark"] .course-week-jump a.is-active {
  color: #79c0ff;
  border-color: #58a6ff;
}

html[data-theme="dark"] .page-toc a.is-active {
  border-left-color: #58a6ff;
}

html[data-theme="dark"] .page__content a {
  color: #79c0ff;
}

html[data-theme="dark"] .page__content a:hover {
  color: #a5d6ff;
}

html[data-theme="dark"] .page__content a.course-material__pdf {
  color: #ff7b72;
}

html[data-theme="dark"] .page__content a.course-material__pdf:hover {
  color: #ffa198;
}

html[data-theme="dark"] .course-material__note {
  color: #b0b0b0;
}

html[data-theme="dark"] .sidebar {
  background-color: #474747;
}

html[data-theme="dark"] .author__name,
html[data-theme="dark"] .author__bio,
html[data-theme="dark"] .author__urls .label {
  color: #fff;
}

html[data-theme="dark"] .author__urls {
  background: #3a3a3a;
  border-color: #5e5e5e;
}

html[data-theme="dark"] .author__urls a {
  color: #fff;
}

html[data-theme="dark"] .author__urls a:hover {
  color: #0ea1c5;
}

/* Official platform colors. Icons keep these in both themes; labels stay with the link text. */
.author__urls a .fa-envelope-square {
  color: #ea4335;
}

.author__urls a .ai-google-scholar-square {
  color: #4285f4;
}

.author__urls a .fa-linkedin {
  color: #0a66c2;
}

.author__urls a .ai-orcid-square {
  color: #a6ce39;
}

.author__urls a .ai-researchgate-square {
  color: #00ccbb;
}

.author__urls a .fa-github {
  color: #181717;
}

.author__urls a .icon-brand {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.15em;
  vertical-align: -0.2em;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.author__urls a .icon-au {
  background-image: url("../images/icons/au.png");
}

.author__urls a .icon-openreview {
  background-image: url("../images/icons/openreview.png");
  border-radius: 0.12em;
}

html[data-theme="dark"] .author__urls a .fa-github {
  color: #fff;
}

html[data-theme="dark"] .btn--inverse {
  color: #fff;
  border-color: #5e5e5e;
  background-color: transparent;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: #fff;
}

html[data-theme="dark"] .page__title {
  color: #fff;
}

html[data-theme="dark"] .page__content h2 {
  border-bottom-color: #5e5e5e;
}

html[data-theme="dark"] .page__footer {
  background-color: #3a3a3a;
  color: #ccc;
  border-top-color: #5e5e5e;
}

html[data-theme="dark"] thead {
  background-color: #3a3a3a;
  border-bottom-color: #5e5e5e;
}

html[data-theme="dark"] .page__footer a {
  color: #0ea1c5;
}

html[data-theme="dark"] .page__footer-copyright {
  color: #ccc;
}

.page__footer > footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1.25rem;
}

.page__footer-copyright {
  margin: 0;
}

.page__footer-updated {
  margin: 0;
  margin-left: auto;
  font-size: 0.85em;
  opacity: 0.9;
  text-align: right;
  white-space: nowrap;
}

html[data-theme="dark"] .page__footer-updated {
  color: #ccc;
}

html[data-theme="dark"] .hidden-links {
  background: #3a3a3a;
  border-color: #5e5e5e;
}

html[data-theme="dark"] .hidden-links a {
  color: #fff;
}

html[data-theme="dark"] li,
html[data-theme="dark"] p,
html[data-theme="dark"] dt,
html[data-theme="dark"] dd {
  color: #fff;
}

html[data-theme="dark"] strong {
  color: #fff;
}

/* Course hub: week tabs and material rows (title + PDF). */
.page-courses .page__content p.course-weeks-intro {
  /* Theme p margin-bottom is 1.3em; keep 60% of that before the week tabs. */
  margin-bottom: calc(1.3em * 0.6);
}

.course-weeks {
  margin: 0.35em 0 0.25em;
}

.page-courses .page__content p.course-weeks-intro + .course-weeks {
  margin-top: calc(0.35em * 0.6);
}

.course-week-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.2rem;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #ccc;
}

.course-week-tabs [role="tab"] {
  appearance: none;
  margin: 0;
  padding: 0.45em 0.8em 0.5em;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: inherit;
  font-family: var(--font-display);
  font-size: 1.02em;
  font-weight: 600;
  letter-spacing: -0.015em;
  cursor: pointer;
}

.course-week-tabs [role="tab"]:hover {
  color: #1a73e8;
}

.course-week-tabs [role="tab"][aria-selected="true"] {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

.course-week-panel {
  display: flow-root;
  margin: 0;
  padding: 0 0 0.35em;
}

.course-week-panel[hidden] {
  display: none;
}

.page-courses .page__content h2,
.page-courses .page__content p.course-group-title {
  margin-top: 32px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  line-height: 1.2;
  border-bottom: 1px solid #ccc;
}

.page__content p.course-group-title {
  font-family: var(--font-display);
  font-size: 1.06em;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.page__content p.course-group-title + p.course-group-title {
  margin-top: 10px;
}

.page-courses .page__content p.course-group-title:has(+ p.course-group-title),
.page-courses .page__content p.course-group-title--no-rule {
  padding-bottom: 0;
  border-bottom: none;
}

.page-courses .page__content p.course-group-title:has(+ p.course-group-title) {
  margin-bottom: 4px;
}

.course-discussion {
  margin: 0.1em 0 0.15em;
  padding-left: 1.25em;
}

.course-discussion > li {
  margin: 0.35em 0;
}

.page__content p.course-group-title + .course-discussion > li:first-child,
.page__content p.course-group-title + .course-materials > li:first-child {
  margin-top: 0;
  padding-top: 0.16em;
}

.course-data-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 0;
  list-style: none;
  margin: 0 0 0.85em;
  padding: 0;
}

.course-data-list > li {
  margin: 0;
  padding: 0;
}

.course-data-list > li:not(:last-child)::after {
  content: ",";
  margin-right: 0.65em;
}

.course-materials {
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-materials > li {
  padding: 0.28em 0;
}

.course-material__title {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.course-material__pdf {
  margin-left: 0.35em;
  color: #c5221f;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.page__content a.course-material__pdf {
  color: #c5221f;
}

.page__content a.course-material__pdf:hover {
  color: #a50e0e;
}

.course-material__note {
  margin-left: 0.2em;
  color: #5f6368;
  font-weight: 600;
  white-space: nowrap;
}

.cv-download {
  margin: 0 0 1.35em;
}

.lecture-meta {
  margin: 0 0 0.65em;
  color: #5f6368;
}

.lecture-meta a {
  font-weight: 600;
}

body.page-lecture .page__content img {
  display: block;
  margin: 0.55em auto 0.7em;
  width: auto;
  height: auto;
  max-width: min(100%, 36rem);
  max-height: 16.5rem;
  object-fit: contain;
}

body.page-lecture .page__content pre,
body.page-lecture .page__content table,
body.page-lecture .page__content th,
body.page-lecture .page__content td,
body.page-lecture .page__content :not(pre) > code {
  text-align: left !important;
  hyphens: none;
  text-justify: auto;
}

body.page-lecture .page__content pre {
  margin: 0.45em 0;
  padding: 0.45em 0.7em;
  overflow-x: auto;
  background: #f4f6f8;
  border: 1px solid #e3e3e3;
  font-size: 0.84em;
  line-height: 1.35;
}

body.page-lecture .page__content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

body.page-lecture .page__content :not(pre) > code {
  padding: 0.08em 0.32em;
  background: #f4f6f8;
  font-size: 0.92em;
}

body.page-lecture .page__content .table-wrap {
  overflow-x: auto;
  margin: 0.5em 0;
}

body.page-lecture .page__content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

body.page-lecture .page__content th,
body.page-lecture .page__content td {
  padding: 0.4em 0.55em;
  border-bottom: 1px solid #e3e3e3;
  vertical-align: top;
}

body.page-lecture .page__content th {
  font-weight: 600;
}

body.page-lecture .page__content hr {
  margin: 0.85em 0;
  border: none;
  border-top: 1px solid #e3e3e3;
}

body.page-lecture .page__content blockquote {
  margin: 1em 0;
  padding: 0.1em 0 0.1em 0.9em;
  border-left: 3px solid #1a73e8;
}

html[data-theme="dark"] .course-group-title {
  color: #e6edf3;
}

html[data-theme="dark"] .page-courses .page__content h2,
html[data-theme="dark"] .page-courses .page__content p.course-group-title {
  border-bottom-color: #5e5e5e;
}

html[data-theme="dark"] .course-week-tabs {
  border-bottom-color: #5e5e5e;
}

html[data-theme="dark"] .course-week-tabs [role="tab"]:hover,
html[data-theme="dark"] .course-week-tabs [role="tab"][aria-selected="true"] {
  color: #79c0ff;
}

html[data-theme="dark"] .course-week-tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: #58a6ff;
}

html[data-theme="dark"] .lecture-meta {
  color: #b0b0b0;
}

html[data-theme="dark"] body.page-lecture .page__content pre,
html[data-theme="dark"] body.page-lecture .page__content :not(pre) > code {
  background: #3a3a3a;
  border-color: #5e5e5e;
  color: #fff;
}

html[data-theme="dark"] body.page-lecture .page__content th,
html[data-theme="dark"] body.page-lecture .page__content td,
html[data-theme="dark"] body.page-lecture .page__content hr {
  border-color: #5e5e5e;
}

html[data-theme="dark"] body.page-lecture .page__content blockquote {
  border-left-color: #58a6ff;
}

.lab-solutions-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 1.1em 0 0.4em;
}

.lab-solutions-form label {
  font-weight: 600;
}

.lab-solutions-form input[type="password"] {
  min-width: 14em;
  padding: 0.45em 0.65em;
  border: 1px solid #c4c7c5;
  font: inherit;
}

.lab-solutions-form button {
  appearance: none;
  padding: 0.45em 0.9em;
  border: 1px solid #0b57d0;
  background: #0b57d0;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lab-solutions-status {
  min-height: 1.4em;
  margin: 0.35em 0 1em;
}

.lab-solutions-status.is-error {
  color: #c5221f;
}

html[data-theme="dark"] .lab-solutions-form input[type="password"] {
  border-color: #5e5e5e;
  background: #3a3a3a;
  color: #fff;
}

html[data-theme="dark"] .lab-solutions-status.is-error {
  color: #ff7b72;
}

/* Cover banner (LinkedIn-style research graphic) and paper figures. */
.site-cover {
  margin: 1.15em 0;
}

.site-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #fff;
}

.site-cover figcaption,
.paper-figure figcaption {
  margin: 0.45em 0 0;
  font-size: 0.9em;
  line-height: 1.4;
  color: #5f6368;
  text-align: left;
}

.student-callout {
  margin: 0.85em 0 1.6em;
  padding: 0.85em 1.05em 0.15em;
  border-left: 3px solid #1a73e8;
  background: #f4f7fb;
}

.student-callout p:last-child {
  margin-bottom: 0.85em;
}

.research-rep {
  margin: 1.25em 0 1.65em;
}

.research-rep h4 {
  margin: 0 0 0.2em;
  font-size: 1.05em;
  font-weight: 600;
  line-height: 1.35;
}

.research-rep__venue {
  margin: 0 0 0.55em;
  color: #5f6368;
  font-size: 0.94em;
}

.paper-figure {
  margin: 0.9em auto 0.35em;
  max-width: 28rem;
}

.paper-figure img {
  width: 100%;
  height: 20rem;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
  padding: 0.45em;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 6px;
}

.paper-figure--wide {
  max-width: 100%;
}

.paper-figure--wide img {
  width: 100%;
  height: auto;
}

html[data-theme="dark"] .site-cover figcaption,
html[data-theme="dark"] .paper-figure figcaption,
html[data-theme="dark"] .research-rep__venue {
  color: #b0b0b0;
}

html[data-theme="dark"] .student-callout {
  background: #2f2f2f;
  border-left-color: #58a6ff;
}

html[data-theme="dark"] .paper-figure img,
html[data-theme="dark"] .site-cover img {
  border-color: #5e5e5e;
  background: #fff;
}

.page__content math {
  font-family: "Cambria Math", "Latin Modern Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 1.05em;
  text-align: initial;
  text-justify: auto;
  hyphens: none;
}

.page__content math[display="block"] {
  display: block;
  margin: 0.9em 0;
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
}

.page__content td math,
.page__content th math {
  white-space: nowrap;
}

html[data-theme="dark"] .page__content math {
  color: inherit;
}

.course-week-index {
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-week-index > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 0.55em 0;
  border-bottom: 1px solid #e6e6e6;
}

.course-week-index__meta {
  color: #5f6368;
}

.course-page-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
}

.course-page-nav a {
  font-weight: 600;
  text-decoration: none;
}

.course-page-nav__prev,
.course-page-nav__next {
  flex: 1 1 0;
}

.course-page-nav__next {
  text-align: right;
}

.course-page-nav__week {
  flex: 0 0 auto;
  color: #5f6368;
  font-weight: 600;
}

html[data-theme="dark"] .course-week-index > li {
  border-bottom-color: #5e5e5e;
}

html[data-theme="dark"] .course-week-index__meta,
html[data-theme="dark"] .course-page-nav__week {
  color: #b0b0b0;
}

html[data-theme="dark"] .course-page-nav {
  border-top-color: #5e5e5e;
}

/* ==========================================================================
   LECTURE READABILITY
   Softer text, colored headings, and distinct code / output blocks.
   Code classes (code-r, code-python, code-output) and tok-* spans are
   added by initLectureCode() in site.js.
   ========================================================================== */

body.page-lecture .page__title {
  font-size: 1.7em;
  margin: 0 0 0.2em;
}

body.page-lecture .page__content ul,
body.page-lecture .page__content ol {
  margin-top: 0.15em;
  margin-bottom: 0.35em;
}

body.page-lecture #main > .page .page__content p,
body.page-lecture #main > .page .page__content li {
  line-height: 1.45;
  text-align: left !important;
  hyphens: manual;
}

body.page-lecture .page__content p {
  margin-bottom: 0.45em;
}

body.page-lecture .page__content li {
  margin-bottom: 0.16em;
}

body.page-lecture .page__content h2 {
  margin-top: 0.95em;
  padding-bottom: 0.18em;
  color: #0b4f8a;
  border-bottom: 2px solid #d6e4f5;
}

body.page-lecture .page__content h3 {
  margin-top: 0.75em;
  color: #1f6f6b;
}

body.page-lecture .page__content strong {
  color: #1b1f24;
  background: linear-gradient(transparent 64%, #fff0a6 64%);
}

body.page-lecture .page__content :not(pre) > code {
  color: #9a3412;
  background: #fdf3ec;
  border: 1px solid #f5dcc8;
  border-radius: 4px;
}

body.page-lecture .page__content a code {
  color: inherit;
}

body.page-lecture .page__content h2 > code:not(pre),
body.page-lecture .page__content h3 > code:not(pre),
html[data-theme="dark"] body.page-lecture .page__content h2 > code:not(pre),
html[data-theme="dark"] body.page-lecture .page__content h3 > code:not(pre) {
  color: inherit;
  background: none;
  border: none;
  padding: 0;
}

body.page-lecture .page__content pre.code-r,
body.page-lecture .page__content pre.code-python,
body.page-lecture .page__content pre.code-output {
  border-radius: 6px;
  border-left-width: 4px;
}

body.page-lecture .page__content pre.code-r,
body.page-lecture .page__content pre.code-python {
  background: #f5f8fc;
  border-color: #dbe5f0;
  border-left-color: #3b82c4;
  color: #24292f;
}

body.page-lecture .page__content pre.code-python {
  border-left-color: #d9a400;
}

body.page-lecture .page__content pre.code-output {
  background: #fbfbf8;
  border-color: #e6e6df;
  border-left-color: #9aa5b1;
  color: #3d4450;
}

body.page-lecture .page__content pre.code-r + pre.code-output,
body.page-lecture .page__content pre.code-python + pre.code-output {
  margin-top: -0.15em;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

body.page-lecture .page__content .tok-comment { color: #6a737d; font-style: italic; }
body.page-lecture .page__content .tok-string { color: #0a7a3d; }
body.page-lecture .page__content .tok-number { color: #b35900; }
body.page-lecture .page__content .tok-keyword { color: #8250df; font-weight: 600; }
body.page-lecture .page__content .tok-func { color: #0b57d0; }
body.page-lecture .page__content .tok-operator { color: #c2185b; font-weight: 600; }
body.page-lecture .page__content .tok-prompt { color: #b3bac2; }

body.page-lecture .page__content th {
  background: #eef3fa;
  color: #0b4f8a;
}

body.page-lecture .page__content tbody tr:nth-child(even) td {
  background: #fafbfd;
}

body.page-lecture .page__content blockquote {
  padding: 0.5em 0.9em;
  background: #f3f7fd;
  border-radius: 0 6px 6px 0;
}

body.page-lecture .page__content img {
  border-radius: 6px;
}

html[data-theme="dark"] body.page-lecture .page__content,
html[data-theme="dark"] body.page-lecture .page__content p,
html[data-theme="dark"] body.page-lecture .page__content li {
  color: #e8e8e8;
}

html[data-theme="dark"] body.page-lecture .page__content h2 {
  color: #8cc4ff;
  border-bottom-color: #5a6b80;
}

html[data-theme="dark"] body.page-lecture .page__content h3 {
  color: #7fd6cf;
}

html[data-theme="dark"] body.page-lecture .page__content strong {
  color: #fff;
  background: linear-gradient(transparent 64%, rgba(255, 214, 102, 0.28) 64%);
}

html[data-theme="dark"] body.page-lecture .page__content :not(pre) > code {
  color: #ffb38a;
  background: #4a3f38;
  border-color: #6a5548;
}

html[data-theme="dark"] body.page-lecture .page__content pre.code-r,
html[data-theme="dark"] body.page-lecture .page__content pre.code-python {
  background: #33383f;
  border-color: #4d5560;
  border-left-color: #58a6ff;
  color: #eef1f4;
}

html[data-theme="dark"] body.page-lecture .page__content pre.code-python {
  border-left-color: #e3b341;
}

html[data-theme="dark"] body.page-lecture .page__content pre.code-output {
  background: #3b3b38;
  border-color: #55554f;
  border-left-color: #8b949e;
  color: #d6d6d0;
}

html[data-theme="dark"] body.page-lecture .page__content .tok-comment { color: #9aa4ae; }
html[data-theme="dark"] body.page-lecture .page__content .tok-string { color: #7ee2a8; }
html[data-theme="dark"] body.page-lecture .page__content .tok-number { color: #ffb86b; }
html[data-theme="dark"] body.page-lecture .page__content .tok-keyword { color: #c9a7ff; }
html[data-theme="dark"] body.page-lecture .page__content .tok-func { color: #79c0ff; }
html[data-theme="dark"] body.page-lecture .page__content .tok-operator { color: #ff7ab6; }
html[data-theme="dark"] body.page-lecture .page__content .tok-prompt { color: #6f7680; }

html[data-theme="dark"] body.page-lecture .page__content th {
  background: #3a4350;
  color: #cfe3ff;
}

html[data-theme="dark"] body.page-lecture .page__content tbody tr:nth-child(even) td {
  background: #4d4d4d;
}

html[data-theme="dark"] body.page-lecture .page__content blockquote {
  background: #3d4552;
}
