/* Colloquium Default Theme */

/* ===== Custom Properties ===== */
:root {
    --colloquium-bg: #ffffff;
    --colloquium-text: #1a1a2e;
    --colloquium-heading: #16213e;
    --colloquium-accent: #0f3460;
    --colloquium-link: #e94560;
    --colloquium-code-bg: #f4f4f8;
    --colloquium-code-text: #1a1a2e;
    --colloquium-muted: #6b7280;
    --colloquium-border: #e5e7eb;
    --colloquium-progress-bg: #e5e7eb;
    --colloquium-progress-fill: #0f3460;

    --colloquium-font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
    --colloquium-font-heading: "Inter", "Helvetica Neue", Arial, sans-serif;
    --colloquium-font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;

    /* 16:9 reference dimensions — slides are authored at this size and scaled */
    --colloquium-slide-width: 1280;
    --colloquium-slide-height: 720;
    --colloquium-slide-padding: 60px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--colloquium-font-body);
    color: var(--colloquium-text);
    background: #000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Slide Container — 16:9 scaling ===== */
/* The deck is a fixed 1280x720 canvas that gets CSS-transformed to fit the viewport */
.colloquium-deck {
    width: 1280px;
    height: 720px;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    background: var(--colloquium-bg);
    overflow: hidden;
}

.slide {
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    width: 1280px;
    height: 720px;
    padding: var(--colloquium-slide-padding);
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    font-size: 24px;
    line-height: 1.5;
    background: var(--colloquium-bg);
}

.slide.active {
    display: flex;
}

/* ===== Typography ===== */
.slide h1 {
    font-family: var(--colloquium-font-heading);
    font-size: 2.2em;
    font-weight: 700;
    color: var(--colloquium-heading);
    margin-bottom: 0.4em;
    line-height: 1.2;
}

.slide h2 {
    font-family: var(--colloquium-font-heading);
    font-size: 1.6em;
    font-weight: 600;
    color: var(--colloquium-heading);
    margin-bottom: 0.5em;
    line-height: 1.3;
}

.slide h3 {
    font-family: var(--colloquium-font-heading);
    font-size: 1.2em;
    font-weight: 600;
    color: var(--colloquium-heading);
    margin-bottom: 0.4em;
}

.slide p {
    margin-bottom: 0.8em;
}

.slide p:last-child {
    margin-bottom: 0;
}

.slide strong {
    font-weight: 600;
}

.slide em {
    font-style: italic;
}

/* ===== Lists ===== */
.slide ul, .slide ol {
    margin-bottom: 0.8em;
    padding-left: 1.4em;
}

.slide li {
    margin-bottom: 0.3em;
}

.slide li::marker {
    color: var(--colloquium-accent);
}

