/* ============================================================================
   WALLET PAGE - 3D VIEWER & MODULAR PARTS
   ============================================================================ */

/* ============================================================================
   CUSTOM SCROLLBAR STYLING
   ============================================================================ */
.tab-content::-webkit-scrollbar,
.parts-panel::-webkit-scrollbar,
.options-panel::-webkit-scrollbar {
    width: 6px;
}

.tab-content::-webkit-scrollbar-track,
.parts-panel::-webkit-scrollbar-track,
.options-panel::-webkit-scrollbar-track {
    background: rgba(20, 20, 30, 0.5);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb,
.parts-panel::-webkit-scrollbar-thumb,
.options-panel::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb:hover,
.parts-panel::-webkit-scrollbar-thumb:hover,
.options-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* Firefox scrollbar */
.tab-content,
.parts-panel,
.options-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) rgba(20, 20, 30, 0.5);
}

/* ============================================================================
   STAGE LAYOUT
   ============================================================================ */
.stage {
    --panel-width: clamp(260px, 15vw, 360px);
    --gap: clamp(12px, 1.2vw, 28px);
    --viewer-width: clamp(620px, calc(100vw - (var(--panel-width) * 2) - (var(--gap) * 2) - 64px), 1800px);
    --parts-bar-height: 80px;
    --panel-height: clamp(560px, 68vh, 900px);
    --mode-buttons-height: 60px;
    /* Viewer height reduced to accommodate mode buttons card */
    --viewer-height: calc(var(--panel-height) - var(--parts-bar-height) - var(--mode-buttons-height) - 24px);

    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: var(--gap);
    min-height: var(--panel-height);
    padding: 20px;
    box-sizing: border-box;
}

@media (min-width: 1800px) {
    .stage {
        --panel-width: clamp(300px, 14vw, 420px);
        --panel-height: clamp(620px, 72vh, 980px);
        --viewer-width: clamp(900px, calc(100vw - (var(--panel-width) * 2) - (var(--gap) * 2) - 80px), 2200px);
    }
}

/* ============================================================================
   MAIN VIEWER
   ============================================================================ */
.viewer-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    order: 2;
}

#viewer {
    position: relative;
    width: var(--viewer-width);
    height: var(--viewer-height);
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
    touch-action: none;
}

#viewer.fullscreen,
#viewer:fullscreen,
#viewer:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
}

/* CSS fallback fullscreen (iPhone Safari) — position over everything */
#viewer.fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: #0a0a0f;
}

#viewer:fullscreen .fullscreen-btn,
#viewer:-webkit-full-screen .fullscreen-btn,
#viewer.fullscreen .fullscreen-btn {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: calc(env(safe-area-inset-left, 0px) + 12px);
}

/* Mode toggle in viewer fullscreen — keep right of fullscreen btn on Dynamic Island devices */
#viewer:fullscreen .mode-toggle-container,
#viewer:-webkit-full-screen .mode-toggle-container,
#viewer.fullscreen .mode-toggle-container {
    top: calc(env(safe-area-inset-top, 0px) + 6px) !important;
    left: calc(env(safe-area-inset-left, 0px) + 40px) !important;
}

/* ============================================================================
   VIEW BUILD BUTTON (at bottom of parts panel)
   ============================================================================ */
.view-build-panel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 24px);
    margin: auto 12px 0 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.8));
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 12px;
    color: #fff;
    font: 700 14px/1 system-ui, sans-serif;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Hover state - glow effect (only when clickable) */
.view-build-panel-btn:not(.viewing-build):hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 1), rgba(59, 130, 246, 1));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* Viewing build state - amber to match "what you're looking at" theme */
.view-build-panel-btn.viewing-build {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.7), rgba(217, 119, 6, 0.7));
    border-color: rgba(245, 158, 11, 0.5);
    cursor: pointer;
}

/* ============================================================================
   ANIMATED EYE
   ============================================================================ */
.eye-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
}

.eye {
    position: relative;
    width: 24px;
    height: 16px;
    background: #e8e8e8;
    border-radius: 50%;
    border: 2px solid #222;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Eyelid - covers the eye when closed */
.eye::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    height: 22px;
    background: #1a1a1a;
    border-radius: 50% 50% 40% 40%;
    transform-origin: top center;
    transition: transform 0.4s ease;
    z-index: 10;
}

/* Pupil */
.eye .pupil {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle at 35% 35%, #4a3728, #0a0505);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset -1px -1px 2px rgba(0,0,0,0.5);
}

/* Light reflection in pupil */
.eye .pupil::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 3px;
    width: 3px;
    height: 3px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
}

/* ============================================================================
   CLOSED EYE STATE (viewing individual part - clickable)
   Hide the eye completely, just show text
   ============================================================================ */
.view-build-panel-btn:not(.viewing-build) .eye-container {
    display: none;
}

/* ============================================================================
   OPEN EYE STATE (viewing build - not clickable)
   ============================================================================ */
.view-build-panel-btn.viewing-build .eye::before {
    transform: scaleY(0);
}

.view-build-panel-btn.viewing-build .eye .pupil {
    opacity: 1;
    transition: transform 0.1s ease-out;
}

/* When looking straight (centered) */
.view-build-panel-btn.viewing-build .eye .pupil.looking-straight {
    transform: translate(-50%, -50%) !important;
    transition: transform 0.3s ease-out;
}

/* Slower, more natural pupil movement - now controlled by JavaScript */

/* ============================================================================
   CLICK ANIMATION - Button turns green
   ============================================================================ */
.view-build-panel-btn.clicked {
    background: linear-gradient(135deg, rgba(16, 185, 129, 1), rgba(5, 150, 105, 1));
    border-color: rgba(16, 185, 129, 0.8);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
    pointer-events: none;
}

.view-build-panel-btn .view-text {
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: opacity 0.3s ease;
}

/* Hide text when viewing build */
.view-build-panel-btn.viewing-build .view-text {
    display: none;
}

/* ============================================================================
   EYE HELPER - Contextual popup & inactivity hint
   ============================================================================ */

/* Row wrapper so eye + hint sit side by side */
.eye-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: calc(100% - 24px);
    margin: auto 12px 0 12px;
    flex-shrink: 0;
}

/* Let the eye button fill remaining space */
.eye-row .view-build-panel-btn {
    flex: 1;
    width: auto;
    margin: 0;
}

/* Hint button - compact, sits to the right of the eye */
.eye-hint-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.25));
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 12px;
    color: #93c5fd;
    font: 600 12px/1 system-ui, sans-serif;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
    animation: hint-pulse 2s ease-in-out infinite;
}

.eye-hint-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(37, 99, 235, 0.4));
    border-color: rgba(96, 165, 250, 0.8);
    color: #fff;
    transform: translateY(-1px);
}

.eye-hint-icon {
    font-size: 14px;
}

.eye-hint-text {
    letter-spacing: 0.5px;
}

@keyframes hint-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 12px 2px rgba(59, 130, 246, 0.25); }
}

/* Eye helper popup - fixed overlay on top of everything */
.eye-helper-popup {
    position: fixed;
    z-index: 99999;
    width: 280px;
    padding: 14px 16px;
    background: rgba(20, 20, 28, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(14px);
    animation: popup-fade-in 0.25s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

@keyframes popup-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.eye-helper-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.eye-helper-icon {
    font-size: 22px;
}

.eye-helper-message {
    font: 400 13px/1.4 system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    white-space: pre-line;
}

.eye-helper-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
}

.eye-helper-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.eye-helper-guide-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(109, 40, 217, 0.3));
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 8px;
    color: #c4b5fd;
    font: 600 12px/1 system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eye-helper-guide-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(109, 40, 217, 0.5));
    color: #fff;
}

/* Error state styling for popup */
.eye-helper-popup.has-errors {
    border-color: rgba(239, 68, 68, 0.5);
}

.eye-helper-popup.has-errors .eye-helper-icon {
    filter: none;
}

/* Success state styling for popup */
.eye-helper-popup.is-valid {
    border-color: rgba(34, 197, 94, 0.5);
}

/* ============================================================================
   ZOOM HINT — info badge, top-right of viewer
   ============================================================================ */
.zoom-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(40, 40, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font: 400 11px/1.2 system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    backdrop-filter: blur(4px);
    z-index: 100;
}

.zoom-hint-icon {
    font-size: 13px;
    opacity: 0.6;
}

/* ============================================================================
   VIEWER MODE DROPDOWN SELECTOR
   ============================================================================ */
.viewer-mode-selector {
    position: relative;
    width: var(--viewer-width);
    z-index: 200;
}

.mode-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(20, 20, 28, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.mode-display:hover {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(28, 28, 38, 0.9);
}

.mode-display-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mode-display-text .mode-label {
    font: 600 14px/1.2 system-ui, sans-serif;
    color: #fff;
}

.mode-display-text .mode-desc {
    font: 400 10px/1.2 system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.6);
}

.mode-dropdown-arrow {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease;
    margin-left: 12px;
}

.viewer-mode-selector.open .mode-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown panel */
.mode-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(20, 20, 28, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(14px);
    padding: 6px;
    z-index: 100;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.viewer-mode-selector.open .mode-dropdown {
    display: flex;
}

/* Dropdown items */
.mode-dropdown-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 10px;
    font: 600 14px/1.2 system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ccc;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
}

.mode-dropdown-item .mode-label {
    font: 600 14px/1.2 system-ui, sans-serif;
}

.mode-dropdown-item .mode-desc {
    font: 400 10px/1.2 system-ui, sans-serif;
    opacity: 0.6;
}

.mode-dropdown-item:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: #fff;
}

.mode-dropdown-item.active {
    color: #fff;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45), 0 0 4px rgba(245, 158, 11, 0.3);
}

.mode-dropdown-item.active .mode-desc {
    opacity: 0.85;
}

/* Prebuilt item */
.mode-dropdown-item[data-mode="prebuilt"] {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.15));
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.mode-dropdown-item[data-mode="prebuilt"]:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.25));
    border-color: rgba(59, 130, 246, 0.5);
}

.mode-dropdown-item[data-mode="prebuilt"].active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.3));
    border-color: rgba(245, 158, 11, 0.6);
}

/* Custom item */
.mode-dropdown-item[data-mode="custom"] {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.8), rgba(40, 40, 40, 0.8));
    border: 1px solid rgba(150, 150, 150, 0.3);
}

.mode-dropdown-item[data-mode="custom"]:hover {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9), rgba(50, 50, 50, 0.9));
    border-color: rgba(180, 180, 180, 0.45);
}

