body {
    margin: 0;
    overflow: hidden;
    background-color: #0d0d0f;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
canvas {
    display: block;
    position: absolute;
    inset: 0;
}
[hidden] {
    display: none !important;
}
#gallery {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 36px;
    padding: 40px 24px;
    box-sizing: border-box;
    overflow-y: auto;
    scrollbar-gutter: stable; /* growing content does not shift sideways */
    color: #8a8f9a;
}
#gallery.hidden {
    display: none;
}
#gallery-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    max-width: 960px;
}
#gallery-title {
    font-size: 20px;
    color: #cfd2da;
}
#gallery-subtitle {
    font-size: 13px;
    color: #8a8f9a;
}
#gallery-links {
    display: flex;
    gap: 20px;
    font-size: 13px;
}
#gallery-links a {
    color: #4ea1ff;
    text-decoration: none;
}
#gallery-links a:hover {
    text-decoration: underline;
}
#gallery-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 960px;
}
.gallery-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 960px;
}
.gallery-section:last-child {
    margin-top: 14px; /* sets the paper benchmark apart from the datasets */
}
.section-title {
    font-size: 13px;
    letter-spacing: 0.08em;
    color: #8a8f9a;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); /* 5 per row at the 960px max width */
    gap: 12px;
    width: 100%;
}
.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 0;
    padding: 12px;
    font: inherit;
    color: #cfd2da;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.card:hover {
    border-color: #4ea1ff;
    background: rgba(78, 161, 255, 0.08);
    transform: translateY(-2px);
}
.card-title {
    font-size: 16px;
}
.card-variants {
    font-size: 11px;
    color: #8a8f9a;
    text-align: center;
}
.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}
.section-note {
    margin-top: -4px;
    font-size: 11px;
    color: #6f747f;
}
.segmented {
    position: relative;
    display: flex;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}
.segment {
    position: relative;
    z-index: 1;
    padding: 4px 10px;
    font: inherit;
    font-size: 12px;
    color: #8a8f9a;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s ease;
}
.segment:hover {
    color: #cfd2da;
}
.segment.active {
    color: #ffffff;
}
.segment-slider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 0;
    background: rgba(78, 161, 255, 0.45);
    border-radius: 6px;
    transition: left 0.2s ease, width 0.2s ease;
}
.grid-empty {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #8a8f9a;
}
#loading {
    position: fixed; /* stays at the bottom of the viewport while the gallery scrolls */
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 240px;
}
#progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}
#progress-fill {
    width: 0;
    height: 100%;
    background: #4ea1ff;
    border-radius: 3px;
    transition: width 0.1s linear;
}
#progress-label {
    font-size: 13px;
    color: #cfd2da;
}
canvas { cursor: grab; }
canvas:active { cursor: grabbing; }
