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

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-caption: rgba(13, 17, 23, 0.88);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-dim: rgba(88, 166, 255, 0.15);
    --border: #30363d;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --nav-arrow-size: 48px;
    --drawer-width: 280px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-drawer: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Header === */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    flex-shrink: 0;
    position: relative;
    text-align: center;
}

.hamburger-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.header-content {
    text-align: center;
}

.site-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.site-title .brand {
    color: var(--accent);
}

.site-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1px;
    font-weight: 400;
}

/* === Hamburger Button === */
.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 1;
}

.hamburger-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* === Side Drawer === */
.drawer-overlay {
    display: none;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0; /* overridden by JS */
    width: var(--drawer-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    z-index: 51;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform var(--transition-drawer);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.drawer.closed {
    transform: translateX(-100%);
    box-shadow: none;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.drawer-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.drawer-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all var(--transition-fast);
}

.drawer-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.drawer-menu {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.drawer-item {
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition-fast);
    text-align: left;
    border-left: 3px solid transparent;
}

.drawer-item:hover {
    background: var(--bg-tertiary);
}

.drawer-item.active {
    background: var(--accent-dim);
    border-left-color: var(--accent);
}

.drawer-item-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.drawer-item.active .drawer-item-icon {
    color: var(--accent);
}

.drawer-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.drawer-item-label {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
}

.drawer-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.drawer-item.active .drawer-item-label {
    color: var(--accent);
}

.drawer-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 20px;
    flex-shrink: 0;
}

.drawer-menu-secondary {
    flex: none;
    overflow-y: visible;
}

.drawer-menu-secondary .drawer-item {
    text-decoration: none;
    color: var(--text-primary);
}

.drawer-menu-secondary .drawer-item-icon {
    color: var(--text-muted);
}

.drawer-footer {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.drawer-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition-fast);
}

.drawer-link:hover {
    color: var(--accent-hover);
}

.drawer-link-sub {
    padding-left: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.drawer-link-sub:hover {
    color: var(--accent-hover);
}

.drawer-link-hint {
    display: none;
    color: var(--text-muted);
    font-size: 0.65rem;
}

.drawer-link-sub:hover .drawer-link-hint {
    display: inline;
}

/* === Help Panel === */
.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.help-overlay[hidden] {
    display: none;
}

.help-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90vw;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.help-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.help-panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.help-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.help-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.help-panel-body {
    overflow-y: auto;
    padding: 24px;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.help-loading {
    color: var(--text-muted);
    font-style: italic;
}

/* Markdown styles for help panel */
.help-panel-body h1 { font-size: 1.4rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.help-panel-body h2 { font-size: 1.15rem; margin-top: 24px; margin-bottom: 12px; color: var(--accent); }
.help-panel-body h3 { font-size: 1rem; margin-top: 20px; margin-bottom: 8px; }
.help-panel-body p { margin-bottom: 12px; font-size: 0.9rem; line-height: 1.7; color: var(--text-primary); }
.help-panel-body ul, .help-panel-body ol { margin-bottom: 12px; padding-left: 24px; font-size: 0.9rem; }
.help-panel-body li { margin-bottom: 4px; line-height: 1.6; }
.help-panel-body code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-tertiary); padding: 2px 6px; border-radius: 3px; }
.help-panel-body pre { background: var(--bg-tertiary); padding: 16px; border-radius: 6px; overflow-x: auto; margin-bottom: 16px; font-size: 0.82rem; }
.help-panel-body pre code { background: none; padding: 0; }
.help-panel-body strong { font-weight: 600; }
.help-panel-body em { color: var(--text-secondary); }
.help-panel-body a { color: var(--accent); text-decoration: none; }
.help-panel-body a:hover { text-decoration: underline; }
.help-panel-body table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.help-panel-body th, .help-panel-body td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; font-size: 0.85rem; }
.help-panel-body th { background: var(--bg-tertiary); font-weight: 600; }
.help-panel-body blockquote { border-left: 3px solid var(--accent); padding-left: 16px; margin: 12px 0; color: var(--text-secondary); }