/* ===== Links ===== */
.slide a {
    color: var(--colloquium-link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.slide a:hover {
    border-bottom-color: var(--colloquium-link);
}

/* ===== Code ===== */
.slide code {
    font-family: var(--colloquium-font-mono);
    font-size: 0.85em;
    background: var(--colloquium-code-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    white-space: nowrap;
}

.slide pre {
    background: var(--colloquium-code-bg);
    border-radius: 8px;
    padding: 1em 1.2em;
    margin-bottom: 0.8em;
    overflow-x: hidden;
    font-size: 0.75em;
    line-height: 1.5;
}

.slide pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== Images ===== */
.slide img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    object-fit: contain;
}

.slide .slide-content {
    flex: 1;
    min-height: 0;
    overflow: visible;
}

.slide .slide-content img {
    max-height: calc(720px - var(--colloquium-slide-padding) * 2 - 100px);
    display: block;
}

.slide figure.colloquium-figure {
    margin: 0 auto 0.8em;
    max-width: 100%;
    width: fit-content;
}

.slide figure.colloquium-figure > img {
    display: block;
}

.slide figure.colloquium-figure > figcaption {
    margin-top: 0.45em;
    font-size: 0.6em;
    line-height: 1.35;
    color: var(--colloquium-muted);
}

.slide.figure-caption,
.slide.figure-captions {
    counter-reset: colloquium-figure;
}

.slide.figure-caption figure.colloquium-figure,
.slide.figure-captions figure.colloquium-figure {
    counter-increment: colloquium-figure;
}

.slide.figure-caption figure.colloquium-figure > figcaption::before,
.slide.figure-captions figure.colloquium-figure > figcaption::before {
    content: "Figure " counter(colloquium-figure) ": ";
    color: var(--colloquium-heading);
    font-weight: 600;
}

/* ===== Box ===== */
.colloquium-box {
    border-radius: 18px;
    padding: 0.85em 1em;
    width: 100%;
    box-sizing: border-box;
}

.colloquium-box--accent {
    background: var(--colloquium-accent);
    color: white;
}

.colloquium-box--muted {
    background: var(--colloquium-code-bg);
    color: var(--colloquium-text);
}

.colloquium-box--surface {
    background: color-mix(in srgb, var(--colloquium-bg) 85%, white 15%);
    color: var(--colloquium-text);
    border: 1px solid var(--colloquium-border);
}

.colloquium-box--align-center {
    text-align: center;
}

.colloquium-box--align-right {
    text-align: right;
}

.colloquium-box-title {
    font-weight: 700;
    margin-bottom: 0.35em;
}

.colloquium-box-content > :first-child {
    margin-top: 0;
}

.colloquium-box-content > :last-child {
    margin-bottom: 0;
}

.colloquium-box ul,
.colloquium-box ol {
    margin-bottom: 0;
    padding-left: 1.25em;
}

.colloquium-box li::marker {
    color: var(--colloquium-accent);
}

.colloquium-box--compact .colloquium-box-title {
    margin-bottom: 0.25em;
}

.colloquium-box--compact .colloquium-box-content p {
    margin: 0.3em 0;
}

.colloquium-box--compact ul,
.colloquium-box--compact ol {
    margin-top: 0.35em;
    margin-bottom: 0;
    padding-left: 1.2em;
}

.colloquium-box--compact li {
    margin-bottom: 0.08em;
    line-height: 1.14;
}

.colloquium-box--compact li + li {
    margin-top: 0.02em;
}

.colloquium-box--accent li::marker {
    color: white;
}

.colloquium-box--accent a,
.colloquium-box--accent strong,
.colloquium-box--accent em,
.colloquium-box--accent code {
    color: inherit;
}

.colloquium-box--accent code {
    background: color-mix(in srgb, black 12%, transparent);
}

/* ===== Charts ===== */
.colloquium-chart-container {
    width: 100%;
    height: 400px;
    margin: 0.5em 0;
}

.slide .slide-content img.colloquium-chart-print {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: none;
}

/* ===== Tables ===== */
.slide table {
    border-collapse: collapse;
    margin-bottom: 0.8em;
    font-size: 0.85em;
    width: 100%;
}

.slide th, .slide td {
    border: 1px solid var(--colloquium-border);
    padding: 0.4em 0.7em;
    text-align: left;
}

.slide th {
    background: var(--colloquium-code-bg);
    font-weight: 600;
}

/* ===== Blockquotes ===== */
.slide blockquote {
    border-left: 4px solid var(--colloquium-accent);
    padding-left: 1em;
    margin-bottom: 0.8em;
    color: var(--colloquium-muted);
    font-style: italic;
}

/* ===== Horizontal Rule ===== */
.slide hr {
    border: none;
    border-top: 2px solid var(--colloquium-border);
    margin: 1em 0;
}

/* ===== Math (KaTeX) ===== */
.slide .katex-display {
    margin: 0.8em 0;
    overflow-x: hidden;
    overflow-x: clip;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    touch-action: pan-y;
    overscroll-behavior-x: none;
}

.slide .katex-display .katex {
    max-width: 100%;
    pointer-events: none;
}

.slide .katex-display::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ===== Layout: Title Slide ===== */
.slide--title {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.slide--title.active {
    display: flex;
}

.slide--title h1 {
    font-size: 2.8em;
    margin-bottom: 0.3em;
}

.slide--title .slide-content {
    flex: 0 0 auto;
}

.slide--title .slide-content p {
    font-size: 1.1em;
    color: var(--colloquium-muted);
}

/* Shared title-slide components */
.colloquium-title-eyebrow {
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--colloquium-accent);
    margin-bottom: 1.1em;
}

.colloquium-title-rule {
    width: 84px;
    height: 4px;
    border-radius: 999px;
    background: var(--colloquium-accent);
    margin-bottom: 1.4em;
}

.colloquium-title-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
}

.colloquium-title-meta p {
    margin: 0;
    color: var(--colloquium-muted);
}

.colloquium-title-name {
    font-size: 1.55em;
    font-weight: 500;
    color: var(--colloquium-heading);
}

.colloquium-title-note {
    font-size: 0.9em;
    line-height: 1.45;
    color: var(--colloquium-muted);
    max-width: 26em;
}

/* ===== Layout: Title Left ===== */
.slide--title-left {
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    padding: 72px 84px 60px;
}

.slide--title-left.active {
    display: flex;
}

.slide--title-left h1 {
    max-width: 980px;
    font-size: 3em;
    line-height: 1.02;
    letter-spacing: -0.05em;
    margin-bottom: 0.95em;
}

.slide--title-left .slide-content {
    flex: 0 0 auto;
    max-width: 560px;
}

.slide--title-left .slide-content > * + * {
    margin-top: 1em;
}

/* ===== Layout: Title Sidebar ===== */
.slide--title-sidebar {
    padding: 72px 84px 60px;
}

.slide--title-sidebar.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 56px;
    align-content: center;
    align-items: start;
}

