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; }

/* AI 3DGS Studio Styles */
.ai-studio-container {
    width: 100%;
    max-width: 960px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(78, 161, 255, 0.3);
    border-radius: 16px;
    padding: 24px;
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}
.ai-studio-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.ai-studio-badge {
    background: linear-gradient(135deg, #049ef4, #b44dff);
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.ai-studio-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}
.ai-studio-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}
.ai-tab {
    background: transparent;
    border: none;
    color: #8a8f9a;
    font-size: 13px;
    font-family: inherit;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.ai-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.ai-tab.active {
    color: #ffffff;
    background: rgba(78, 161, 255, 0.2);
    border: 1px solid rgba(78, 161, 255, 0.4);
    font-weight: 600;
}
.drop-zone {
    border: 2px dashed rgba(78, 161, 255, 0.4);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    background: rgba(4, 158, 244, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: #049ef4;
    background: rgba(4, 158, 244, 0.08);
}
.drop-zone-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.drop-zone-text {
    font-size: 14px;
    color: #cfd2da;
    margin-bottom: 4px;
}
.drop-zone-hint {
    font-size: 12px;
    color: #6a6f7a;
}
.image-preview-container {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.image-preview-container img {
    max-width: 140px;
    max-height: 140px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
}
.prompt-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.prompt-input-group input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
}
.prompt-input-group input:focus {
    border-color: #049ef4;
    box-shadow: 0 0 12px rgba(4, 158, 244, 0.35);
}
.btn-prompt-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #049ef4, #0070f3);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(4, 158, 244, 0.4);
    transition: all 0.2s ease;
}
.btn-prompt-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(4, 158, 244, 0.6);
    background: linear-gradient(135deg, #25b0ff, #0084ff);
}
.btn-prompt-submit:active {
    transform: translateY(0);
}
.btn-prompt-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.prompt-chips-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.prompt-chips-label {
    font-size: 12px;
    color: #8a8f9a;
    font-weight: 500;
}
.prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.prompt-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 5px 12px;
    color: #e2e8f0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.prompt-chip:hover {
    background: rgba(4, 158, 244, 0.18);
    border-color: rgba(4, 158, 244, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
}
.https-helper-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 8px;
    font-size: 12px;
    color: #fef08a;
    line-height: 1.5;
}
.https-helper-icon {
    font-size: 16px;
    flex-shrink: 0;
}
.https-helper-text {
    flex: 1;
}
.ai-studio-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    gap: 16px;
    flex-wrap: wrap;
}
.api-settings {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #8a8f9a;
}
.api-settings input {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #cfd2da;
    font-size: 12px;
    font-family: inherit;
    width: 180px;
}
.btn-generate-3d {
    background: linear-gradient(135deg, #049ef4, #7928ca);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(4, 158, 244, 0.4);
    transition: all 0.2s ease;
}
.btn-generate-3d:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(4, 158, 244, 0.6);
}
.btn-generate-3d:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.ai-status-banner {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(4, 158, 244, 0.1);
    border: 1px solid rgba(4, 158, 244, 0.3);
    border-radius: 8px;
    font-size: 13px;
    color: #4ea1ff;
}
.ai-status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(78, 161, 255, 0.3);
    border-top-color: #4ea1ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