/* Usage guide TOC */
.guide-toc { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.guide-toc h2 { font-size: 1rem; margin-bottom: 10px; color: var(--text-primary); }
.guide-toc ul { list-style: none; padding: 0; }
.guide-toc li { margin-bottom: 4px; }
.guide-toc li a { color: var(--accent); text-decoration: none; font-size: 0.85rem; line-height: 1.6; }
.guide-toc li a:hover { text-decoration: underline; }
.guide-toc .toc-sub { padding-left: 18px; }
.guide-toc .toc-sub a { color: var(--text-secondary); font-size: 0.8rem; }

/* Back to top button */
.guide-back-to-top {
    position: sticky;
    bottom: 16px;
    float: right;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 5;
}
.guide-back-to-top.visible { display: flex; }
.guide-back-to-top:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

/* === Viewer === */
.viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 0;
}


/* When drawer is open, shift left arrow out from behind it */
body.drawer-open .nav-prev {
    left: calc(var(--drawer-width) + 16px);
    transition: left var(--transition-drawer);
}

.nav-prev {
    transition: left var(--transition-drawer);
}

.viewer-container {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

/* === Navigation Arrows === */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: var(--nav-arrow-size);
    height: var(--nav-arrow-size);
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-caption);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-arrow:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-arrow svg {
    width: 24px;
    height: 24px;
}

.nav-prev { left: 16px; }
.nav-next { right: 16px; }

/* === Slide Area === */
.slide-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 72px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.slide-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-content-column {
    flex-direction: column;
}

.slide-image {
    max-width: 100%;
    max-height: calc(100vh - 250px);
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: opacity var(--transition-normal);
    user-select: none;
}

.slide-image.loading { opacity: 0; }
.slide-image.loaded { opacity: 1; }

.slide-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    display: none;
}

.slide-image.loading ~ .slide-loading {
    display: block;
}

/* === Placeholder slide === */
.slide-placeholder {
    max-width: 800px;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.slide-placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.4;
}

/* === Caption Bar === */
.caption-bar {
    background: var(--bg-caption);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: padding-left var(--transition-drawer);
}

body.drawer-open .caption-bar {
    padding-left: var(--drawer-width);
}

.caption-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 24px 10px;
    gap: 24px;
}

.caption-left {
    flex: 1;
    min-width: 0;
}

.caption-group {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 8px;
    border-radius: 3px;
    margin-bottom: 5px;
}

.caption-group:empty { display: none; }

.caption-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 3px;
}

.caption-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.caption-description a {
    color: var(--accent);
    text-decoration: none;
}

.caption-description a:hover {
    text-decoration: underline;
}

.caption-disclaimer {
    font-size: 0.73rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
    margin-top: 5px;
}

.caption-disclaimer:empty { display: none; }

.caption-right {
    flex-shrink: 0;
    text-align: right;
    padding-top: 2px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.slide-counter {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 500;
}

/* === Progress Bar === */
.progress-bar {
    height: 3px;
    background: var(--bg-tertiary);
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width var(--transition-normal);
    border-radius: 0 3px 3px 0;
}

/* === Overflow Chevron (mobile/tablet) === */
.overflow-chevron {
    display: none;
    color: var(--text-muted);
    line-height: 1;
    cursor: pointer;
}

.overflow-chevron.visible {
    display: inline-flex;
    align-items: center;
}

.overflow-chevron svg {
    transition: transform 0.2s ease;
}

.overflow-chevron.flipped svg {
    transform: rotate(180deg);
}

.drawer .overflow-chevron {
    text-align: center;
    padding: 2px 0;
}

.drawer .overflow-chevron.visible {
    display: flex;
    justify-content: center;
}

/* === Footer === */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 8px 24px;
    flex-shrink: 0;
    text-align: center;
}