.slide--title-sidebar h1 {
    grid-column: 1;
    align-self: start;
    max-width: 760px;
    font-size: 2.9em;
    line-height: 1.03;
    letter-spacing: -0.045em;
    text-align: left;
    margin: 0;
}

.slide--title-sidebar .slide-content {
    grid-column: 2;
    align-self: start;
    position: relative;
    padding: 0 0 24px 28px;
}

.slide--title-sidebar .slide-content::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 24px;
    left: 0;
    width: 3px;
    border-radius: 999px;
    background: var(--colloquium-accent);
}

.slide--title-sidebar .slide-content > * + * {
    margin-top: 1em;
}

.slide--title-sidebar.title-sidebar-rule-full .slide-content {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.slide--title-sidebar.title-sidebar-rule-full .slide-content::before {
    bottom: 0;
}

/* Title-sidebar uses grid, so vertical positioning maps to align-content. */
.slide--title-sidebar.valign-top.active {
    align-content: start;
}

.slide--title-sidebar.valign-center.active {
    align-content: center;
}

.slide--title-sidebar.valign-bottom.active {
    align-content: end;
}

/* ===== Layout: Title Banner ===== */
.slide--title-banner {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    padding: 72px 84px 60px;
}

.slide--title-banner.active {
    display: flex;
}

.slide--title-banner h1 {
    max-width: 980px;
    font-size: 3em;
    line-height: 1.02;
    letter-spacing: -0.05em;
    margin-bottom: 0.45em;
}

.slide--title-banner .slide-content {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    max-width: 620px;
}

.slide--title-banner .slide-content > * + * {
    margin-top: 1em;
}

/* ===== Layout: Section Break ===== */
.slide--section-break {
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--colloquium-accent);
    color: #ffffff;
}

.slide--section-break.active {
    display: flex;
}

.slide--section-break h2 {
    color: #ffffff;
    font-size: 2.2em;
}

.slide--section-break .slide-content {
    color: rgba(255, 255, 255, 0.85);
}

/* ===== Layout: Two Column ===== */
.slide--two-column .slide-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    align-items: start;
    width: 100%;
}

/* ===== Layout: Image Left ===== */
.slide--image-left .slide-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    align-items: center;
    width: 100%;
}

.slide--image-left .slide-content img {
    max-height: 500px;
}

/* ===== Layout: Image Right ===== */
.slide--image-right .slide-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    align-items: center;
    width: 100%;
}

.slide--image-right .slide-content img {
    max-height: 500px;
    order: 2;
}

/* ===== Layout: Code ===== */
.slide--code pre {
    font-size: 0.7em;
    max-height: 500px;
}

/* ===== Utility: Title Position ===== */
.title-top.active { justify-content: flex-start; }
.title-center.active { justify-content: center; align-items: center; text-align: center; }
.title-hidden h1, .title-hidden h2 { display: none; }

/* ===== Utility: Text Alignment ===== */
.align-left.active { text-align: left; }
.align-center.active { text-align: center; }
.align-right.active { text-align: right; }

.align-center.active .slide-content > img,
.align-center.active .slide-content > p > img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.align-left.active .slide-content > img,
.align-left.active .slide-content > p > img {
    display: block;
    margin-right: auto;
}

.align-right.active .slide-content > img,
.align-right.active .slide-content > p > img {
    display: block;
    margin-left: auto;
}