.mode-dropdown-item[data-mode="custom"].active {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(55, 55, 55, 0.95));
    border-color: rgba(245, 158, 11, 0.6);
}

/* Parts item */
.mode-dropdown-item[data-mode="parts"] {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(8, 145, 178, 0.15));
    border: 1px solid rgba(6, 182, 212, 0.35);
}

.mode-dropdown-item[data-mode="parts"]:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(8, 145, 178, 0.25));
    border-color: rgba(6, 182, 212, 0.5);
}

.mode-dropdown-item[data-mode="parts"].active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(8, 145, 178, 0.3));
    border-color: rgba(245, 158, 11, 0.6);
}

/* Hide "Add to Build" buttons when NOT in custom mode */
.stage[data-mode="prebuilt"] .add-to-build-btn,
.stage[data-mode="parts"] .add-to-build-btn {
    display: none;
}

/* In parts mode, collapse the thumb-with-action gap so thumbs stay flush */
.stage[data-mode="prebuilt"] .thumb-with-action .thumb,
.stage[data-mode="parts"] .thumb-with-action .thumb {
    border-radius: 12px;
}

/* Info Button - positioned on the selector */
.viewer-mode-selector .custom-info-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.6);
    background: rgba(30, 30, 40, 0.95);
    color: #a78bfa;
    font: 600 12px/1 system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-info-btn:hover {
    background: rgba(139, 92, 246, 0.4);
    border-color: rgba(139, 92, 246, 0.8);
    color: #fff;
    transform: scale(1.15);
}

/* Info button attention pulse - amber glow + shake + scale */
@keyframes info-btn-shake {
    0%, 100% { transform: translateX(0) scale(1); }
    10% { transform: translateX(-6px) rotate(-6deg) scale(1.25); }
    20% { transform: translateX(6px) rotate(6deg) scale(1.25); }
    30% { transform: translateX(-5px) rotate(-4deg) scale(1.2); }
    40% { transform: translateX(5px) rotate(4deg) scale(1.2); }
    50% { transform: translateX(-3px) rotate(-3deg) scale(1.15); }
    60% { transform: translateX(3px) rotate(3deg) scale(1.15); }
    70% { transform: translateX(-2px) rotate(-2deg) scale(1.1); }
    80% { transform: translateX(2px) rotate(2deg) scale(1.1); }
    90% { transform: translateX(-1px) rotate(-1deg) scale(1.05); }
}

.custom-info-btn.info-btn-attention {
    animation: info-btn-shake 0.7s ease-in-out;
    border-color: rgba(245, 158, 11, 1);
    background: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.8), 0 0 24px rgba(245, 158, 11, 0.5), 0 0 40px rgba(245, 158, 11, 0.2);
    z-index: 10;
}

/* Parts mode - taller viewer when parts breakdown bar is hidden */
.viewer-container.parts-mode #viewer {
    height: calc(var(--panel-height) - var(--mode-buttons-height) - 24px);
}

/* ============================================================================
   CUSTOM WALLET INFO MODAL
   ============================================================================ */
.custom-info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2vh;
}

.custom-info-modal.show {
    display: flex;
}

.custom-info-modal-content {
    background: linear-gradient(145deg, rgba(30, 30, 45, 0.98), rgba(20, 20, 30, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    padding: 1.25rem;
    max-width: 520px;
    width: 90%;
    max-height: 55vh;
    overflow: hidden; /* Hide overflow on outer container */
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.15);
    display: flex;
    flex-direction: column;
}

/* Inner scrollable container */
.custom-info-modal-scroll {
    overflow-y: auto;
    padding-right: 0.75rem; /* Space for scrollbar */
    margin-right: -0.5rem; /* Pull scrollbar inward */
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) rgba(20, 20, 30, 0.5);
}

.custom-info-modal-scroll::-webkit-scrollbar {
    width: 8px;
}

.custom-info-modal-scroll::-webkit-scrollbar-track {
    background: rgba(20, 20, 30, 0.5);
    border-radius: 4px;
}

.custom-info-modal-scroll::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

.custom-info-modal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

.custom-info-modal-content h2 {
    color: #fff;
    font: 700 1.35rem/1.3 system-ui, sans-serif;
    margin: 0 0 1.25rem 0;
    text-align: center;
}

.custom-info-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.custom-info-close:hover {
    color: #fff;
}

.info-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0.75rem;
}

.info-section h3 {
    color: #c4b5fd;
    font: 600 0.9rem/1.3 system-ui, sans-serif;
    margin: 0 0 0.5rem 0;
}

.info-section p {
    color: #9ca3af;
    font: 400 0.85rem/1.5 system-ui, sans-serif;
    margin: 0 0 0.5rem 0;
}

.info-section ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #9ca3af;
    font: 400 0.9rem/1.7 system-ui, sans-serif;
}

.info-section ul li {
    margin-bottom: 0.25rem;
}

.hinge-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font: 600 0.75rem/1.4 system-ui, sans-serif;
}

.hinge-badge.hinge-a {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.hinge-badge.hinge-b {
    background: rgba(52, 211, 153, 0.3);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.5);
}