.footer-links {
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.footer-ext-link {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-ext-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.footer-ext-prefix {
    color: var(--text-secondary);
}

.footer-link-sep {
    color: var(--text-muted);
    margin: 0 6px;
}

.footer-copyright {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.footer-disclaimer {
    font-size: 0.6rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

.footer-disclaimer::-webkit-scrollbar { -webkit-appearance: none; width: 4px; height: 4px; }
.footer-disclaimer::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
.footer-disclaimer::-webkit-scrollbar-track { background: transparent; }

/* === LLM Report Rendering === */
.slide-markdown {
    max-width: 800px;
    width: 100%;
    max-height: calc(100vh - 220px);
    overflow: hidden;
    padding: 32px 40px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.slide-markdown h1 { font-size: 1.5rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.slide-markdown h2 { font-size: 1.2rem; margin-top: 24px; margin-bottom: 12px; color: var(--accent); }
.slide-markdown h3 { font-size: 1.05rem; margin-top: 20px; margin-bottom: 8px; }
.slide-markdown p { margin-bottom: 12px; }
.slide-markdown ul, .slide-markdown ol { margin-bottom: 12px; padding-left: 24px; }
.slide-markdown li { margin-bottom: 4px; }
.slide-markdown code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-tertiary); padding: 2px 6px; border-radius: 3px; }
.slide-markdown strong { color: var(--accent); font-weight: 600; }
.slide-markdown em { color: var(--text-secondary); }
.md-chevron.visible {
    display: block;
    width: 100%;
    text-align: center;
    padding: 4px 0;
}

.slide-markdown.expanded {
    max-height: none !important;
    overflow-y: auto !important;
}

.welcome-slide-beta { font-size: 0.82em; color: var(--text-muted); }
.welcome-slide-cta { margin-top: 24px; }
.slide-markdown .slide-link { color: #4a8abf; text-decoration: none; }
.slide-markdown .slide-link:hover { color: var(--accent); text-decoration: underline; }
.welcome-slide-cta .slide-link { color: var(--accent); }
.welcome-slide-cta .slide-link:hover { color: var(--accent-hover); }
.welcome-slide-cta a { color: var(--accent); text-decoration: none; }
.welcome-slide-cta a:hover { text-decoration: underline; }
.welcome-slide-fine-print { font-size: 0.78em; color: var(--text-muted); margin-top: 16px; }
.slide-markdown table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.slide-markdown th, .slide-markdown td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; font-size: 0.85rem; }
.slide-markdown th { background: var(--bg-tertiary); font-weight: 600; }

/* === CSV Viewer Panel === */
.csv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.csv-overlay[hidden] {
    display: none;
}

.csv-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.csv-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.csv-panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.csv-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.csv-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.csv-tabs {
    display: flex;
    gap: 2px;
    padding: 12px 24px 0;
    flex-shrink: 0;
}

.csv-tab {
    padding: 8px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.csv-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.csv-tab.active {
    color: var(--accent);
    background: var(--bg-secondary);
    border-color: var(--accent);
    border-bottom: 1px solid var(--bg-secondary);
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.csv-info {
    padding: 6px 24px 4px;
    flex-shrink: 0;
}

.csv-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: scroll !important;
    margin: 8px 24px;
    border: 1px solid var(--border);
    border-radius: 6px;
    scrollbar-width: auto;
    scrollbar-color: #4d8abf var(--bg-primary);
}

.csv-table-wrap::-webkit-scrollbar { -webkit-appearance: none; width: 12px; height: 12px; }
.csv-table-wrap::-webkit-scrollbar-track { background: var(--bg-primary); }
.csv-table-wrap::-webkit-scrollbar-thumb { background: #4d8abf; border-radius: 6px; border: 2px solid var(--bg-primary); min-height: 30px; }
.csv-table-wrap::-webkit-scrollbar-thumb:hover { background: #5e9ad0; }
.csv-table-wrap::-webkit-scrollbar-corner { background: var(--bg-primary); }

.csv-caption {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding: 10px 24px 12px;
}

.csv-caption-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.csv-caption-label {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 8px;
    border-radius: 3px;
}

.csv-caption-label:empty { display: none; }

.csv-caption-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}


.csv-caption-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 0 8px;
}

.csv-loading {
    color: var(--text-muted);
    font-style: italic;
    padding: 24px;
}

.csv-table {
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.4;
    white-space: nowrap;
}

.csv-table th,
.csv-table td {
    padding: 4px 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: left;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csv-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.7rem;
    position: sticky;
    top: 0;
    z-index: 2;
    border-top: none;
}

.csv-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
}

.csv-table td:first-child {
    background: var(--bg-tertiary);
    position: sticky;
    left: 0;
    z-index: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.csv-table tr:nth-child(even) td {
    background-color: rgba(22, 27, 34, 0.6);
}

.csv-table tr:nth-child(even) td:first-child {
    background: var(--bg-tertiary);
}

.csv-table tr:hover td {
    background-color: var(--accent-dim);
}

.csv-table tr:hover td:first-child {
    background: rgba(88, 166, 255, 0.2);
}

.csv-table td {
    color: var(--text-secondary);
}

/* Summary/ellipsis column */
.csv-table th:last-child .csv-summary-header,
.csv-val-summary {
    font-style: italic;
    color: var(--text-muted);
}

/* Boolean / special value coloring */
.csv-val-true { color: #3fb950; }
.csv-val-false { color: var(--text-muted); }
.csv-val-num { color: #d2a8ff; }

/* === Responsive === */
@media (max-width: 1080px) {
    .site-header { padding: 10px 16px; }
    .site-title { font-size: 1rem; }
    .slide-area { padding: 8px 56px; }
    .caption-left { max-height: 6.5rem; overflow: hidden; transition: max-height 0.25s ease; }
    .caption-left.expanded { max-height: 50vh; }
    .footer-disclaimer { max-height: 1.7rem; overflow: hidden; transition: max-height 0.25s ease; cursor: pointer; }
    .footer-disclaimer.expanded { max-height: 10rem; }
    .drawer-menu-secondary { max-height: 70px; overflow: hidden; transition: max-height 0.25s ease; }
    .drawer-menu-secondary.expanded { max-height: 150px; }
    .csv-tab { padding: 6px 10px; font-size: 0.78rem; }
    .csv-tabs { padding: 8px 16px 0; }
    .drawer-menu { padding: 4px 0; }
    .nav-arrow { width: 40px; height: 40px; }
    .nav-arrow svg { width: 20px; height: 20px; }
    .nav-prev { left: 8px; }
    .nav-next { right: 8px; }
    .caption-content { padding: 10px 16px 8px; }
    .caption-title { font-size: 0.9rem; }
    .caption-description { font-size: 0.8rem; }
}

@media (max-width: 600px) {
    :root { --drawer-width: 100vw; }
    .site-header { padding: 8px 12px; }
    .site-title { font-size: 0.9rem; }
    .site-subtitle { font-size: 0.7rem; }
    .slide-area { padding: 4px 8px; }
    .nav-arrow { width: 36px; height: 36px; }
    .nav-prev { left: 4px; }
    .nav-next { right: 4px; }
    .slide-image { max-height: calc(100vh - 280px); border-radius: 4px; }
    .caption-left { max-height: 5.5rem; }
    .caption-content { flex-direction: column; gap: 6px; }
    .caption-right { text-align: left; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
}

/* === Keyboard focus indicators === */
.hamburger-btn:focus-visible,
.nav-arrow:focus-visible,
.drawer-item:focus-visible,
.drawer-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* === Print === */
@media print {
    body { background: white; color: black; }
    .nav-arrow, .drawer, .drawer-overlay, .site-footer, .hamburger-btn, .help-btn { display: none; }
    .slide-image { max-height: none; box-shadow: none; }
}