/* ===== Utility: Vertical Alignment ===== */
.valign-top.active { justify-content: flex-start; }
.valign-center.active { justify-content: center; }
.valign-bottom.active { justify-content: flex-end; }

/* ===== Utility: Columns ===== */
.colloquium-grid {
    display: grid;
    gap: 2em;
    align-items: stretch;
    width: 100%;
}

/* ===== Utility: Rows ===== */
.colloquium-rows {
    display: grid;
    gap: 0.9em;
    width: 100%;
    min-height: 0;
    flex: 1;
}

.colloquium-row {
    min-height: 0;
}

/* Images in grid layouts: fit within the available content height */
.colloquium-grid img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(720px - var(--colloquium-slide-padding) * 2 - 100px);
    object-fit: contain;
}

.colloquium-rows img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

.colloquium-grid > .col,
.colloquium-rows > .colloquium-row {
    min-width: 0;
    min-height: 0;
    overflow: visible;
}

.slide .slide-content:has(> figure.colloquium-figure:first-child:last-child),
.slide .colloquium-grid > .col:has(> figure.colloquium-figure:first-child:last-child),
.slide .colloquium-row:has(> figure.colloquium-figure:first-child:last-child) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.colloquium-grid > .col > :last-child,
.colloquium-rows > .colloquium-row > :last-child {
    margin-bottom: 0;
}

/* Standalone images inside grid cells should fit the cell by default. */
.slide .colloquium-grid > .col > p:first-child:last-child:has(> img),
.slide .colloquium-row > p:first-child:last-child:has(> img) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.slide.img-valign-top .colloquium-grid > .col > p:first-child:last-child:has(> img),
.slide.img-valign-top .colloquium-row > p:first-child:last-child:has(> img) {
    align-items: flex-start;
}

.slide.img-valign-center .colloquium-grid > .col > p:first-child:last-child:has(> img),
.slide.img-valign-center .colloquium-row > p:first-child:last-child:has(> img) {
    align-items: center;
}

.slide.img-valign-bottom .colloquium-grid > .col > p:first-child:last-child:has(> img),
.slide.img-valign-bottom .colloquium-row > p:first-child:last-child:has(> img) {
    align-items: flex-end;
}

.slide.img-valign-center .slide-content:has(> figure.colloquium-figure:first-child:last-child),
.slide.img-valign-center .colloquium-grid > .col:has(> figure.colloquium-figure:first-child:last-child),
.slide.img-valign-center .colloquium-row:has(> figure.colloquium-figure:first-child:last-child) {
    justify-content: center;
}

.slide.img-valign-bottom .slide-content:has(> figure.colloquium-figure:first-child:last-child),
.slide.img-valign-bottom .colloquium-grid > .col:has(> figure.colloquium-figure:first-child:last-child),
.slide.img-valign-bottom .colloquium-row:has(> figure.colloquium-figure:first-child:last-child) {
    justify-content: flex-end;
}

.slide .slide-content > figure.colloquium-figure:first-child:last-child,
.slide .colloquium-grid > .col > figure.colloquium-figure:first-child:last-child,
.slide .colloquium-row > figure.colloquium-figure:first-child:last-child {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: auto;
    height: auto;
    max-height: none;
    margin: 0;
    overflow: visible;
}

.slide .colloquium-grid > .col > p:first-child:last-child:has(> img) > img,
.slide .colloquium-row > p:first-child:last-child:has(> img) > img {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: top center;
    min-height: 0;
}

.slide .slide-content > figure.colloquium-figure:first-child:last-child > img,
.slide .colloquium-grid > .col > figure.colloquium-figure:first-child:last-child > img,
.slide .colloquium-row > figure.colloquium-figure:first-child:last-child > img {
    width: auto;
    height: auto;
    flex: 0 0 auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: top center;
    min-height: 0;
}

.slide.img-valign-top .colloquium-grid > .col > p:first-child:last-child:has(> img) > img,
.slide.img-valign-top .colloquium-row > p:first-child:last-child:has(> img) > img,
.slide.img-valign-top .slide-content > figure.colloquium-figure:first-child:last-child > img,
.slide.img-valign-top .colloquium-grid > .col > figure.colloquium-figure:first-child:last-child > img,
.slide.img-valign-top .colloquium-row > figure.colloquium-figure:first-child:last-child > img {
    object-position: top center;
}