.hinge-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.hinge-rule {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.hinge-rule.valid {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.hinge-rule.invalid {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.hinge-rule .arrow {
    color: #666;
}

.hinge-rule .result {
    margin-left: auto;
    font-weight: 600;
    font-size: 0.8rem;
}

.hinge-rule.valid .result {
    color: #10b981;
}

.hinge-rule.invalid .result {
    color: #ef4444;
}

.info-got-it-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border: none;
    border-radius: 10px;
    color: #fff;
    font: 600 1rem/1 system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-got-it-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* ============================================================================
   PREBUILT GUIDE MODAL (Video Tutorial Cards)
   ============================================================================ */

/* Override modal positioning for prebuilt guide */
#prebuiltGuideModal {
    padding-top: 10px;
    align-items: flex-start;
}

#prebuiltGuideModal.show {
    display: flex;
}

.prebuilt-guide-content,
.custom-guide-content,
.parts-guide-content {
    max-width: 850px;
    /* Height is set dynamically by JavaScript to stay above navbar */
    position: relative;
}

.guide-intro {
    color: #9ca3af;
    font: 400 0.9rem/1.5 system-ui, sans-serif;
    text-align: center;
    margin: 0 0 1rem 0;
}

.video-guides-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

/* ============================================================================
   GUIDE ROW - Container for video and text cards
   ============================================================================ */

.guide-row {
    display: grid;
    gap: 1rem;
    align-items: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

/* Remove border from last row */
.guide-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Row number indicator */
.guide-row::before {
    content: attr(data-card-index);
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    font-size: 12px;
    font-weight: 600;
}

/* Hide row numbers by default, show only in admin mode */
.guide-row::before {
    display: none;
}

.admin-mode .guide-row::before {
    display: flex;
}

/* Default: text on right - 2 columns side by side */
.guide-row.text-right {
    grid-template-columns: auto 1fr;
    grid-template-areas: "video text";
}

/* Text on left - swap columns */
.guide-row.text-left {
    grid-template-columns: 1fr auto;
    grid-template-areas: "text video";
}

/* Text on top - stack vertically, text first */
.guide-row.text-top {
    grid-template-columns: 1fr;
    grid-template-areas: 
        "text"
        "video";
}

/* Text on bottom - stack vertically, video first */
.guide-row.text-bottom {
    grid-template-columns: 1fr;
    grid-template-areas: 
        "video"
        "text";
}

/* ============================================================================
   VIDEO CARD - Independent, resizable container
   ============================================================================ */

.video-card {
    grid-area: video;
    position: relative;
    width: 320px;
    height: 180px;
    background: rgba(20, 20, 30, 0.9);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(20, 20, 30, 0.9);
    pointer-events: none;
}

.video-card video:not([src=""]) ~ .video-placeholder,
.video-card video[data-loaded="true"] ~ .video-placeholder {
    display: none;
}

.video-placeholder-icon {
    font-size: 1.5rem;
    opacity: 0.5;
}

.video-placeholder-text {
    color: #6b7280;
    font: 400 0.7rem/1 system-ui, sans-serif;
}

/* Admin mode - make video card resizable */
.guide-row.admin-editing .video-card {
    resize: both;
    overflow: hidden;
    border: 2px dashed rgba(139, 92, 246, 0.5);
}

.guide-row.admin-editing .video-card:hover {
    border-color: rgba(139, 92, 246, 0.8);
}

/* ============================================================================
   TEXT CARD - Independent text container
   ============================================================================ */

.text-card {
    grid-area: text;
    position: relative;
    background: rgba(30, 30, 45, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-card:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.text-card h4 {
    color: #e5e7eb;
    font: 600 0.9rem/1.3 system-ui, sans-serif;
    margin: 0 0 0.5rem 0;
}

.text-card p {
    color: #9ca3af;
    font: 400 0.8rem/1.5 system-ui, sans-serif;
    margin: 0;
}

.text-card p strong {
    color: #c4b5fd;
}

/* Editable text in admin mode */
.text-card .editable-title,
.text-card .editable-description {
    outline: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.guide-row.admin-editing .text-card .editable-title {
    border: 1px dashed transparent;
    padding: 4px 8px;
    margin: -4px -8px;
    margin-bottom: 0.5rem;
    cursor: text;
}

.guide-row.admin-editing .text-card .editable-title:hover {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.05);
}

.guide-row.admin-editing .text-card .editable-title:focus {
    border-color: rgba(251, 191, 36, 0.8);
    background: rgba(251, 191, 36, 0.1);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.guide-row.admin-editing .text-card .editable-description {
    border: 1px dashed transparent;
    padding: 6px 8px;
    margin: -6px -8px;
    cursor: text;
    display: block;
}

.guide-row.admin-editing .text-card .editable-description:hover {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.05);
}

.guide-row.admin-editing .text-card .editable-description:focus {
    border-color: rgba(251, 191, 36, 0.8);
    background: rgba(251, 191, 36, 0.1);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

/* Edit indicator for text */
.guide-row.admin-editing .text-card .editable-title::before,
.guide-row.admin-editing .text-card .editable-description::before {
    content: "✏️";
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.guide-row.admin-editing .text-card .editable-title:hover::before,
.guide-row.admin-editing .text-card .editable-description:hover::before {
    opacity: 0.6;
}

/* Admin mode - make text card resizable */
.guide-row.admin-editing .text-card {
    resize: both;
    overflow: hidden;
    border: 2px dashed rgba(16, 185, 129, 0.5);
}

.guide-row.admin-editing .text-card:hover {
    border-color: rgba(16, 185, 129, 0.8);
}

/* Text card size display */
.guide-row.admin-editing .text-card .text-size-display {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #10b981;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
    pointer-events: none;
    z-index: 10;
}

/* Text card resize handle indicator */
.guide-row.admin-editing .text-card::after {
    content: "⤡";
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 16px;
    color: rgba(16, 185, 129, 0.8);
    pointer-events: none;
    z-index: 5;
}

/* For top/bottom layouts, center the video */
.guide-row.text-top .video-card,
.guide-row.text-bottom .video-card {
    justify-self: center;
}


/* ============================================================================
   ADMIN GUIDE EDITOR
   ============================================================================ */

/* Size display overlay for video card */
.guide-row.admin-editing .size-display {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #a78bfa;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
    pointer-events: none;
    z-index: 10;
}

/* Resize handle indicator */
.guide-row.admin-editing .video-card::after {
    content: "⤡";
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 16px;
    color: rgba(139, 92, 246, 0.8);
    pointer-events: none;
    z-index: 5;
}

/* Text card admin styling */
.guide-row.admin-editing .text-card {
    border: 2px dashed rgba(16, 185, 129, 0.4);
    position: relative;
}

.guide-row.admin-editing .text-card:hover {
    border-color: rgba(16, 185, 129, 0.7);
}

/* Admin controls bar - always visible at bottom of modal */
.admin-modal-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(20, 20, 30, 0.95);
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    margin-top: 1rem;
    border-radius: 0 0 12px 12px;
}

.admin-save-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-save-btn:hover {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.admin-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.admin-save-btn.saved {
    background: linear-gradient(135deg, #10b981, #059669);
}

.admin-reset-btn {
    padding: 10px 20px;
    background: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(107, 114, 128, 0.4);
    border-radius: 8px;
    color: #9ca3af;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-reset-btn:hover {
    background: rgba(107, 114, 128, 0.4);
    color: white;
    border-color: rgba(107, 114, 128, 0.6);
}

/* Admin mode badge */
.admin-mode-badge {
    position: absolute;
    top: 12px;
    right: 50px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    z-index: 10;
}

.admin-mode-badge::before {
    content: "⚙️";
}

/* Admin mode class on modal - no resize, just enable editing */
.prebuilt-guide-content.admin-mode,
.custom-guide-content.admin-mode,
.parts-guide-content.admin-mode {
    position: relative;
}

/* Instructions tooltip */
.admin-instructions {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #a78bfa;
    text-align: center;
}

.admin-instructions strong {
    color: #c4b5fd;
}

/* Position buttons for moving text */
.position-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: center;
}

.pos-btn {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(139, 92, 246, 0.5);
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-btn:hover {
    background: rgba(139, 92, 246, 0.4);
    border-color: rgba(139, 92, 246, 0.8);
    color: white;
    transform: scale(1.1);
}

.pos-btn:active {
    transform: scale(0.95);
}

.pos-btn.active {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 900px) {
    #prebuiltGuideModal,
    #customGuideModal,
    #partsGuideModal {
        padding-top: 1vh;
    }

    .prebuilt-guide-content,
    .custom-guide-content,
    .parts-guide-content {
        max-width: 95%;
        max-height: 70vh;
    }

    .video-info {
        padding: 0.75rem;
    }

    .video-info h4 {
        font-size: 0.85rem;
    }

    .video-info p {
        font-size: 0.78rem;
    }

    /* Stack side-by-side layouts on mobile */
    .video-guide-card.text-left,
    .video-guide-card.text-right {
        flex-direction: column;
    }

    .video-guide-card.text-left .video-container,
    .video-guide-card.text-right .video-container {
        width: 100% !important;
        border-radius: 12px 12px 0 0;
    }

    .admin-card-controls {
        opacity: 1;
    }
}

/* ============================================================================
   PARTS BREAKDOWN BAR
   ============================================================================ */

/* Wrapper for parts bar + clear button side by side */
.parts-breakdown-wrapper {
    display: flex;
    width: var(--viewer-width);
    gap: 0;
}

/* Prebuilt mode - hide clear button, full border radius on bar */
.parts-breakdown-wrapper.prebuilt-mode .clear-parts-btn {
    display: none;
}

.parts-breakdown-wrapper.prebuilt-mode .parts-breakdown-bar {
    border-radius: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.parts-breakdown-bar {
    flex: 1;
    height: var(--parts-bar-height);
    background: rgba(20, 20, 28, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px 0 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

/* Clear Parts Button - separate column on the right with count display */
.clear-parts-btn {
    width: 44px;
    height: var(--parts-bar-height);
    background: rgba(40, 40, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    border-radius: 0 12px 12px 0;
    color: #4b5563;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.25s ease;
    opacity: 0.5;
    pointer-events: none;
    font-size: 0; /* Hide any text content */
}

/* Count display using ::before */
.clear-parts-btn::before {
    content: attr(data-count);
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    font-family: system-ui, sans-serif;
    opacity: 0.8;
}

/* X icon using ::after */
.clear-parts-btn::after {
    content: "✕";
    font-size: 14px;
    font-weight: 300;
    color: #4b5563;
    opacity: 0.6;
}

/* Has parts state - active button */
.parts-breakdown-wrapper.has-parts .clear-parts-btn {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    background: rgba(40, 40, 55, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
    width: 52px;
}

.parts-breakdown-wrapper.has-parts .clear-parts-btn::before {
    color: #a78bfa;
    opacity: 1;
}

.parts-breakdown-wrapper.has-parts .clear-parts-btn::after {
    color: #9ca3af;
    opacity: 1;
}

/* Hover state - show danger intent */
.parts-breakdown-wrapper.has-parts .clear-parts-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

.parts-breakdown-wrapper.has-parts .clear-parts-btn:hover::before {
    color: #f87171;
}

.parts-breakdown-wrapper.has-parts .clear-parts-btn:hover::after {
    color: #f87171;
}

.parts-breakdown-wrapper.has-parts .clear-parts-btn:active {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(0.96);
}

/* Viewing part state - subtle amber border to hint something can be done */
.parts-breakdown-bar.viewing-part {
    border-color: rgba(245, 158, 11, 0.4);
}

.parts-breakdown-bar .parts-strip {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) rgba(20, 20, 30, 0.5);
}


.parts-breakdown-bar .parts-strip::-webkit-scrollbar {
    height: 4px;
}

.parts-breakdown-bar .parts-strip::-webkit-scrollbar-track {
    background: rgba(20, 20, 30, 0.5);
    border-radius: 2px;
}

.parts-breakdown-bar .parts-strip::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 2px;
}

.parts-breakdown-bar .part-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(40, 40, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    min-width: 80px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.parts-breakdown-bar .part-item:hover {
    background: rgba(60, 60, 80, 0.8);
    border-color: rgba(139, 92, 246, 0.4);
}

.parts-breakdown-bar .part-item .part-index {
    font: 10px/1 system-ui, sans-serif;
    font-weight: 700;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.parts-breakdown-bar .part-item .part-name {
    font: 11px/1.2 system-ui, sans-serif;
    color: #ddd;
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parts-breakdown-bar .part-item .part-type {
    font: 9px/1 system-ui, sans-serif;
    color: #888;
    text-transform: uppercase;
}

.parts-breakdown-bar .connector {
    color: #555;
    font-size: 16px;
    flex-shrink: 0;
}

.parts-breakdown-bar .empty-message {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font: 12px/1.4 system-ui, sans-serif;
    font-style: italic;
    gap: 8px;
}

.parts-breakdown-bar .empty-message .part-count {
    color: #888;
    font-style: normal;
}

/* Part count indicator - now shown on clear button instead */
/* .parts-breakdown-bar .part-count-indicator - REMOVED, count now on clear button */

/* Wallet Errors Display - Compact */
.parts-breakdown-bar .wallet-errors {
    padding: 4px 12px;
    background: rgba(239, 68, 68, 0.15);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    font: 10px/1.3 system-ui, sans-serif;
    color: #f87171;
    max-height: 32px;
    overflow-y: auto;
}

.parts-breakdown-bar .wallet-errors .error-item {
    display: inline;
    margin-right: 12px;
}

.parts-breakdown-bar .wallet-errors .error-item::before {
    content: "⚠ ";
    font-size: 9px;
}

/* Part Item - Compact & Draggable */
.parts-breakdown-bar .part-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: rgba(40, 40, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    min-width: 75px;
    max-width: 95px;
    flex-shrink: 0;
    transition: all 0.15s ease;
    cursor: grab;
    user-select: none;
}

.parts-breakdown-bar .part-item:active {
    cursor: grabbing;
}

.parts-breakdown-bar .part-item.dragging {
    opacity: 0.4;
    transform: scale(0.9);
}

.parts-breakdown-bar .part-item.drag-over {
    border-color: rgba(139, 92, 246, 0.8);
    background: rgba(139, 92, 246, 0.2);
    transform: scale(1.02);
}

.parts-breakdown-bar .part-item:hover {
    background: rgba(60, 60, 80, 0.8);
    border-color: rgba(139, 92, 246, 0.3);
}

/* Part header with index and delete */
.parts-breakdown-bar .part-item .part-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
}

.parts-breakdown-bar .part-item .part-index {
    font: 9px/1 system-ui, sans-serif;
    font-weight: 700;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.2);
    padding: 2px 5px;
    border-radius: 3px;
}

/* Delete button - always visible, inline */
.parts-breakdown-bar .part-item .part-delete {
    width: 14px;
    height: 14px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 3px;
    color: #f87171;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.parts-breakdown-bar .part-item .part-delete:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    transform: scale(1.1);
}

.parts-breakdown-bar .part-item .part-name {
    font: 10px/1.2 system-ui, sans-serif;
    color: #ddd;
    text-align: center;
    max-width: 85px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hinge badge - inline */
.parts-breakdown-bar .part-item .part-hinge {
    font: 8px/1 system-ui, sans-serif;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
}

.parts-breakdown-bar .part-item .part-hinge.hinge-a {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.parts-breakdown-bar .part-item .part-hinge.hinge-b {
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

/* Connector - compact */
.parts-breakdown-bar .connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 12px;
    flex-shrink: 0;
    min-width: 18px;
    gap: 1px;
}

.parts-breakdown-bar .connector.hinge-error {
    color: #ef4444;
}

.parts-breakdown-bar .connector .hinge-match {
    font: 7px/1 system-ui, sans-serif;
    padding: 1px 3px;
    border-radius: 2px;
}

.parts-breakdown-bar .connector .hinge-match.valid {
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
}

.parts-breakdown-bar .connector .hinge-match.invalid {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Part error state */
.parts-breakdown-bar .part-item.has-error {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
}

#viewer.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    background: #000;
    border-radius: 0;
}

/* ============================================================================
   PARTS PANEL (LEFT SIDEBAR)
   ============================================================================ */
.parts-panel {
    width: var(--panel-width);
    background: rgba(20, 20, 28, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    flex-shrink: 0;
    max-height: var(--panel-height);
    display: flex;
    flex-direction: column;
    order: 1;
    padding-bottom: 12px;
}

/* Hide panels in fullscreen */
#viewer.fullscreen ~ .parts-panel,
#viewer.fullscreen ~ .options-panel {
    display: none;
}

/* ============================================================================
   TAB NAVIGATION
   ============================================================================ */
.tab-nav {
    display: flex;
    background: rgba(30, 30, 40, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.tab-btn, .option-tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: #888;
    font: 12px/1.2 system-ui, sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover, .option-tab-btn:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active, .option-tab-btn.active {
    color: #fff;
    border-bottom-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

/* Per-tab color accents — inactive */
.tab-btn[data-tab="covers"] {
    color: #7ab8e0;
    border-bottom-color: rgba(56, 189, 248, 0.2);
}

.tab-btn[data-tab="card-inserts"] {
    color: #a08bda;
    border-bottom-color: rgba(167, 139, 250, 0.2);
}

.tab-btn[data-tab="specialty"] {
    color: #c88be0;
    border-bottom-color: rgba(232, 121, 249, 0.2);
}

/* Per-tab color accents — hover */
.tab-btn[data-tab="covers"]:hover {
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.08);
}

.tab-btn[data-tab="card-inserts"]:hover {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.08);
}

.tab-btn[data-tab="specialty"]:hover {
    color: #f0abfc;
    background: rgba(232, 121, 249, 0.08);
}

/* Per-tab color accents — active (amber = selected) */
.tab-btn[data-tab="prebuilts"].active,
.tab-btn[data-tab="covers"].active,
.tab-btn[data-tab="card-inserts"].active,
.tab-btn[data-tab="specialty"].active {
    color: #fff;
    border-bottom-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

/* Option-tab color accents (Material / Color) — inactive */
.option-tab-btn[data-option-tab="materials"] {
    color: #c0a890;
    border-bottom-color: rgba(192, 168, 144, 0.2);
}

.option-tab-btn[data-option-tab="colors"] {
    color: #a0aab8;
    border-bottom-color: rgba(160, 170, 184, 0.2);
}

/* Option-tab color accents — hover */
.option-tab-btn[data-option-tab="materials"]:hover {
    color: #d8c4a8;
    background: rgba(192, 168, 144, 0.08);
}

.option-tab-btn[data-option-tab="colors"]:hover {
    color: #c0cad8;
    background: rgba(160, 170, 184, 0.08);
}

/* Option-tab color accents — active (amber = selected) */
.option-tab-btn[data-option-tab="materials"].active,
.option-tab-btn[data-option-tab="colors"].active {
    color: #fff;
    border-bottom-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

/* ============================================================================
   TAB CONTENT
   ============================================================================ */
.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.tab-pane, .option-tab-pane {
    display: none;
}

.tab-pane.active, .option-tab-pane.active {
    display: block;
}

.tab-section-title {
    font: 11px/1.2 system-ui, sans-serif;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-section-title:first-child {
    margin-top: 0;
}

/* ============================================================================
   THUMBNAILS GRID - VERTICAL LAYOUT (single column)
   ============================================================================ */
.thumbs-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thumb {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: rgba(40, 40, 55, 0.6);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thumb:hover {
    background: rgba(60, 60, 80, 0.8);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateX(4px);
}

.thumb.selected {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.2);
}

/* Active/selected thumbnail - amber highlight */
.thumb.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3), inset 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.thumb.active:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: #fbbf24;
}

.thumb .mini {
    width: 120px;
    height: 100px;
    flex-shrink: 0;
    background: rgba(20, 20, 30, 0.5);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb span {
    font: 13px/1.3 system-ui, sans-serif;
    text-align: left;
    flex: 1;
    color: #fff;
}

/* ============================================================================
   THUMBNAIL WITH ADD TO BUILD BUTTON
   ============================================================================ */
.thumb-with-action {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: transparent;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

/* The thumbnail body (mini viewer area) - has its own border */
.thumb-with-action .thumb {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px 12px 0 0;
    background: rgba(40, 40, 55, 0.6);
    transition: all 0.2s ease;
}

.thumb-with-action .thumb:hover {
    transform: none;
    background: rgba(60, 60, 80, 0.8);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Active state - amber glow ONLY on the thumbnail body, not the button */
.thumb-with-action .thumb.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3), inset 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.thumb-with-action .thumb.active:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #fbbf24;
}

/* Part already added state - only affects button, not thumbnail */
.thumb-with-action.part-added {
    /* Wrapper stays fully visible and interactive */
}

/* Thumbnail stays fully visible and clickable when part added */
.thumb-with-action.part-added .thumb {
    pointer-events: auto;
    cursor: pointer;
}

/* Button shows "Added" state when part type already in wallet */
.thumb-with-action.part-added .add-to-build-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.3));
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
    pointer-events: auto; /* Allow hover for tooltip */
    cursor: default;
    position: relative;
}

/* Hide original icon and text, replace with checkmark and "Added" */
.thumb-with-action.part-added .add-to-build-btn .add-icon {
    font-size: 0; /* Hide the "+" text */
}

.thumb-with-action.part-added .add-to-build-btn .add-icon::before {
    content: "✓";
    font-size: 16px;
}

.thumb-with-action.part-added .add-to-build-btn .add-text {
    font-size: 0; /* Hide "Add" text */
}

.thumb-with-action.part-added .add-to-build-btn .add-text::before {
    content: "Added";
    font-size: 12px;
    font-weight: 600;
}

/* Tooltip for part-added state using data attribute */
.thumb-with-action.part-added .add-to-build-btn::after {
    content: attr(data-added-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    color: #34d399;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
    margin-bottom: 4px;
}

.thumb-with-action.part-added .add-to-build-btn:hover::after {
    opacity: 1;
}

.thumb-with-action .thumb-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.thumb-with-action .thumb-name {
    font: 13px/1.3 system-ui, sans-serif;
    color: #fff;
}

/* Inline count on Add button for non-cover parts */
.part-count {
    margin-right: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font: 700 11px/20px system-ui, sans-serif;
    text-align: center;
}

/* Add to Build Button on Thumbnail */
.add-to-build-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(168, 85, 247, 0.3));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 0 0 12px 12px;
    color: #c4b5fd;
    font: 600 12px/1 system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: -1px; /* Overlap with thumb border */
}

.add-to-build-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(168, 85, 247, 0.5));
    color: #fff;
}

.add-to-build-btn .add-icon {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.add-to-build-btn .add-text {
    font-weight: 600;
}

/* Add to Build Button - Added State */
.add-to-build-btn.added {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(5, 150, 105, 0.4));
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.add-to-build-btn.added .add-icon {
    color: #34d399;
}

/* Add to Build Button - Disabled State */
.add-to-build-btn:disabled {
    background: rgba(55, 65, 81, 0.4);
    color: #6b7280;
    cursor: not-allowed;
    border-color: rgba(55, 65, 81, 0.4);
    position: relative;
}

.add-to-build-btn:disabled:hover {
    background: rgba(55, 65, 81, 0.4);
    color: #6b7280;
}

/* Show reason tooltip on disabled button hover */
.add-to-build-btn:disabled::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    color: #f87171;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
    margin-bottom: 4px;
}

.add-to-build-btn:disabled:hover::after {
    opacity: 1;
}

/* Thumbnail with action - Disabled state (only affects button, not thumbnail body) */
.thumb-with-action.disabled .thumb {
    /* Keep thumbnail body fully visible - user can still click to preview */
    pointer-events: auto;
    cursor: pointer;
}

.thumb-with-action.disabled .add-to-build-btn {
    pointer-events: auto;
    cursor: not-allowed;
}

/* Hinge Badge on Thumbnail */
.thumb-hinge-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font: 600 10px/1 system-ui, sans-serif;
    text-transform: uppercase;
    margin-top: 4px;
}

.thumb-hinge-badge.hinge-a {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.4);
}

.thumb-hinge-badge.hinge-b {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.4);
}

.thumb-hinge-badge.hinge-none {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* ============================================================================
   OPTIONS PANEL (RIGHT SIDEBAR)
   ============================================================================ */
/* Column wrapper for options panel + purchase card */
.options-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: var(--panel-width);
    flex-shrink: 0;
    order: 3;
}

.options-panel {
    background: rgba(20, 20, 28, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

/* ============================================================================
   OPTIONS GRID (Materials)
   ============================================================================ */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0.5rem;
}

.option-btn,
.material-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    background: rgba(40, 40, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.option-btn:hover,
.material-btn:hover {
    background: rgba(60, 60, 80, 0.8);
    border-color: rgba(139, 92, 246, 0.4);
}

.option-btn.active,
.material-btn.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.option-name {
    font: 14px/1.2 system-ui, sans-serif;
    font-weight: 600;
    color: #fff;
}

.option-desc {
    font: 11px/1.2 system-ui, sans-serif;
    color: #888;
    margin-top: 2px;
}

.material-btn.active .option-desc {
    color: #fbbf24;
}

/* ============================================================================
   COLORS GRID
   ============================================================================ */
.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    padding: 0.5rem;
}

.color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: rgba(40, 40, 55, 0.6);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn:hover {
    background: rgba(60, 60, 80, 0.8);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.color-btn.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color, #808080);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-btn.active .color-swatch {
    border-color: #f59e0b;
}

.color-btn span {
    font: 11px/1.2 system-ui, sans-serif;
    color: #9ca3af;
}

.color-btn.active span {
    color: #fff;
}

/* ============================================================================
   SELECTION SUMMARY
   ============================================================================ */
.selection-summary {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 30, 40, 0.5);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.summary-label {
    font: 12px/1.4 system-ui, sans-serif;
    color: #888;
}

.summary-value {
    font: 12px/1.4 system-ui, sans-serif;
    font-weight: 600;
    color: #fff;
}

/* ============================================================================
   PURCHASE CARD (Price + Add to Cart)
   ============================================================================ */
.purchase-card {
    padding: 4px 0 0 0;
    background: rgba(20, 20, 28, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    flex-shrink: 0;
}

.purchase-card .price-display {
    margin: 10px 10px 6px 10px;
}

.purchase-card .wallet-actions {
    margin: 6px 10px 10px 10px;
}

.purchase-card .add-to-wallet-btn {
    margin: 6px 10px 4px 10px;
}

/* ============================================================================
   PRICE DISPLAY
   ============================================================================ */
.price-display {
    margin: 1rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 0.75rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-label {
    color: #9ca3af;
    font-size: 0.875rem;
}

.price-value {
    color: #a78bfa;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ============================================================================
   ADD TO WALLET BUTTON
   ============================================================================ */
.add-to-wallet-btn {
    margin: 12px 12px 8px 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font: 14px/1.2 system-ui, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-to-wallet-btn:hover {
    background: linear-gradient(135deg, #9d6eff, #8b5cf6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.add-to-wallet-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================================
   WALLET ACTIONS (Preview + Add to Cart)
   ============================================================================ */
.wallet-actions {
    display: flex;
    gap: 8px;
    margin: 4px 12px 12px 12px;
}

.preview-wallet-btn {
    flex: 1;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 10px;
    color: #60a5fa;
    font: 13px/1.2 system-ui, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.preview-wallet-btn::before {
    content: "👁";
    font-size: 14px;
}

.preview-wallet-btn:hover:not([disabled]) {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
}

.preview-wallet-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Preview button active state - amber highlight when previewing custom wallet */
.preview-wallet-btn.preview-active {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3), inset 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.preview-wallet-btn.preview-active:hover:not([disabled]) {
    background: rgba(245, 158, 11, 0.35);
    border-color: #fbbf24;
}

/* ============================================================================
   ADD TO CART BUTTON
   ============================================================================ */
.wallet-actions .add-to-cart-btn {
    flex: 2;
    margin: 0;
    padding: 12px 16px;
    background: #374151;
    border: none;
    border-radius: 10px;
    color: #9ca3af;
    font: 13px/1.2 system-ui, sans-serif;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.2s ease;
}

.wallet-actions .add-to-cart-btn:not([disabled]) {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    cursor: pointer;
}

.wallet-actions .add-to-cart-btn:not([disabled]):hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Standalone add-to-cart (for prebuilts) */
.add-to-cart-btn:not(.wallet-actions .add-to-cart-btn) {
    margin: 4px 12px 12px 12px;
    padding: 12px 20px;
    background: #374151;
    border: none;
    border-radius: 10px;
    color: #9ca3af;
    font: 14px/1.2 system-ui, sans-serif;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.2s ease;
}

.add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.add-to-cart-btn.out-of-stock {
    background: #374151;
}

.add-to-cart-btn.out-of-stock:hover {
    background: #374151;
    transform: none;
    box-shadow: none;
}

/* ============================================================================
   UI OVERLAY PANEL
   ============================================================================ */
.ui-panel {
    position: absolute;
    left: 8px;
    top: 8px;
    background: rgba(20, 20, 28, 0.75);
    backdrop-filter: blur(4px);
    color: #eaeaea;
    font: 12px/1.4 system-ui, sans-serif;
    padding: 8px;
    border-radius: 6px;
    max-width: 320px;
    pointer-events: auto;
}

.ui-panel h4 {
    margin: 4px 0 6px;
    font-size: 12px;
}

.ui-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 4px 0;
    flex-wrap: wrap;
}

.ui-row label {
    opacity: 0.85;
}

.ui-row .value {
    font-weight: 600;
    min-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-panel button, .ui-panel input[type="number"] {
    font: inherit;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #3a3a48;
    background: #2a2a36;
    color: #f0f0f0;
}

.ui-panel button:hover {
    background: #323247;
}

.ui-panel input[type="checkbox"] {
    transform: translateY(1px);
}

/* ============================================================================
   FULLSCREEN BUTTON
   ============================================================================ */
.fullscreen-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    background: rgba(20, 20, 28, 0.75);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #eaeaea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
    pointer-events: auto;
    z-index: 100;
}

.fullscreen-btn:hover {
    background: rgba(50, 50, 70, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.fullscreen-btn .icon-maximize::before {
    content: "⛶";
}

.fullscreen-btn .icon-minimize::before {
    content: "⛶";
    transform: rotate(45deg);
    display: inline-block;
}

/* ============================================================================
   PAGE FULLSCREEN BUTTON — liquid bubble connected to pill-navbar (Wallet only)
   Uses SVG goo filter (#navGoo) on .pill-navbar-wrapper.liquid-nav to create
   an organic "metaball" merge between the navbar pill and the fs button bubble.
   ============================================================================ */

/* Liquid nav — apply goo filter to merge the two shapes organically */
.pill-navbar-wrapper.liquid-nav {
    filter: url('#navGoo');
}

/* The fullscreen bubble — sits beside the navbar, hidden on desktop */
.pill-navbar-bubble {
    display: none;
}

.page-fs-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.page-fs-btn:hover {
    background: #007bff;
}

.page-fs-btn:hover .page-fs-icon {
    color: #fff;
}

.page-fs-btn:active {
    transform: scale(0.9);
}

.page-fs-icon {
    font-size: 1.2rem;
    color: var(--text-color, #e0e0e0);
    line-height: 1;
}

/* Show the bubble on mobile / small viewports */
@media (max-width: 768px), (max-height: 500px) {
    .pill-navbar-bubble {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--bg-secondary, #1e1e1e);
        border-radius: 50%;
        padding: 4px;
        margin-left: -4px; /* Overlap slightly so goo filter merges the shapes */
    }
}

/* Touch devices — compact button to match compact navbar */
@media (hover: none) and (pointer: coarse) {
    .pill-navbar-bubble {
        padding: 2px;
        margin-left: -2px;
    }

    .page-fs-btn {
        width: 34px;
        height: 34px;
    }

    .page-fs-icon {
        font-size: 1rem;
    }
}

/* When fullscreened, always show the bubble */
:fullscreen .pill-navbar-bubble,
:-webkit-full-screen .pill-navbar-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* .page-css-fullscreen bubble already handled above */

/* ============================================================================
   PAGE FULLSCREEN — hide chrome when <html> is fullscreened
   Native :fullscreen + CSS fallback (.page-css-fullscreen on <html>) for
   iPhone Safari which does not support the Fullscreen API.
   ============================================================================ */
:fullscreen footer,
:-webkit-full-screen footer,
.page-css-fullscreen footer {
    display: none !important;
}

:fullscreen .profile-avatar-fixed,
:-webkit-full-screen .profile-avatar-fixed,
.page-css-fullscreen .profile-avatar-fixed {
    display: none !important;
}

:fullscreen .fixed-background,
:-webkit-full-screen .fixed-background,
.page-css-fullscreen .fixed-background {
    display: none !important;
}

/* Keep navbar visible in fullscreen but restyle it for the dark UI */
:fullscreen .pill-navbar-wrapper,
:-webkit-full-screen .pill-navbar-wrapper,
.page-css-fullscreen .pill-navbar-wrapper {
    bottom: 12px;
}

:fullscreen .pill-navbar,
:-webkit-full-screen .pill-navbar,
.page-css-fullscreen .pill-navbar {
    background: var(--bg-secondary, #1e1e1e);
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 50px;
}

:fullscreen .pill-navbar .nav-link,
:-webkit-full-screen .pill-navbar .nav-link,
.page-css-fullscreen .pill-navbar .nav-link {
    color: #d1d5db;
}

:fullscreen .pill-navbar .nav-link.active,
:fullscreen .pill-navbar .nav-link:hover,
:-webkit-full-screen .pill-navbar .nav-link.active,
:-webkit-full-screen .pill-navbar .nav-link:hover,
.page-css-fullscreen .pill-navbar .nav-link.active,
.page-css-fullscreen .pill-navbar .nav-link:hover {
    background: #007bff;
    color: #fff;
}

:fullscreen .stage,
:-webkit-full-screen .stage,
.page-css-fullscreen .stage {
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    padding: 0.5vh;
    box-sizing: border-box;
    background: #0a0a0f;
    align-items: stretch;
}

:fullscreen .viewer-container,
:-webkit-full-screen .viewer-container,
.page-css-fullscreen .viewer-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

:fullscreen #viewer,
:-webkit-full-screen #viewer,
.page-css-fullscreen #viewer {
    width: 100%;
    flex: 1;
    min-height: 0;
}

:fullscreen .parts-panel,
:-webkit-full-screen .parts-panel,
.page-css-fullscreen .parts-panel {
    max-height: 100%;
    overflow-y: auto;
}

:fullscreen .options-column,
:-webkit-full-screen .options-column,
.page-css-fullscreen .options-column {
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

:fullscreen .options-panel,
:-webkit-full-screen .options-panel,
.page-css-fullscreen .options-panel {
    flex: 1;
    min-height: 0;
}

/* CSS fullscreen fallback — make <html> fill the viewport */
.page-css-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99998;
    overflow: auto;
    background: #0a0a0f;
}

.page-css-fullscreen .pill-navbar-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile landscape fullscreen — reserve space for the navbar at the bottom */
@media (max-height: 500px) and (orientation: landscape) {
    :fullscreen .stage,
    :-webkit-full-screen .stage,
    .page-css-fullscreen .stage {
        padding-bottom: 48px;
    }
}

/* ============================================================================
   LOADING & ERROR STATES
   ============================================================================ */
.loading-placeholder,
.no-stock-message,
.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */
@media (max-width: 1200px) {
    .stage {
        flex-wrap: wrap;
        --viewer-width: min(100%, 600px);
        --panel-width: min(45%, 280px);
    }

    .viewer-container {
        order: 1;
        width: 100%;
        max-width: 600px;
    }

    #viewer {
        width: 100%;
    }

    .parts-breakdown-bar {
        width: 100%;
    }

    .parts-panel, .options-column {
        order: 2;
    }

    .parts-panel {
        max-height: 350px;
    }
}

@media (max-width: 900px) {
    .stage {
        flex-direction: column;
        align-items: center;
        --viewer-width: min(100%, 600px);
        --panel-width: min(100%, 400px);
    }

    .parts-panel {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .stage {
        flex-direction: column;
        align-items: center;
        --panel-width: min(100%, 400px);
    }

    .parts-panel, .options-column {
        width: 100%;
        max-width: 400px;
    }

    .parts-panel {
        max-height: 300px;
    }

    .parts-breakdown-bar .part-item {
        min-width: 70px;
        padding: 4px 8px;
    }

    .parts-breakdown-bar .part-item .part-name {
        max-width: 70px;
        font-size: 10px;
    }
}

/* Compact viewer controls — covers portrait phones AND landscape phones */
@media (max-width: 768px), (max-height: 500px) {
    .fullscreen-btn {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        font-size: 14px;
        top: 6px;
        left: 6px;
    }

    .mode-toggle-container {
        top: 6px !important;
        left: 40px !important;
        gap: 3px !important;
    }

    .mode-btn {
        padding: 4px 8px !important;
        font-size: 10px !important;
        border-radius: 5px !important;
    }

    .zoom-hint {
        top: 6px;
        right: 6px;
        padding: 2px 6px;
        font-size: 9px;
        gap: 2px;
    }

    .zoom-hint-icon {
        font-size: 10px;
    }
}

/* ============================================================================
   MOBILE LANDSCAPE — horizontal 3-column layout on phones turned sideways
   ============================================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .stage {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        --panel-width: min(180px, 24vw);
        --gap: 0.5vw;
        padding: 2px 0.5vw;
        padding-left: calc(0.5vw + env(safe-area-inset-left));
        padding-right: calc(0.5vw + env(safe-area-inset-right));
        min-height: auto;
        height: 100vh;
        height: 100dvh;
        box-sizing: border-box;
        gap: 0.5vw;
    }

    .parts-panel {
        order: 1;
        width: var(--panel-width);
        max-height: 100%;
        overflow-y: auto;
    }

    .viewer-container {
        order: 2;
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        max-height: 100%;
    }

    #viewer {
        width: 100%;
        flex: 1;
        min-height: 0;
        border-radius: 6px;
    }

    .parts-breakdown-wrapper {
        flex-shrink: 0;
    }

    .options-column {
        order: 3;
        width: var(--panel-width);
        max-height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .options-panel {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    /* Compact mode selector */
    .viewer-mode-selector {
        padding: 2px 4px;
        gap: 2px;
        flex-shrink: 0;
    }

    .mode-display {
        padding: 2px 6px;
    }

    .mode-display-text .mode-label {
        font-size: 9px;
    }

    .mode-display-text .mode-desc {
        display: none;
    }

    .custom-info-btn {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }

    /* Slide/Rotate/Scroll row */
    .viewer-controls {
        gap: 2px;
        padding: 1px 0;
    }

    .viewer-controls .control-btn,
    .viewer-controls button,
    .slide-rotate-toggle button {
        padding: 1px 6px;
        font-size: 9px;
    }

    .scroll-hint {
        font-size: 8px !important;
    }

    /* Compact tabs */
    .tab-btn, .option-tab-btn {
        padding: 3px 4px;
        font-size: 9px;
    }

    .tab-nav {
        gap: 0;
    }

    /* Section titles */
    .tab-section-title {
        font-size: 9px;
        margin: 2px 0;
        padding: 0 4px;
    }

    /* Compact parts bar */
    .parts-breakdown-bar {
        min-height: auto;
        padding: 2px;
    }

    .parts-breakdown-bar .part-item {
        min-width: 50px;
        padding: 2px 4px;
    }

    .parts-breakdown-bar .part-item .part-name {
        max-width: 50px;
        font-size: 7px;
    }

    /* Compact material/option buttons */
    .option-btn, .material-btn {
        padding: 4px 6px;
        min-height: 0;
    }

    /* Inline the info button inside the card on mobile */
    .material-btn-wrapper {
        display: flex;
        align-items: stretch;
        gap: 0;
    }

    .material-btn-wrapper .material-btn {
        flex: 1;
        min-width: 0;
        border-radius: 10px 0 0 10px;
    }

    .material-btn-wrapper .material-info-btn {
        position: static;
        width: 28px;
        height: auto;
        flex-shrink: 0;
        border-radius: 0 10px 10px 0;
        border-left: 1px solid rgba(139, 92, 246, 0.2);
    }

    .option-name, .material-name {
        font-size: 10px;
    }

    .option-desc {
        display: none;
    }

    /* Compact selection summary */
    .selection-summary {
        padding: 2px 6px;
        font-size: 9px;
        flex-shrink: 0;
    }

    .summary-row {
        margin: 0;
        line-height: 1.2;
    }

    .color-btn {
        padding: 3px;
    }

    .colors-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 3px;
    }

    .color-swatch {
        width: 18px;
        height: 18px;
    }

    /* Compact purchase card */
    .purchase-card {
        padding: 1px 0 0 0;
        border-radius: 6px;
        flex-shrink: 0;
    }

    .purchase-card .price-display {
        margin: 2px 4px 1px 4px;
    }

    .purchase-card .wallet-actions {
        margin: 1px 4px 3px 4px;
    }

    .purchase-card .add-to-wallet-btn {
        margin: 1px 4px 2px 4px;
    }

    .price-display {
        margin: 2px;
        padding: 2px 6px;
        border-radius: 4px;
    }

    .price-label {
        font-size: 8px;
    }

    .price-value {
        font-size: 11px;
    }

    .wallet-actions {
        gap: 3px;
        margin: 1px 4px 3px 4px;
    }

    .preview-wallet-btn {
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 10px;
    }

    .wallet-actions .add-to-cart-btn {
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 10px;
    }

    .add-to-cart-btn:not(.wallet-actions .add-to-cart-btn) {
        margin: 1px 4px 3px 4px;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 10px;
    }

    /* Compact thumbnail cards */
    .thumb {
        padding: 3px;
        gap: 4px;
    }

    .thumb .mini {
        width: 36px;
        height: 36px;
    }

    .thumb-with-action .thumb-name {
        font-size: 9px;
    }

    .add-to-build-btn {
        padding: 2px 6px;
        font-size: 8px;
    }

    /* Eye row / view build */
    .eye-row {
        padding: 2px;
    }

    .view-build-panel-btn {
        padding: 2px 6px;
        font-size: 9px;
    }

    /* Fullscreen button */
    .fullscreen-btn {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* ============================================================================
   IPHONE SAFARI LANDSCAPE — vertical navbar on the right side
   iPhone lacks the Fullscreen API so JS tags <html> with .is-iphone-safari.
   Move the navbar from the bottom to a vertical strip on the right, reclaiming
   the bottom 80px for the stage/viewer.
   ============================================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .is-iphone-safari .pill-navbar-wrapper {
        position: fixed;
        bottom: auto;
        left: auto;
        right: calc(env(safe-area-inset-right, 0px) + var(--iphone-nav-edge-gap, 0px));
        top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
        gap: 0;
        border-radius: 10px;
        z-index: 2147483647;
        padding: 0;
    }

    /* Icon-only nav: hide text labels, show icons */
    .is-iphone-safari .pill-navbar .nav-link .nav-text {
        display: none;
    }

    .is-iphone-safari .pill-navbar .nav-link .nav-icon {
        display: block;
        font-size: 1rem;
        line-height: 1;
    }

    .is-iphone-safari .pill-navbar-wrapper .pill-navbar {
        flex-direction: column;
        border-radius: 10px;
        padding: 3px 2px !important;
        max-width: none;
        width: auto;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

    .is-iphone-safari .pill-navbar .nav {
        flex-direction: column;
        gap: 0 !important;
        align-items: center;
    }

    .is-iphone-safari .pill-navbar .nav-link {
        padding: 5px !important;
        font-size: 0;
        text-align: center;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border-radius: 6px !important;
    }

    .is-iphone-safari .pill-navbar .cart-nav-link {
        font-size: 0;
    }

    .is-iphone-safari .pill-navbar .cart-nav-link .cart-icon-wrapper {
        width: 18px;
        height: 18px;
    }

    /* Hide fullscreen button on iPhone — fullscreen is auto-triggered */
    .is-iphone-safari .pill-navbar-bubble {
        display: none !important;
    }

    /* Reclaim the bottom space — stage can use full height */
    .is-iphone-safari .stage {
        padding-right: calc(var(--iphone-nav-reserved-right, 40px) + env(safe-area-inset-right, 0px));
    }
}


/* ============================================================================
   IPHONE SAFARI COMPACT CARDS & PANELS (landscape only)
   Scoped to .is-iphone-safari so Android & desktop are unaffected.
   ============================================================================
*/
@media (max-height: 500px) and (orientation: landscape) {

    /* Thumbnail cards */
    .is-iphone-safari .thumb {
        padding: 3px 4px;
        gap: 4px;
        border-radius: 6px;
    }

    .is-iphone-safari .thumb .mini {
        width: 32px;
        height: 32px;
        border-radius: 4px;
    }

    .is-iphone-safari .thumb-with-action .thumb-name {
        font-size: 9px;
        line-height: 1.1;
    }

    .is-iphone-safari .add-to-build-btn {
        padding: 2px 5px;
        font-size: 8px;
    }

    .is-iphone-safari .tab-section-title {
        font-size: 8px;
        margin: 2px 0 1px 4px;
    }

    .is-iphone-safari .thumbs-grid {
        gap: 3px;
    }

    /* Material / option buttons */
    .is-iphone-safari .material-btn-wrapper .material-btn {
        padding: 4px 6px;
        border-radius: 6px;
        min-height: 0;
    }

    .is-iphone-safari .option-btn {
        padding: 4px 6px;
        border-radius: 6px;
    }

    .is-iphone-safari .option-name,
    .is-iphone-safari .material-name {
        font-size: 9px;
    }

    .is-iphone-safari .material-info-btn {
        width: 22px;
        height: auto;
        font-size: 8px;
    }

    .is-iphone-safari .material-btn-wrapper .material-btn {
        border-radius: 6px 0 0 6px;
    }

    .is-iphone-safari .material-btn-wrapper .material-info-btn {
        border-radius: 0 6px 6px 0;
    }

    .is-iphone-safari .options-grid {
        gap: 3px;
        padding: 2px;
    }

    /* Tabs */
    .is-iphone-safari .tab-btn,
    .is-iphone-safari .option-tab-btn {
        padding: 2px 4px;
        font-size: 9px;
    }

    .is-iphone-safari .tab-nav {
        gap: 0;
        min-height: 0;
    }

    /* Mode selector */
    .is-iphone-safari .viewer-mode-selector {
        padding: 1px 4px;
        gap: 1px;
    }

    .is-iphone-safari .mode-display {
        padding: 2px 6px;
    }

    .is-iphone-safari .mode-display-text .mode-label {
        font-size: 9px;
    }

    /* Slide/Rotate row */
    .is-iphone-safari .slide-rotate-toggle button {
        padding: 1px 5px;
        font-size: 8px;
    }

    .is-iphone-safari .scroll-hint {
        font-size: 7px;
    }

    /* Selection summary */
    .is-iphone-safari .selection-summary {
        padding: 1px 4px;
        font-size: 8px;
    }

    .is-iphone-safari .summary-row {
        line-height: 1.15;
    }

    /* Purchase card */
    .is-iphone-safari .purchase-card {
        padding: 1px 0 0 0;
        border-radius: 6px;
    }

    .is-iphone-safari .price-display {
        margin: 1px 4px;
        padding: 2px 4px;
        border-radius: 4px;
    }

    .is-iphone-safari .price-label {
        font-size: 8px;
    }

    .is-iphone-safari .price-value {
        font-size: 11px;
    }

    .is-iphone-safari .wallet-actions {
        gap: 2px;
        margin: 1px 4px 2px 4px;
    }

    .is-iphone-safari .wallet-actions .add-to-cart-btn {
        padding: 3px 6px;
        font-size: 9px;
        border-radius: 4px;
    }

    .is-iphone-safari .preview-wallet-btn {
        padding: 3px 6px;
        font-size: 9px;
        border-radius: 4px;
    }

    .is-iphone-safari .add-to-cart-btn:not(.wallet-actions .add-to-cart-btn) {
        margin: 1px 4px 2px 4px;
        padding: 3px 6px;
        font-size: 9px;
        border-radius: 4px;
    }

    /* Parts bar */
    .is-iphone-safari .parts-breakdown-bar {
        padding: 1px;
    }

    .is-iphone-safari .parts-breakdown-bar .part-item {
        padding: 1px 3px;
        min-width: 40px;
    }

    .is-iphone-safari .parts-breakdown-bar .part-item .part-name {
        font-size: 7px;
    }

    /* Colors */
    .is-iphone-safari .color-swatch {
        width: 16px;
        height: 16px;
    }

    .is-iphone-safari .colors-grid {
        gap: 2px;
    }

    /* Eye row */
    .is-iphone-safari .eye-row {
        padding: 1px;
    }

    .is-iphone-safari .view-build-panel-btn {
        padding: 1px 4px;
        font-size: 8px;
    }

    /* Fullscreen button */
    .is-iphone-safari .fullscreen-btn {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }

    /* ──────────────────────────────────────────────────────────────────────
       iPhone Safari page-css-fullscreen: horizontal-only expansion.
       Keep the navbar visible but reclaim the extra stage padding so the
       three columns use the full width. Do NOT change height or add
       position:fixed — the normal landscape layout already fits.
       ────────────────────────────────────────────────────────────────────── */

    /* Undo the generic page-css-fullscreen position:fixed on <html> */
    .is-iphone-safari.page-css-fullscreen {
        position: static;
        inset: auto;
        z-index: auto;
        overflow: visible;
    }

    /* Remove the extra right padding that reserved space for the navbar —
       the navbar is position:fixed so it overlays on top regardless */
    .is-iphone-safari.page-css-fullscreen .stage {
        padding-right: calc(0.5vw + env(safe-area-inset-right));
        min-height: auto;
        height: 100vh;
        height: 100dvh;
    }
}
/* ============================================================================
   ROTATE DEVICE PROMPT — portrait mode on phones
   ============================================================================ */
.rotate-device-prompt {
    display: none;
}

@media (max-width: 768px) and (orientation: portrait) {
    .rotate-device-prompt {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        position: fixed;
        inset: 0;
        z-index: 9999;
        background: rgba(10, 10, 15, 0.97);
    }

    .rotate-device-icon {
        font-size: 64px;
        animation: rotate-phone 2s ease-in-out infinite;
    }

    /* iPhone Safari: rotate counter-clockwise (camera on the left) */
    .is-iphone-safari .rotate-device-icon {
        animation: rotate-phone-left 2s ease-in-out infinite;
    }

    .rotate-device-text {
        color: #ccc;
        font: 500 16px/1.4 system-ui, sans-serif;
        text-align: center;
        max-width: 260px;
    }

    @keyframes rotate-phone {
        0%, 100% { transform: rotate(0deg); }
        25% { transform: rotate(90deg); }
        50%, 75% { transform: rotate(90deg); }
    }

    @keyframes rotate-phone-left {
        0%, 100% { transform: rotate(0deg); }
        25% { transform: rotate(-90deg); }
        50%, 75% { transform: rotate(-90deg); }
    }

    .stage {
        display: none;
    }
}

/* ============================================================================
   MATERIAL INFO BUTTON & TOOLTIP
   ============================================================================ */
.material-btn-wrapper {
    position: relative;
    width: 100%;
}

.material-btn-wrapper .material-btn {
    width: 100%;
    position: relative;
}

.material-info-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 50%;
    color: #a78bfa;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.material-info-btn:hover {
    background: rgba(139, 92, 246, 0.5);
    border-color: #8b5cf6;
    color: #fff;
    transform: scale(1.1);
}

/* Tooltip in wrapper (hidden, used as template) */
.material-btn-wrapper .material-info-tooltip {
    display: none;
}

/* Tooltip appended to body */
body > .material-info-tooltip {
    position: fixed;
    width: 280px;
    background: rgba(25, 25, 35, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.2);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

body > .material-info-tooltip.show {
    opacity: 1;
    pointer-events: auto;
}

.material-info-tooltip .tooltip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.material-info-tooltip .tooltip-header .material-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(168, 85, 247, 0.3));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.material-info-tooltip .tooltip-header .material-title {
    flex: 1;
}

.material-info-tooltip .tooltip-header .material-title h4 {
    font: 15px/1.2 system-ui, sans-serif;
    font-weight: 600;
    color: #fff;
    margin: 0 0 2px 0;
}

.material-info-tooltip .tooltip-header .material-title .material-code {
    font: 11px/1.2 system-ui, sans-serif;
    color: #888;
}

.material-info-tooltip .tooltip-description {
    font: 13px/1.5 system-ui, sans-serif;
    color: #c8c8d0;
    margin-bottom: 12px;
}

.material-info-tooltip .tooltip-stats {
    display: flex;
    gap: 12px;
}

.material-info-tooltip .tooltip-stat {
    flex: 1;
    background: rgba(40, 40, 55, 0.6);
    padding: 10px 12px;
    border-radius: 8px;
    text-align: center;
}

.material-info-tooltip .tooltip-stat .stat-value {
    font: 16px/1.2 system-ui, sans-serif;
    font-weight: 700;
    color: #a78bfa;
}

.material-info-tooltip .tooltip-stat .stat-label {
    font: 10px/1.2 system-ui, sans-serif;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.material-info-tooltip .no-details {
    font: 12px/1.4 system-ui, sans-serif;
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 8px 0;
}

/* Material Specs Grid */
.material-info-tooltip .tooltip-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(40, 40, 55, 0.5);
    border-radius: 8px;
}

.material-info-tooltip .spec-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.material-info-tooltip .spec-label {
    font: 10px/1.2 system-ui, sans-serif;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.material-info-tooltip .spec-value {
    font: 14px/1.2 system-ui, sans-serif;
    font-weight: 600;
    color: #a78bfa;
}

/* Best For Tagline */
.material-info-tooltip .tooltip-bestfor {
    font: 13px/1.4 system-ui, sans-serif;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

/* ============================================================================
   WALLET WELCOME TOOLTIP
   ============================================================================ */
.wallet-welcome-tooltip {
    position: fixed;
    max-width: clamp(180px, 28vw, 560px);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.wallet-welcome-tooltip.show {
    opacity: 1;
    pointer-events: auto;
}

.wallet-welcome-tooltip .welcome-tooltip-content {
    position: relative;
    background: #291d43;
    border: 1px solid rgba(139, 92, 246, 0.6);
    border-radius: clamp(8px, 1vw, 18px);
    padding: clamp(8px, 1.1vw, 24px) clamp(10px, 1.2vw, 28px) clamp(6px, 0.9vw, 20px) clamp(8px, 1.1vw, 24px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.55);
    font: clamp(11px, 1vw, 18px)/1.4 system-ui, sans-serif;
    color: #e5e7eb;
}

.wallet-welcome-tooltip .welcome-tooltip-content::before {
    content: "";
    position: absolute;
    top: clamp(-7px, -0.6vw, -12px);
    left: 50%;
    width: clamp(12px, 1.2vw, 24px);
    height: clamp(12px, 1.2vw, 24px);
    background: #291d43;
    border-top: 1px solid rgba(139, 92, 246, 0.6);
    border-left: 1px solid rgba(139, 92, 246, 0.6);
    transform: translateX(-50%) rotate(45deg);
}

.welcome-tooltip-icon {
    display: inline-flex;
    width: clamp(18px, 1.6vw, 36px);
    height: clamp(18px, 1.6vw, 36px);
    align-items: center;
    justify-content: center;
    background: rgba(250, 204, 21, 0.15);
    border: 1px solid rgba(250, 204, 21, 0.4);
    border-radius: 999px;
    margin-right: clamp(4px, 0.4vw, 12px);
    font-size: clamp(10px, 0.9vw, 18px);
}

.wallet-welcome-tooltip strong {
    color: #fbbf24;
}

.welcome-tooltip-qmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(14px, 1.2vw, 26px);
    height: clamp(14px, 1.2vw, 26px);
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.6);
    background: rgba(30, 30, 40, 0.95);
    color: #a78bfa;
    font: 600 clamp(9px, 0.8vw, 15px)/1 system-ui, sans-serif;
    vertical-align: middle;
    margin: 0 clamp(1px, 0.15vw, 4px);
}

.welcome-tooltip-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: clamp(4px, 0.5vw, 10px);
}

.welcome-tooltip-dismiss {
    padding: clamp(4px, 0.35vw, 10px) clamp(10px, 0.9vw, 22px);
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: #fff;
    font: 600 clamp(10px, 0.85vw, 16px)/1 system-ui, sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-tooltip-dismiss:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.35);
}

.welcome-tooltip-dismiss:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ============================================================================
   LIGHT THEME OVERRIDES
   ============================================================================ */

/* Scrollbars */
[data-theme="light"] .tab-content::-webkit-scrollbar-track,
[data-theme="light"] .parts-panel::-webkit-scrollbar-track,
[data-theme="light"] .options-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .tab-content::-webkit-scrollbar-thumb,
[data-theme="light"] .parts-panel::-webkit-scrollbar-thumb,
[data-theme="light"] .options-panel::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
}

[data-theme="light"] .tab-content,
[data-theme="light"] .parts-panel,
[data-theme="light"] .options-panel {
    scrollbar-color: rgba(100, 116, 139, 0.3) rgba(0, 0, 0, 0.04);
}

/* Parts panel (left sidebar) */
[data-theme="light"] .parts-panel {
    background: var(--panel-bg, rgba(240, 242, 246, 0.92));
    border-color: var(--panel-border, rgba(0, 0, 0, 0.08));
}

/* Options panel (right sidebar) */
[data-theme="light"] .options-panel {
    background: var(--panel-bg, rgba(240, 242, 246, 0.92));
    border-color: var(--panel-border, rgba(0, 0, 0, 0.08));
}

/* Tab navigation */
[data-theme="light"] .tab-nav {
    background: rgba(0, 0, 0, 0.03);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tab-btn,
[data-theme="light"] .option-tab-btn {
    color: #64748b;
}

[data-theme="light"] .tab-btn:hover,
[data-theme="light"] .option-tab-btn:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .tab-btn.active,
[data-theme="light"] .option-tab-btn.active {
    color: #0f172a;
    background: rgba(59, 130, 246, 0.08);
}

/* Per-tab colors - soften for light */
[data-theme="light"] .tab-btn[data-tab="covers"] { color: #0369a1; }
[data-theme="light"] .tab-btn[data-tab="card-inserts"] { color: #6d28d9; }
[data-theme="light"] .tab-btn[data-tab="specialty"] { color: #a21caf; }

[data-theme="light"] .tab-btn[data-tab="prebuilts"].active,
[data-theme="light"] .tab-btn[data-tab="covers"].active,
[data-theme="light"] .tab-btn[data-tab="card-inserts"].active,
[data-theme="light"] .tab-btn[data-tab="specialty"].active {
    color: #0f172a;
}

/* Option tabs */
[data-theme="light"] .option-tab-btn[data-option-tab="materials"] { color: #78716c; }
[data-theme="light"] .option-tab-btn[data-option-tab="colors"] { color: #64748b; }
[data-theme="light"] .option-tab-btn[data-option-tab="materials"].active,
[data-theme="light"] .option-tab-btn[data-option-tab="colors"].active { color: #0f172a; }

/* Section titles */
[data-theme="light"] .tab-section-title {
    color: #64748b;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Thumbnails */
[data-theme="light"] .thumb {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

[data-theme="light"] .thumb:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .thumb.selected {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="light"] .thumb.active {
    background: rgba(245, 158, 11, 0.08);
    border-color: #d97706;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.15), inset 0 0 0 1px rgba(245, 158, 11, 0.1);
}

[data-theme="light"] .thumb .mini {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .thumb span {
    color: #1e293b;
}

/* Thumb with action */
[data-theme="light"] .thumb-with-action .thumb {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .thumb-with-action .thumb:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Material / option buttons */
[data-theme="light"] .option-btn,
[data-theme="light"] .material-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .option-btn:hover,
[data-theme="light"] .material-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .option-btn.active,
[data-theme="light"] .material-btn.active {
    background: rgba(245, 158, 11, 0.06);
    border-color: #d97706;
}

[data-theme="light"] .option-name {
    color: #0f172a;
}

[data-theme="light"] .option-desc {
    color: #64748b;
}

/* Color buttons */
[data-theme="light"] .color-btn {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .color-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .color-swatch {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .color-btn span {
    color: #64748b;
}

[data-theme="light"] .color-btn.active span {
    color: #0f172a;
}

/* Selection summary */
[data-theme="light"] .selection-summary {
    background: rgba(0, 0, 0, 0.03);
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .summary-label {
    color: #64748b;
}

[data-theme="light"] .summary-value {
    color: #0f172a;
}

/* Purchase card */
[data-theme="light"] .purchase-card {
    background: var(--panel-bg, rgba(240, 242, 246, 0.92));
    border-color: var(--panel-border, rgba(0, 0, 0, 0.08));
}

/* Price display */
[data-theme="light"] .price-display {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .price-label {
    color: #64748b;
}

[data-theme="light"] .price-value {
    color: #6d28d9;
}

/* Mode buttons */
[data-theme="light"] .mode-btn {
    background: rgba(0, 0, 0, 0.04);
    color: #475569;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .mode-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

[data-theme="light"] .mode-btn.active {
    color: #fff;
}

/* Viewer fullscreen (keep dark) */
[data-theme="light"] #viewer.fullscreen {
    background: #0a0a0f;
}

/* Parts breakdown bar */
[data-theme="light"] .parts-breakdown-bar {
    background: var(--panel-bg, rgba(240, 242, 246, 0.92));
    border-color: var(--panel-border, rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .part-step {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #475569;
}

[data-theme="light"] .part-step.active {
    border-color: #d97706;
    background: rgba(245, 158, 11, 0.06);
    color: #0f172a;
}

[data-theme="light"] .part-step-name {
    color: #1e293b;
}

/* Eyelid color for light backgrounds */
[data-theme="light"] .eye::before {
    background: #e2e8f0;
}

/* Pinch hint / tooltip overlays */
[data-theme="light"] .pinch-hint {
    background: rgba(255, 255, 255, 0.85);
    color: #475569;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Info tooltip */
[data-theme="light"] .material-info-tooltip {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: #1e293b;
}

/* Mode buttons card */
[data-theme="light"] .mode-buttons-card {
    background: var(--panel-bg, rgba(240, 242, 246, 0.92));
    border-color: var(--panel-border, rgba(0, 0, 0, 0.08));
}

/* Fullscreen button */
[data-theme="light"] .fullscreen-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #475569;
}

[data-theme="light"] .fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

/* Mode selector dropdown */
[data-theme="light"] .mode-display {
    background: var(--panel-bg, rgba(240, 242, 246, 0.92));
    border-color: rgba(99, 102, 241, 0.25);
    color: #1e293b;
}

[data-theme="light"] .mode-display:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="light"] .mode-display-text .mode-label {
    color: #0f172a;
}

[data-theme="light"] .mode-display-text .mode-desc {
    color: #64748b;
}

[data-theme="light"] .mode-dropdown-arrow {
    color: #64748b;
}

[data-theme="light"] .mode-dropdown {
    background: rgba(245, 246, 248, 0.98);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mode-dropdown-item {
    color: #475569;
}

[data-theme="light"] .mode-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #0f172a;
}

[data-theme="light"] .mode-dropdown-item[data-mode="prebuilt"] {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .mode-dropdown-item[data-mode="custom"] {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mode-dropdown-item[data-mode="parts"] {
    background: rgba(6, 182, 212, 0.06);
    border-color: rgba(6, 182, 212, 0.2);
}

/* Custom info modal */
[data-theme="light"] .custom-info-modal-content {
    background: rgba(245, 246, 248, 0.98);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .custom-info-modal-content h2 {
    color: #0f172a;
}

[data-theme="light"] .info-section h3 {
    color: #6d28d9;
}

[data-theme="light"] .info-section p {
    color: #475569;
}

[data-theme="light"] .info-section ul {
    color: #475569;
}

[data-theme="light"] .info-section {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Guide modals (prebuilt/custom/parts) */
[data-theme="light"] .prebuilt-guide-content,
[data-theme="light"] .custom-guide-content,
[data-theme="light"] .parts-guide-content {
    background: rgba(245, 246, 248, 0.98);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .guide-intro {
    color: #64748b;
}

[data-theme="light"] .text-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .text-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .text-card h4 {
    color: #1e293b;
}

[data-theme="light"] .text-card p {
    color: #64748b;
}

[data-theme="light"] .text-card p strong {
    color: #6d28d9;
}

[data-theme="light"] .video-card {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Admin modal controls */
[data-theme="light"] .admin-modal-controls {
    background: rgba(0, 0, 0, 0.03);
    border-top-color: rgba(0, 0, 0, 0.08);
}

/* Zoom hint */
[data-theme="light"] .zoom-hint {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
    color: #64748b;
}

/* UI overlay panel */
[data-theme="light"] .ui-panel {
    background: rgba(245, 246, 248, 0.92);
    color: #1e293b;
}

[data-theme="light"] .ui-panel button,
[data-theme="light"] .ui-panel input[type="number"] {
    background: var(--input-bg, #f0f1f5);
    border-color: var(--input-border, #cbd5e1);
    color: var(--input-text, #1e293b);
}

/* Eye helper popup */
[data-theme="light"] .eye-helper-popup {
    background: rgba(245, 246, 248, 0.97);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .eye-helper-message {
    color: #334155;
}

[data-theme="light"] .eye-helper-close {
    color: #94a3b8;
}

[data-theme="light"] .eye-helper-close:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.06);
}

/* Parts breakdown items */
[data-theme="light"] .parts-breakdown-bar .part-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .parts-breakdown-bar .part-item:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .parts-breakdown-bar .part-item .part-name {
    color: #1e293b;
}

[data-theme="light"] .parts-breakdown-bar .connector {
    color: #94a3b8;
}

[data-theme="light"] .parts-breakdown-bar .empty-message {
    color: #94a3b8;
}

[data-theme="light"] .clear-parts-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .parts-breakdown-wrapper.has-parts .clear-parts-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Material info tooltip - detailed overrides */
[data-theme="light"] body > .material-info-tooltip {
    background: rgba(245, 246, 248, 0.98);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .material-info-tooltip .tooltip-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .material-info-tooltip .tooltip-header .material-title h4 {
    color: #0f172a;
}

[data-theme="light"] .material-info-tooltip .tooltip-description {
    color: #475569;
}

[data-theme="light"] .material-info-tooltip .tooltip-stat {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .material-info-tooltip .tooltip-specs {
    background: rgba(0, 0, 0, 0.03);
}

/* Welcome tooltip */
[data-theme="light"] .wallet-welcome-tooltip .welcome-tooltip-content {
    background: #f0eff8;
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.12);
    color: #334155;
}

[data-theme="light"] .wallet-welcome-tooltip .welcome-tooltip-content::before {
    background: #f0eff8;
    border-top-color: rgba(99, 102, 241, 0.3);
    border-left-color: rgba(99, 102, 241, 0.3);
}

/* Custom info button */
[data-theme="light"] .custom-info-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(99, 102, 241, 0.4);
    color: #6d28d9;
}

[data-theme="light"] .custom-info-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #4f46e5;
}

/* Material info button */
[data-theme="light"] .material-info-btn {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #6d28d9;
}

[data-theme="light"] .material-info-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #4f46e5;
}

/* Add to build button */
[data-theme="light"] .add-to-build-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    border-color: rgba(99, 102, 241, 0.2);
    color: #6d28d9;
}

[data-theme="light"] .add-to-build-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    color: #4f46e5;
}

/* Thumb name text */
[data-theme="light"] .thumb-with-action .thumb-name {
    color: #1e293b;
}

/* Eye hint button */
[data-theme="light"] .eye-hint-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.08));
    border-color: rgba(59, 130, 246, 0.3);
    color: #2563eb;
}

[data-theme="light"] .eye-hint-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.15));
    color: #1d4ed8;
}