.slide.img-valign-center .colloquium-grid > .col > p:first-child:last-child:has(> img) > img,
.slide.img-valign-center .colloquium-row > p:first-child:last-child:has(> img) > img,
.slide.img-valign-center .slide-content > figure.colloquium-figure:first-child:last-child > img,
.slide.img-valign-center .colloquium-grid > .col > figure.colloquium-figure:first-child:last-child > img,
.slide.img-valign-center .colloquium-row > figure.colloquium-figure:first-child:last-child > img {
    object-position: center center;
}

.slide.img-valign-bottom .colloquium-grid > .col > p:first-child:last-child:has(> img) > img,
.slide.img-valign-bottom .colloquium-row > p:first-child:last-child:has(> img) > img,
.slide.img-valign-bottom .slide-content > figure.colloquium-figure:first-child:last-child > img,
.slide.img-valign-bottom .colloquium-grid > .col > figure.colloquium-figure:first-child:last-child > img,
.slide.img-valign-bottom .colloquium-row > figure.colloquium-figure:first-child:last-child > img {
    object-position: bottom center;
}

.img-overflow .colloquium-grid > .col,
.img-overflow .colloquium-rows > .colloquium-row,
.img-overflow .slide-content {
    overflow: visible;
}

.slide.img-overflow .colloquium-grid > .col > p:first-child:last-child:has(> img),
.slide.img-overflow .colloquium-row > p:first-child:last-child:has(> img),
.slide.img-overflow .slide-content > figure.colloquium-figure:first-child:last-child,
.slide.img-overflow .colloquium-grid > .col > figure.colloquium-figure:first-child:last-child,
.slide.img-overflow .colloquium-row > figure.colloquium-figure:first-child:last-child {
    overflow: visible;
}

.slide.img-overflow .colloquium-grid > .col > p:first-child:last-child:has(> img) > img,
.slide.img-overflow .colloquium-row > p:first-child:last-child:has(> img) > img,
.slide.img-overflow .slide-content > figure.colloquium-figure:first-child:last-child > img,
.slide.img-overflow .colloquium-grid > .col > figure.colloquium-figure:first-child:last-child > img,
.slide.img-overflow .colloquium-row > figure.colloquium-figure:first-child:last-child > img {
    width: auto;
    height: auto;
    flex: 0 0 auto;
    max-width: none;
    max-height: none;
}

/* ===== Utility: Image Alignment (independent of title) ===== */
.img-align-center .slide-content img,
.img-align-left .slide-content img,
.img-align-right .slide-content img {
    display: block;
}

.img-align-center .slide-content img { margin-left: auto; margin-right: auto; }
.img-align-left .slide-content img { margin-right: auto; }
.img-align-right .slide-content img { margin-left: auto; }

/* ===== Utility: Image Fill ===== */
.img-fill .slide-content img {
    max-height: none;
    max-width: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.img-fill .slide-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

/* ===== Utility: Padding ===== */
.pad-compact.active { padding: 30px; }
.pad-normal.active  { padding: 60px; }
.pad-wide.active    { padding: 90px; }

/* ===== Utility: Font Size (slide-level) ===== */
.size-small.active  { font-size: 20px; }
.size-normal.active { font-size: 24px; }
.size-large.active  { font-size: 28px; }

/* ===== Utility: Inline/Block Text Size ===== */
.text-xs { font-size: 0.65em; }
.text-sm { font-size: 0.8em; }
.text-base { font-size: 1em; }
.text-lg { font-size: 1.2em; }
.text-xl { font-size: 1.4em; }
.text-2xl { font-size: 1.7em; }
.text-3xl { font-size: 2.2em; }
.text-4xl { font-size: 2.8em; }

/* ===== Utility: Spacing ===== */
.colloquium-spacer-sm { height: 0.75em; }
.colloquium-spacer-md { height: 1.25em; }
.colloquium-spacer-lg { height: 2em; }

/* ===== Utility: Footnotes ===== */
.colloquium-footnote {
    margin-top: 1em;
    font-size: 0.68em;
    line-height: 1.35;
    color: var(--colloquium-muted);
}

.colloquium-footnote p {
    margin: 0.35em 0 0;
}

.colloquium-footnote p:first-child {
    margin-top: 0;
}

/* ===== Footer (inside each slide) ===== */
.colloquium-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-size: 13px;
    color: var(--colloquium-muted);
    user-select: none;
}

.colloquium-footer-left,
.colloquium-footer-center,
.colloquium-footer-right {
    display: flex;
    align-items: center;
}

.colloquium-footer-left   { justify-content: flex-start; }
.colloquium-footer-center { justify-content: center; flex: 1; }
.colloquium-footer-right  { justify-content: flex-end; }

.colloquium-footer-nav {
    cursor: pointer;
}

.slide .colloquium-footer-logo {
    height: 24px;
    width: auto;
    border-radius: 0;
    max-height: none;
}

.colloquium-counter {
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.colloquium-counter:hover {
    opacity: 1;
}

.colloquium-footer-nav:hover {
    color: var(--colloquium-accent);
}

/* Inverted footer on section breaks */
.slide--section-break .colloquium-footer {
    color: rgba(255, 255, 255, 0.6);
}

/* ===== Slide Picker Overlay ===== */
.colloquium-picker-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
}

.colloquium-picker-overlay.active {
    display: block;
}

.colloquium-picker {
    position: absolute;
    bottom: 48px;
    right: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-height: 70vh;
    overflow-y: auto;
    width: 360px;
    padding: 8px 0;
}

.colloquium-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 20px;
    border: none;
    background: none;
    font-family: var(--colloquium-font-body);
    font-size: 15px;
    color: var(--colloquium-text);
    cursor: pointer;
    text-align: left;
}

.colloquium-picker-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.colloquium-picker-item:hover {
    background: var(--colloquium-code-bg);
}

.colloquium-picker-item.current {
    color: var(--colloquium-accent);
    font-weight: 600;
}

.colloquium-picker-num {
    min-width: 28px;
    color: var(--colloquium-muted);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    text-align: right;
}

.colloquium-picker-item.current .colloquium-picker-num {
    color: var(--colloquium-accent);
}

/* ===== Picker Trigger ===== */
.colloquium-picker-trigger {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 155;
    display: none;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--colloquium-heading);
    font-family: var(--colloquium-font-body);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.colloquium-picker-trigger:hover {
    background: #fff;
}

.colloquium-picker-trigger-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--colloquium-muted);
}

.colloquium-picker-trigger-count {
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--colloquium-accent);
}

/* ===== Present Button ===== */
.colloquium-present {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 150;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--colloquium-accent);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

body:hover .colloquium-present {
    opacity: 0.7;
}

.colloquium-present:hover {
    opacity: 1 !important;
}

/* Hide when already fullscreen */
:fullscreen .colloquium-present {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .colloquium-present {
        display: none !important;
    }

    .colloquium-picker-trigger {
        display: flex;
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        min-height: 52px;
        padding: 12px 16px;
        gap: 12px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 6px 24px rgba(0,0,0,0.22);
    }

    .colloquium-picker-trigger-label {
        font-size: 12px;
    }

    .colloquium-picker-trigger-count {
        font-size: 16px;
    }

    .colloquium-picker {
        right: 12px;
        left: 12px;
        bottom: 76px;
        width: auto;
        max-height: min(72vh, 560px);
    }
}

/* ===== Overflow Warning ===== */
.colloquium-overflow-warn {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(
        90deg, #e94560 0, #e94560 8px, transparent 8px, transparent 16px
    );
    opacity: 0.8;
    pointer-events: none;
}

:fullscreen .colloquium-overflow-warn {
    display: none;
}

/* ===== Progress Bar ===== */
.colloquium-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--colloquium-progress-bg);
    z-index: 100;
}

.colloquium-progress-bar {
    height: 100%;
    background: var(--colloquium-progress-fill);
    transition: width 0.3s ease;
}

/* ===== Conversation Bubbles ===== */
.colloquium-conversation {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    width: 100%;
}

.colloquium-message {
    max-width: 80%;
    border-radius: 12px;
    padding: 0.5em 0.8em;
}

.colloquium-message--user {
    align-self: flex-end;
    background: var(--colloquium-accent);
    color: #ffffff;
}

.colloquium-message--assistant {
    align-self: flex-start;
    background: var(--colloquium-code-bg);
    color: var(--colloquium-text);
}

.colloquium-message--system {
    align-self: center;
    border: 1px solid var(--colloquium-border);
    background: transparent;
    color: var(--colloquium-muted);
    font-style: italic;
    font-size: 0.85em;
    max-width: 90%;
}

.colloquium-message-role {
    font-size: 0.65em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15em;
    opacity: 0.75;
}

.colloquium-message--user .colloquium-message-role {
    color: rgba(255, 255, 255, 0.85);
}

.colloquium-message-role-name {
    display: inline;
}

.colloquium-message-model {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    opacity: 0.9;
}

.colloquium-message-content p {
    margin: 0 0 0.3em;
    white-space: pre-line;
}

.colloquium-message-content p:last-child {
    margin-bottom: 0;
}

.colloquium-message-content li {
    white-space: pre-line;
}

.colloquium-message-content code {
    font-size: 0.85em;
}

.colloquium-message--user .colloquium-message-content code {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Built With Badge ===== */
.slide a.colloquium-builtwith {
    display: inline-flex;
    align-items: center;
    gap: 0.75em;
    max-width: 100%;
    padding: 0.55em 0.8em;
    border: 1px solid color-mix(in srgb, var(--colloquium-border) 75%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--colloquium-code-bg) 75%, white 25%);
    color: var(--colloquium-text);
    text-decoration: none;
    line-height: 1.1;
}

.slide a.colloquium-builtwith:hover {
    border-color: color-mix(in srgb, var(--colloquium-accent) 55%, var(--colloquium-border) 45%);
    color: var(--colloquium-heading);
}

.colloquium-builtwith-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
}

.colloquium-builtwith-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.colloquium-builtwith-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05em;
}

.colloquium-builtwith-label {
    font-size: 0.6em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--colloquium-muted);
}

.colloquium-builtwith-repo {
    font-size: 0.82em;
    font-weight: 600;
    white-space: nowrap;
}

.colloquium-builtwith-stars {
    font-size: 0.72em;
    color: var(--colloquium-muted);
    white-space: nowrap;
    flex: 0 0 auto;
}

/* ===== Citations ===== */
.slide a.colloquium-cite {
    color: var(--colloquium-accent);
    text-decoration: none;
    font-size: 0.85em;
    white-space: nowrap;
}

.slide a.colloquium-cite:hover {
    text-decoration: underline;
}

.colloquium-footnote-ref {
    font-size: 0.65em;
    line-height: 0;
    vertical-align: super;
}

.slide .colloquium-footnote-ref a {
    color: var(--colloquium-accent);
    text-decoration: none;
}

.slide .colloquium-footnote-ref a:hover {
    text-decoration: underline;
}

.colloquium-cite-missing {
    color: #dc2626;
    font-weight: 600;
}

/* ===== Per-Slide Footnote Area ===== */
.colloquium-slide-meta {
    position: absolute;
    bottom: 40px;
    font-size: 12px;
    color: var(--colloquium-muted);
    max-width: 40%;
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    z-index: 4;
}

.colloquium-slide-meta--left {
    left: 24px;
    align-items: flex-start;
    text-align: left;
}

.colloquium-slide-meta--right {
    right: 24px;
    align-items: flex-end;
    text-align: right;
}

.colloquium-slide-cite,
.colloquium-slide-footnote {
    max-width: 100%;
}

.colloquium-slide-cite {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.colloquium-slide-cite a.colloquium-cite {
    font-size: inherit;
    color: var(--colloquium-accent);
}

.colloquium-slide-cite a.colloquium-cite:hover {
    color: var(--colloquium-heading);
}

.colloquium-slide-footnote {
    line-height: 1.35;
}

.colloquium-slide-footnote-item + .colloquium-slide-footnote-item {
    margin-top: 0.15em;
}

.colloquium-slide-footnote-label {
    font-weight: 600;
}

.colloquium-slide-footnote-text {
    display: inline;
}

.colloquium-slide-footnote-text .colloquium-cite {
    white-space: normal;
}

.colloquium-slide-footnote > :first-child {
    margin-top: 0;
}

.colloquium-slide-footnote > :last-child {
    margin-bottom: 0;
}

.colloquium-slide-meta--right .colloquium-slide-footnote ul,
.colloquium-slide-meta--right .colloquium-slide-footnote ol {
    padding-right: 1.2em;
    padding-left: 0;
    list-style-position: inside;
}

/* ===== References Slide ===== */
.colloquium-references-slide {
}

.colloquium-reference {
    padding-left: 2em;
    text-indent: -2em;
    margin-bottom: 0.6em;
    font-size: 0.75em;
    line-height: 1.5;
}

.colloquium-ref-url {
    color: var(--colloquium-muted);
    font-size: 0.9em;
    text-decoration: none;
}

.colloquium-ref-url:hover {
    color: var(--colloquium-accent);
    text-decoration: underline;
}

/* ===== Print / PDF Styles ===== */
@page {
    size: 13.333in 7.5in;  /* 16:9 widescreen at 96 CSS px/in => 1280x720 */
    margin: 0;
}

@media print {
    html, body {
        width: 13.333in;
        height: auto;
        overflow: visible;
        background: #fff;
        margin: 0;
        padding: 0;
    }

    .colloquium-deck {
        position: static;
        transform: none !important;
        width: auto;
        height: auto;
        background: none;
    }

    .slide {
        display: flex !important;
        position: relative;
        width: 1280px;
        height: 720px;
        page-break-after: always;
        page-break-inside: avoid;
        break-after: page;
        break-inside: avoid;
        margin: 0;
        font-size: 24px;
        overflow: visible;
    }

    .slide:last-child {
        page-break-after: auto;
    }

    /* Display equations can be clipped inside printed columns even when the
       right side of the slide has free space available. */
    .slide .katex-display {
        overflow: visible !important;
    }

    /* Hidden slides never get the runtime figure fit pass, so printed grid/row
       figures need an explicit container-sized fallback. */
    .slide .slide-content > figure.colloquium-figure:first-child:last-child,
    .slide .colloquium-grid > .col > figure.colloquium-figure:first-child:last-child,
    .slide .colloquium-row > figure.colloquium-figure:first-child:last-child {
        width: 100% !important;
        max-width: 100% !important;
    }

    .slide .slide-content > figure.colloquium-figure:first-child:last-child > img,
    .slide .colloquium-grid > .col > figure.colloquium-figure:first-child:last-child > img,
    .slide .colloquium-row > figure.colloquium-figure:first-child:last-child > img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: calc(720px - var(--colloquium-slide-padding) * 2 - 100px) !important;
    }

    /* Printed slides are not .active, so re-apply layout/utility rules without that gate. */
    .slide--title,
    .slide--title-left,
    .slide--title-banner,
    .slide--section-break {
        display: flex !important;
    }

    .slide--title-sidebar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 300px;
        column-gap: 56px;
        align-content: center;
        align-items: start;
    }

    .slide--title-sidebar.valign-top {
        align-content: start;
    }

    .slide--title-sidebar.valign-center {
        align-content: center;
    }

    .slide--title-sidebar.valign-bottom {
        align-content: end;
    }

    .title-top { justify-content: flex-start; }
    .title-center { justify-content: center; align-items: center; text-align: center; }

    .align-left { text-align: left; }
    .align-center { text-align: center; }
    .align-right { text-align: right; }

    .align-center .slide-content > img,
    .align-center .slide-content > p > img {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    .align-left .slide-content > img,
    .align-left .slide-content > p > img {
        display: block;
        margin-right: auto;
    }

    .align-right .slide-content > img,
    .align-right .slide-content > p > img {
        display: block;
        margin-left: auto;
    }

    .valign-top { justify-content: flex-start; }
    .valign-center { justify-content: center; }
    .valign-bottom { justify-content: flex-end; }

    .size-small { font-size: 20px; }
    .size-normal { font-size: 24px; }
    .size-large { font-size: 28px; }

    .colloquium-progress,
    .colloquium-picker-overlay,
    .colloquium-present,
    .colloquium-picker-trigger,
    .colloquium-overflow-warn {
        display: none !important;
    }

    .colloquium-counter {
        cursor: default;
    }

    a {
        color: inherit !important;
        text-decoration: underline;
    }

    .slide a.colloquium-cite,
    .colloquium-slide-cite a.colloquium-cite,
    .slide a.colloquium-ref-url {
        color: var(--colloquium-accent) !important;
    }

    /* Swap chart canvases for static images */
    .colloquium-chart-container canvas {
        display: none !important;
    }

    .colloquium-chart-print {
        display: block !important;
    }
}

/* ===== Capture mode — hide UI chrome for headless screenshots ===== */
.colloquium-capture .colloquium-present,
.colloquium-capture .colloquium-progress,
.colloquium-capture .colloquium-overflow-warn,
.colloquium-capture .colloquium-picker-overlay {
    display: none !important;
}
