
/* ─────────────────────────────────────────────────────────────────────────────
   1. CSS VARIABLES — DARK MODE (DEFAULT)
   Every colour in the app flows from these tokens. To change the dark theme,
   edit here. To change the light theme, edit Section 2.
   ───────────────────────────────────────────────────────────────────────────── */
:root {
    --bg:                  #000000;
    --text:                #ffffff;
    --muted:               #a1a1aa;
    --card-bg:             #0a0a0a;
    --card-border:         #18181b;
    --details-bg:          #000000;
    --details-border:      #18181b;
    --total-bg:            #0a0a0a;
    --modal-bg:            #09090b;
    --input-bg:            #000000;
    --input-border:        #27272a;
    --btn-bg:              #18181b;
    --btn-text:            #ffffff;
    --btn-border:          #27272a;
    --accent:              #3b82f6;
    --glow-color:          rgba(59, 130, 246, 0.125); /* glow dialled to 50% */
    --header-border:       #18181b;
    --dropdown-bg:         #09090b;
    --dropdown-border:     #27272a;
    --dropdown-item:       #ffffff;
    --dropdown-hover-bg:   #18181b;
    --dropdown-hover-text: #3b82f6;
    --store-option-active-bg: rgba(59, 130, 246, 0.08);

    /* Functional Accents */
    --wizard-accent:       #4f46e5;
    --wizard-glow:         rgba(79, 70, 229, 0.125); /* glow dialled to 50% */
    --success-green:       #00ff9d;
    --warning-amber:       #f59e0b;
    --danger-red:          #ef4444;
}


/* ─────────────────────────────────────────────────────────────────────────────
   2. LIGHT MODE TOKENS
   Redefining only the tokens that differ. Every component that reads var()
   automatically restyles — no per-element light-mode overrides needed for
   those properties.
   ───────────────────────────────────────────────────────────────────────────── */
body.light-mode {
    /* Main Layout */
    --bg:                 #f6f1e8;
    --text:               #2f2a25;
    --muted:              #6c6258;
    
    /* Cards & Containers */
    --card-bg:            #fffaf2;
    --card-border:        #e6d8c7;
    --details-bg:         #fcf6ed;
    --details-border:     #e8dccd;
    --total-box-bg:       #fff8ee;
    --total-bg:           #fff8ee;
    --modal-bg:           #fff8ee;
    
    /* Interactive Elements */
    --input-bg:           #fffdf9;
    --input-border:       #e3d6c6;
    --input-text:         #2f2a25;
    --btn-bg:             #efe2d1;
    --btn-text:           #3c3026;
    --btn-border:         #d9c6b0;
    
    /* Branding & Glows */
    --accent:             #c88b5a;
    --glow-color:         rgba(200, 139, 90, 0.175); /* glow dialled to 50% */
    --header-border:      #e7d8c6;
    
    /* Dropdown Menus */
    --dropdown-bg:         #fff8ee;
    --dropdown-border:     #dfcfbc;
    --dropdown-item:       #2f2a25;
    --dropdown-hover-bg:   #f3e7d9;
    --dropdown-hover-text: #8a5a34;
    --store-option-active-bg: rgba(200, 139, 90, 0.14);
    
    /* Breathing Error States */
    --warning-bg:         #fff1f2;
    --warning-text:       #991b1b;
    --warning-border:     #fca5a5;
}


/* ─────────────────────────────────────────────────────────────────────────────
   3. GLOBAL RESET
   Universal box model, body baseline, heading rules, and part thumbnails.
   ───────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 20px;
}

h2, h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
    font-weight: 600;
}

/* Part thumbnails — subtle border, constrained size, zoom on hover */
img {
    border: 1px solid #1f2937;
    background-color: #000;
    max-width: 100px;
    width: 100%;
    border-radius: 6px;
    transition: transform 0.25s ease;
}
img:hover { transform: scale(1.05); }

/* JS controls zoom on selected-part images.
   The global img:hover scale(1.05) has no !important so JS inline styles
   already win — no override needed here. */


/* ─────────────────────────────────────────────────────────────────────────────
   4. STRUCTURAL TWO-COLUMN WORKSPACE
   Left: 65% Component Checklist (Scrolling)
   Right: 35% Sticky Summary Card (Data stays visible at all times)
   ───────────────────────────────────────────────────────────────────────────── */
.main-container {
    display: flex;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    gap: 28px;
    align-items: flex-start;
    box-sizing: border-box;
}

.build-sheet {
    flex: 0 0 calc(65% - 14px);
    width: calc(65% - 14px);
    max-width: calc(65% - 14px);
    box-sizing: border-box;
    order: 1;
}

.summary-sidebar {
    flex: 0 0 calc(35% - 14px);
    width: calc(35% - 14px);
    max-width: calc(35% - 14px);
    position: sticky;
    top: 20px;
    box-sizing: border-box;
    order: 2;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.summary-sidebar::-webkit-scrollbar {
    width: 5px;
}
.summary-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.summary-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 4px;
}

@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
        padding: 10px;
        gap: 12px;
    }
    .build-sheet {
        order: 2;
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }
    .summary-sidebar {
        order: -1;
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
        margin-bottom: 8px;
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   5. CARDS
   .card         — main content panels (component slots, compat checker)
   .details-box  — inner info row holding the thumbnail, specs, and buttons
   .total-box    — summary / pricing panel in the sidebar
   ───────────────────────────────────────────────────────────────────────────── */
@keyframes pop-up-fade {
    0% { opacity: 0; transform: translateY(20px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.2s ease;
    animation: pop-up-fade 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.card:hover { border-color: #27272a; }

.details-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    background: var(--details-bg);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--details-border);
    width: 100%;
}

.total-box {
    padding: 24px;
    border-radius: 12px;
    background: var(--total-bg);
    border: 1px solid var(--card-border);
    text-align: center;
}


/* ─────────────────────────────────────────────────────────────────────────────
   6. PRICE & WATTAGE DISPLAY
   Per-part prices default to slate. Total and wattage get theme-specific
   colours applied in Sections 17–18.
   ───────────────────────────────────────────────────────────────────────────── */
#cpu-price-aqua, #gpu-price-aqua, #mobo-price-aqua,    #ram-price-aqua,
#cooler-price-aqua, #storage-price-aqua, #psu-price-aqua, #case-price-aqua {
    color: #94a3b8;
    font-weight: 600;
}
#total-price   { color: #e2e8f0; font-weight: 700; font-size: 1.6rem; }
#total-wattage { color: #fbbf24; font-weight: 600; }


/* ─────────────────────────────────────────────────────────────────────────────
   7. BUTTONS
   Five variants: add-part (dashed full-width), change (small inline),
   remove (red icon), clear-all (danger outline), inquiry (CTA).
   All read from --btn-* and --accent tokens so they restyle with the theme.
   ───────────────────────────────────────────────────────────────────────────── */

/* Dashed prompt at the bottom of each empty component slot */
@keyframes add-btn-breathe {
    0%, 100% { border-color: var(--input-border); }
    50%      { border-color: var(--accent); }
}

.add-part-btn {
    width: 100%;
    display: block;
    background-color: var(--details-bg);
    color: #ffffff;
    border: 1px solid var(--input-border);
    padding: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: add-btn-breathe 3.5s infinite ease-in-out;
}
.add-part-btn:hover {
    background-color: var(--btn-bg);
    color: #ffffff !important;
    border-style: solid;
    border-color: var(--accent) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: translateY(-2px);
}

/* Small "Change" button alongside a selected part */
.change-btn {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.change-btn:hover { 
    background: var(--accent); 
    color: #000; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 50%, transparent);
}
.change-btn:active { 
    transform: translateY(1px) scale(0.95); 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Square red icon button to remove a selected part */
.remove-btn {
    background: #2a1414;
    color: #ef4444;
    border: 1px solid #7f1d1d;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    flex-shrink: 0;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.remove-btn:hover { 
    background: #ef4444; 
    color: white; 
    transform: scale(1.15) rotate(90deg); 
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}
.remove-btn:active { 
    transform: scale(0.9) rotate(90deg); 
}

/* Full-width CTA — colours set per-theme in Sections 17–18 */
.inquiry-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Ask AI trigger — fades in with sidebar cascade; hover matches .change-btn */
.ask-ai-wrap {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
    animation: pop-up-fade 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.2s;
}

.ask-ai-btn {
    background: var(--wizard-accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--wizard-glow);
}
.ask-ai-btn:hover {
    background: color-mix(in srgb, var(--wizard-accent) 80%, black);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--wizard-glow);
    transform: translateY(-2px);
}
.ask-ai-btn:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
html[lang="ar"] .ask-ai-btn {
    font-size: 0.75rem;
    padding: 4px 10px;
}

/* Slow ambient pulse for the Ask AI button — animates the glow halo only.
   No transform is used so the :hover lift / :active press stay intact. */
@keyframes pulse-slow {
    0%, 100% {
        box-shadow: 0 2px 8px var(--wizard-glow);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 2px 18px var(--wizard-glow),
                    0 0 0 3px color-mix(in srgb, var(--wizard-accent) 22%, transparent);
        filter: brightness(1.12);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@media (prefers-reduced-motion: reduce) {
    .animate-pulse-slow {
        animation: none;
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   8. PART ROWS
   Each selectable part row in the modal list. Incompatible parts are
   greyed-out with a red left stripe and pointer-events removed.
   ───────────────────────────────────────────────────────────────────────────── */
.part-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border-bottom: 1px solid #273244;
    gap: 20px;
    transition: 0.15s ease;
}
.part-row:hover { background-color: #111827; }

/* Incompatible state — greyed out, red left border, non-interactive */
.part-row.incompatible {
    opacity: 0.5;
    filter: grayscale(0.8);
    background-color: #0a0c0f;
    border-left: 3px solid #ef4444;
}
.part-row.incompatible .add-btn {
    background: #444 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    border-color: #555 !important;
}

/* Sold-out but still addable — dim the row, but lift it fully opaque when the store menu is open */
.part-row.sold-out {
    opacity: 0.55;
}
.part-row.store-menu-open {
    position: relative;
    z-index: 9999;
    opacity: 1 !important;
}
.store-select-menu {
    z-index: 10000;
}

/* ── Store Price Matrix ───────────────────────────────────────────────────────
   Mini-table inside the store menu comparing all five stores. The cheapest
   in-stock store gets a crown and a soft glowing border. */
.store-matrix { width: 100%; }

.store-matrix-head {
    display: flex;
    justify-content: space-between;
    padding: 0 10px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.store-matrix-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.22);
    cursor: pointer;
    transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.store-matrix-row:hover { filter: brightness(1.2); }

.store-matrix-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #cbd5e1;
}

.store-matrix-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: #60a5fa;
    white-space: nowrap;
}

.store-crown {
    font-size: 0.9rem;
    line-height: 1;
}

/* Cheapest in-stock store — crown + soft glow border */
.store-matrix-row.is-cheapest {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.22), 0 0 14px rgba(34, 197, 94, 0.28);
}
.store-matrix-row.is-cheapest .store-matrix-name,
.store-matrix-row.is-cheapest .store-matrix-price { color: #4ade80; }

/* Sold out */
.store-matrix-row.is-oos {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}
.store-matrix-row.is-oos .store-matrix-name,
.store-matrix-row.is-oos .store-matrix-price { color: #f87171; }

/* Store has no listing for this part */
.store-matrix-row.is-unavailable {
    background: rgba(100, 116, 139, 0.05);
    border: 1px dashed rgba(100, 116, 139, 0.25);
    opacity: 0.55;
    cursor: default;
}
.store-matrix-row.is-unavailable .store-matrix-name,
.store-matrix-row.is-unavailable .store-matrix-price { color: #94a3b8; }

/* Incompatible with the current build — visible but not selectable */
.store-matrix-row.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Light mode ── */
body.light-mode .store-matrix-head { color: #8b95a5; }
body.light-mode .store-matrix-row { background: rgba(59, 130, 246, 0.07); border-color: rgba(59, 130, 246, 0.2); }
body.light-mode .store-matrix-name { color: #3f4d61; }
body.light-mode .store-matrix-price { color: #2563eb; }
body.light-mode .store-matrix-row.is-cheapest {
    background: #e9f9ef;
    border-color: #34d399;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2), 0 0 14px rgba(16, 185, 129, 0.22);
}
body.light-mode .store-matrix-row.is-cheapest .store-matrix-name,
body.light-mode .store-matrix-row.is-cheapest .store-matrix-price { color: #1f9d58; }
body.light-mode .store-matrix-row.is-oos { background: #fef2f2; border-color: #f87171; }
body.light-mode .store-matrix-row.is-oos .store-matrix-name,
body.light-mode .store-matrix-row.is-oos .store-matrix-price { color: #dc2626; }
body.light-mode .store-matrix-row.is-unavailable { background: #f1f5f9; border-color: #d8e0ea; }
body.light-mode .store-matrix-row.is-unavailable .store-matrix-name,
body.light-mode .store-matrix-row.is-unavailable .store-matrix-price { color: #8b95a5; }

/* ── Modal Skeleton Loader ────────────────────────────────────────────────────
   Grey placeholder rows shown for a beat while the part list populates. */
@keyframes skeletonPulse {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 0.9; }
}

.skeleton-block {
    background: #1e293b;
    border-radius: 6px;
    animation: skeletonPulse 1s ease-in-out infinite;
}

.skeleton-row {
    display: grid;
    grid-template-columns: 100px 1fr 100px;
    gap: 15px;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #121821;
    border: 1px solid #2a3a4f;
    border-radius: 6px;
}

.skeleton-thumb { width: 100px; height: 100px; border-radius: 4px; }

.skeleton-lines { display: flex; flex-direction: column; gap: 10px; }

.skeleton-line { height: 12px; }
.skeleton-line-lg { width: 70%; }
.skeleton-line-md { width: 45%; }
.skeleton-line-sm { width: 30%; }

.skeleton-btn { width: 100px; height: 38px; justify-self: end; border-radius: 4px; }

body.light-mode .skeleton-block { background: #e6d8c7; }
body.light-mode .skeleton-row { background: #fff8ee; border-color: #e6d8c7; }

/* Cascade reveal for part rows — scoped to the part-selection modal list only.
   JS (observeModalRows) adds .cascade-in as each row scrolls into view, then swaps
   it for .cascade-done on animationend so natural row opacities (incompatible /
   sold-out dimming) are restored instead of being frozen by the animation.
   NOTE: translate + opacity only — no scale(). Scaling shrinks the row inside its
   own box (background/border stop filling it → looks clipped), and a large
   translate extends #modal-list's scrollable overflow, which makes the scroll
   area jitter while scrolling down. */
@keyframes partRowCascade {
    from {
        opacity: 0;
        transform: translateY(26px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#modal-list.cascade-pending .part-row:not(.cascade-done) {
    opacity: 0;
}

#modal-list .part-row.cascade-in {
    animation: partRowCascade 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
    #modal-list .part-row,
    #modal-list .part-row.cascade-in {
        opacity: 1;
        animation: none;
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   9. MODAL
   Full-screen dimmed overlay → scrollable content pane → sticky header.
   Two close button styles exist (.close-button legacy + .close-btn active).
   ───────────────────────────────────────────────────────────────────────────── */
#part-modal {
    display: none;
    position: fixed;
    z-index: 4000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
}

#part-modal .modal-content {
    position: relative;
    z-index: 4001;
    background-color: var(--modal-bg);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid var(--details-border);
    width: 90%;
    max-width: 1000px;
    border-radius: 12px;
}

/* Sticky so title and search stay visible while the part list scrolls.
   position: relative is required so .close-btn can anchor to it. */
#part-modal .modal-header {
    position: sticky;
    position: relative; /* Both needed: sticky for scrolling, relative for .close-btn anchor */
    top: 0;
    z-index: 4010;
    background: inherit;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--details-border);
}

/* — Legacy close button (older markup) */
#part-modal .close-button {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 4020 !important;
    pointer-events: auto !important;
    background: var(--btn-bg);
    color: var(--text);
    border: 1px solid var(--btn-border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}
#part-modal .close-button:hover { background: #ef4444; color: white; border-color: #ef4444; }

/* — Primary close button (.close-btn): anchored in modal-header via position: absolute.
     translateY(-50%) vertically centres it on the header text baseline.
     IMPORTANT: every :hover transform must also include translateY(-50%) or the
     button will jump upward when hovered. */
.close-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: var(--btn-bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--btn-border) !important;
    font-size: 24px !important;
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
    line-height: 1 !important;
    padding: 0 !important;
    cursor: pointer;
    z-index: 5000 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* translateY(-50%) must come first so the rotation doesn't shift the button */
.close-btn:hover {
    transform: translateY(-50%) rotate(90deg) scale(1.1) !important;
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
}


/* ─────────────────────────────────────────────────────────────────────────────
   10. MODAL SCROLLBAR
   Thin custom scrollbar for the part list. Only visible in webkit browsers;
   Firefox respects scrollbar-width on the element itself.
   ───────────────────────────────────────────────────────────────────────────── */
#modal-list {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}
#modal-list::-webkit-scrollbar       { width: 6px; }
#modal-list::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }


/* ─────────────────────────────────────────────────────────────────────────────
   11. INPUTS
   Search bar and filter selects in the modal. Both read from --input-* and
   --text tokens so they restyle automatically when the theme switches.
   ───────────────────────────────────────────────────────────────────────────── */
#modal-search,
.modal-controls select {
    background-color: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 6px;
}

/* Hide browser spin arrows on ALL number inputs (price fields) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}

/* ─────────────────────────────────────────────────────────────────────────────
   11b. CUSTOM PRICE BUTTON
   Small pencil/lock toggle next to each price input. Active state glows
   accent-green to signal edit mode. Transitions match other btn animations.
   ───────────────────────────────────────────────────────────────────────────── */

/* Plain text price display (default state — no box, just coloured number) */
.price-text-display {
    color: var(--success-green);
    font-weight: 700;
    font-size: 0.95rem;
    margin-right: 2px;
}

.custom-price-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 3px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    opacity: 0.45;
    margin-left: 6px;
}
.custom-price-btn:hover {
    color: var(--accent);
    opacity: 1;
    transform: scale(1.15);
}
.custom-price-btn.active {
    color: var(--warning-amber);
    opacity: 1;
    text-shadow: 0 0 6px color-mix(in srgb, var(--warning-amber) 30%, transparent);
}
.custom-price-btn.active:hover {
    color: var(--danger-red);
    text-shadow: 0 0 6px color-mix(in srgb, var(--danger-red) 25%, transparent);
}

/* Price input — shown only in edit mode (toggled via JS display:block/none) */
input[type="number"].price-editable {
    border-color: var(--warning-amber) !important;
    color: var(--warning-amber) !important;
    background: rgba(245, 158, 11, 0.12) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning-amber) 25%, transparent), 0 0 8px rgba(245, 158, 11, 0.25) !important;
}


/* ─────────────────────────────────────────────────────────────────────────────
   12. WARNINGS
   max-height transition creates a smooth reveal without display: none jank.
   Colour variants: .danger (amber), .info (blue), #psu-warning.visible (red).
   The [id$="-warning"] selector catches every warning ID in one rule.
   ───────────────────────────────────────────────────────────────────────────── */
.warning-container {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    
    transition: 
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.warning-container.visible {
    opacity: 1;
    max-height: 500px;
    padding: 10px;
    margin-bottom: 10px;
    overflow: visible;
}

/* Fade-in for standalone [id$="-warning"] elements (e.g. #psu-warning) */
[id$="-warning"]         { opacity: 0; transition: opacity 0.3s ease; }
[id$="-warning"].visible { opacity: 1; }

.danger {
    color: var(--warning-amber);
    background: color-mix(in srgb, var(--warning-amber) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--warning-amber) 25%, transparent);
}
.info {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
/* Red — critical (PSU under-powered for selected build) */
#psu-warning.visible {
    display: block !important;
    color: var(--danger-red);
    background: color-mix(in srgb, var(--danger-red) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger-red) 30%, transparent);
}
.total-box .warning-container { max-width: 100%; }


/* ─────────────────────────────────────────────────────────────────────────────
   13. WARNING ANIMATIONS
   Applied via JS so each warning glows in its own colour. Keyframe names
   must match what the JS injects. errorBreatheLight is CSS-only (light mode).
   ───────────────────────────────────────────────────────────────────────────── */
@keyframes breathe-amber {
    0%, 100% { box-shadow: 0 0 3px rgba(245, 158, 11, 0.075); border-color: rgba(245, 158, 11, 0.3); }
    50%      { box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); border-color: rgba(245, 158, 11, 1); }
}
@keyframes breathe-red {
    0%, 100% { box-shadow: 0 0 3px rgba(255, 50, 50, 0.075); border-color: rgba(255, 50, 50, 0.3); }
    50%      { box-shadow: 0 0 15px rgba(255, 50, 50, 0.35); border-color: rgba(255, 50, 50, 1); }
}
@keyframes breathe-blue {
    0%, 100% { box-shadow: 0 0 3px rgba(34, 211, 238, 0.075); border-color: rgba(34, 211, 238, 0.3); }
    50%      { box-shadow: 0 0 15px rgba(34, 211, 238, 0.3); border-color: rgba(34, 211, 238, 1); }
}
/* Light mode variant — red breathe for hardware compatibility errors */
@keyframes errorBreatheLight {
    0%, 100% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.5); }
    50%       { box-shadow: 0 0 18px rgba(239, 68, 68, 0.4); border-color: rgba(239, 68, 68, 1); }
}


/* ─────────────────────────────────────────────────────────────────────────────
   14. DROPDOWNS
   Language and theme pickers. All colours come from --dropdown-* tokens so
   both themes are handled automatically by Section 2 variable overrides.
   ───────────────────────────────────────────────────────────────────────────── */
#lang-dropdown,
#theme-dropdown,
#store-dropdown,
#lang-dropdown-mob,
#theme-dropdown-mob,
#store-dropdown-mob {
    display: block !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
    pointer-events: none;
}
#lang-dropdown.open,
#theme-dropdown.open,
#store-dropdown.open,
#lang-dropdown-mob.open,
#theme-dropdown-mob.open,
#store-dropdown-mob.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

#lang-dropdown,
#theme-dropdown {
    background: var(--dropdown-bg) !important;
    border-color: var(--dropdown-border) !important;
}

#lang-dropdown div:not(.active),
#theme-dropdown div:not(.active)  { color: var(--dropdown-item) !important; }

#lang-dropdown div:not(.active):hover,
#theme-dropdown div:not(.active):hover {
    background: var(--dropdown-hover-bg) !important;
    color: var(--dropdown-hover-text) !important;
}


/* ─────────────────────────────────────────────────────────────────────────────
   14b. STORE SELECTOR
   Header store filter — uses --dropdown-* and --btn-* tokens for both themes.
   ───────────────────────────────────────────────────────────────────────────── */
#store-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    background: none;
    color: var(--muted);
    border: 1px solid #334155;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
#store-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 10px var(--glow-color);
}
#store-btn svg {
    flex-shrink: 0;
    opacity: 0.75;
}

#store-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 260px;
    max-height: min(267px, 60vh);
    max-height: min(267px, 60dvh);
    background: var(--dropdown-bg);
    border: 1px solid var(--dropdown-border);
    border-radius: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 2200;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

#store-dropdown-mob {
    max-height: min(267px, 60vh);
    max-height: min(267px, 60dvh);
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

.store-option {
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    height: 53px;
    min-height: 53px;
    flex-shrink: 0;
    padding: 8px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--dropdown-border);
    transition: background 0.12s ease;
}
.store-option:last-child { border-bottom: none; }
.store-option:hover { background: var(--dropdown-hover-bg) !important; }
.store-option-active { background: var(--store-option-active-bg); }

.store-option-icon,
.store-option-logo {
    position: relative;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Light tile so every store logo stays legible in both themes */
    background: #ffffff;
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #1f2937;
}
.store-option-icon {
    font-size: 1rem;
}
/* Store favicon is cropped to fill the circle; the initials stay as a fallback if the icon is missing */
.store-logo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    object-fit: cover;
    /* Cancel the global img border/radius, otherwise a dark rounded-square rim shows on the tile */
    border: 0;
    border-radius: 0;
    transform-origin: center;
    /* Crops the artwork's own white/transparent margin so it reaches the circle edge */
    transform: scale(var(--logo-zoom, 1));
}
/* Keep the per-store zoom on hover: the global img:hover scale(1.05) would otherwise
   shrink the logos scaled above 1 and inflate the ones scaled below 1. */
.store-logo-img:hover { transform: scale(var(--logo-zoom, 1)); }
/* Per-store zoom: >1 crops the artwork's own white margin away; <1 insets the logo
   so artwork with straight/square edges no longer touches the circle boundary. */
.store-option[data-store="Oriental Store"] { --logo-zoom: 1.45; }
.store-option[data-store="Performa PC"] { --logo-zoom: 1.3; }
/* Midas artwork is a square of blue letterforms - inset it so the white tile forms a true circle */
.store-option[data-store="Midas Computer Center"] { --logo-zoom: 0.65; }
/* City Center's red bubble artwork fills its canvas, so 1:1 fills the circle without a rim */
.store-option[data-store="City Center"] { --logo-zoom: 1; }

/* Identical hover flourish for every store logo: a short, subtle shake of the whole tile */
@keyframes store-logo-shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    20%      { transform: translateX(-1.5px) rotate(-4deg); }
    40%      { transform: translateX(1.5px) rotate(4deg); }
    60%      { transform: translateX(-1px) rotate(-2.5deg); }
    80%      { transform: translateX(1px) rotate(2.5deg); }
}
.store-option:hover .store-option-logo,
.store-option:hover .store-option-icon {
    animation: store-logo-shake 0.4s ease-in-out;
}

.store-option-text {
    flex: 1;
    min-width: 0;
}
.store-option-name {
    color: var(--dropdown-item);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.store-option-sub {
    color: var(--muted);
    font-size: 0.72rem;
    margin-top: 2px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.store-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--dropdown-border);
    border-radius: 5px;
    background: transparent;
    color: transparent;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.store-option-active .store-checkbox {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

html[lang="ar"] #top-actions {
    right: auto;
    left: 20px;
}
html[lang="ar"] #store-dropdown {
    right: auto !important;
    left: 0 !important;
}
html[lang="ar"] #store-btn {
    font-size: 0.8rem;
}
html[lang="ar"] .store-option-text {
    text-align: right;
}
html[lang="ar"] #theme-dropdown,
html[lang="ar"] #lang-dropdown {
    right: auto !important;
    left: 0 !important;
}
html[lang="ar"] #theme-dropdown-mob,
html[lang="ar"] #lang-dropdown-mob,
html[lang="ar"] #store-dropdown-mob {
    left: auto !important;
    right: 0 !important;
}

body.light-mode #store-dropdown {
    box-shadow: 0 8px 24px rgba(47, 42, 37, 0.12);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ─────────────────────────────────────────────────────────────────────────────
   15. TOAST ALERTS
   Fixed top-right notification stack. Each toast slides in from above via
   translateY. Toasts are non-interactive until .show is added by JS.
   ───────────────────────────────────────────────────────────────────────────── */
.nashmi-alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 320px;
    pointer-events: none;
}
.nashmi-toast-alert {
    background: var(--card-bg) !important;
    color: var(--text) !important;
    padding: 16px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    border-left: 5px solid var(--accent) !important;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.nashmi-toast-alert.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.light-mode .nashmi-toast-alert {
    background: #ffffff !important;
    color: #334155 !important;
    border-left: 5px solid #0ea5e9 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}


/* ─────────────────────────────────────────────────────────────────────────────
   16. ADD BUTTON — CUT-CORNER SNAP EFFECT
   On hover the left edge clips inward ("gamer cut") and a colour-matched
   glow fires. Wrapped in @media (hover: hover) so mobile users never get
   stuck in the activated state (iOS Safari tap-and-hold bug).
   ───────────────────────────────────────────────────────────────────────────── */
.add-btn {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%) !important;
    transition: all 0.2s ease-in-out !important;
    position: relative;
    overflow: hidden;
}

@media (hover: hover) {
    .add-btn:hover {
        box-shadow: 0 0 15px color-mix(in srgb, var(--accent) 50%, transparent) !important;
        filter: brightness(1.1);
    }

    /* Dark mode: explicit cyan accent glow */
    body:not(.light-mode) .add-btn:hover {
        box-shadow: 0 0 15px color-mix(in srgb, var(--accent) 50%, transparent) !important;
    }

    /* Dark mode: part card hover gets a faint cyan background tint */
    body:not(.light-mode) .part-card:hover {
        border-color: var(--accent) !important;
        background: color-mix(in srgb, var(--accent) 5%, transparent) !important;
    }

    /* Light mode: modal gets a HUD-style cyan edge on hover */
    body.light-mode .modal-content:hover {
        border: 1px solid #00d4ff !important;
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.1) !important;
    }

    /* Light mode: part card hover lifts and glows cyan */
    body.light-mode .part-card:hover {
        border-color: #00d4ff !important;
        background: #f0f9ff !important;
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   17. DARK MODE PATCHES
   Corrects modal row styles and overrides JS-injected inline colours.
   !important is justified here because we're fighting inline style attributes,
   not bad specificity choices elsewhere.
   ───────────────────────────────────────────────────────────────────────────── */

/* Modal rows get a full border + rounded corners (not just a bottom border) */
body:not(.light-mode) .part-row {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 6px !important;
    opacity: 1 !important;
    filter: none !important;
}
body:not(.light-mode) .part-row:hover { background: var(--details-bg) !important; }

body:not(.light-mode) .part-row.incompatible,
body:not(.light-mode) .part-row.sold-out {
    filter: grayscale(0.8);
    background: var(--bg) !important;
}
body:not(.light-mode) .part-row.incompatible {
    opacity: 0.5 !important;
    border-left: 3px solid var(--danger-red) !important;
}
body:not(.light-mode) .part-row.sold-out {
    opacity: 0.55 !important;
}
body:not(.light-mode) .part-row.store-menu-open {
    opacity: 1 !important;
    filter: none !important;
    z-index: 9999 !important;
}
body:not(.light-mode) .part-row.incompatible a,
body.light-mode .part-row.incompatible a {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Part name and link text — cyan in dark mode */
body:not(.light-mode) .part-row a,
body:not(.light-mode) .part-row a strong,
body:not(.light-mode) .part-row strong        { color: var(--accent) !important; }
body:not(.light-mode) .part-row div[style*="font-size: 0.85rem"] { color: var(--muted) !important; }

/* Pricing — green for normal price, red for out-of-stock */
body:not(.light-mode) .part-row span[style*="font-weight: bold"] { color: var(--success-green) !important; }
body:not(.light-mode) .part-row span[style*="#ff4d4d"]            { color: var(--danger-red) !important; }

body:not(.light-mode) #total-price,
body:not(.light-mode) #total-wattage,
body:not(.light-mode) #cpu-price-aqua:not(.price-editable),
body:not(.light-mode) #gpu-price-aqua:not(.price-editable),
body:not(.light-mode) #mobo-price-aqua:not(.price-editable),
body:not(.light-mode) #cooler-price-aqua:not(.price-editable),
body:not(.light-mode) #psu-price-aqua:not(.price-editable),
body:not(.light-mode) #case-price-aqua:not(.price-editable) { color: var(--success-green) !important; }

body:not(.light-mode) #cpu-price-aqua.price-editable,
body:not(.light-mode) #gpu-price-aqua.price-editable,
body:not(.light-mode) #mobo-price-aqua.price-editable,
body:not(.light-mode) #cooler-price-aqua.price-editable,
body:not(.light-mode) #psu-price-aqua.price-editable,
body:not(.light-mode) #case-price-aqua.price-editable,
body:not(.light-mode) .cheapest-pill.is-custom input[type="number"],
.cheapest-pill.is-custom input[type="number"] {
    color: var(--warning-amber) !important;
    border-color: var(--warning-amber) !important;
    background: rgba(245, 158, 11, 0.12) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning-amber) 25%, transparent), 0 0 8px rgba(245, 158, 11, 0.25) !important;
}

/* Add buttons inside modal rows */
body:not(.light-mode) .part-row .add-btn {
    background: var(--btn-bg) !important;
    color: var(--accent) !important;
    border: 1px solid var(--btn-border) !important;
    border-radius: 6px !important;
    font-weight: bold !important;
}
body:not(.light-mode) .part-row .add-btn:hover    { background: var(--accent) !important; color: #000 !important; }
body:not(.light-mode) .part-row .add-btn:disabled { background: #444 !important; color: #888 !important; border-color: #555 !important; }

/* Inquiry / contact CTA */
body:not(.light-mode) .inquiry-btn       { background: var(--btn-bg); color: var(--btn-text); border: 1px solid var(--btn-border); }
body:not(.light-mode) .inquiry-btn:hover { background: var(--accent); color: #000; transform: translateY(-1px); }

/* Search bar and filter selects in dark mode modal */
body:not(.light-mode) #modal-search {
    background: var(--input-bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--input-border) !important;
}
body:not(.light-mode) .modal-controls select,
body:not(.light-mode) #socket-filter,
body:not(.light-mode) #psu-filter,
body:not(.light-mode) #price-sort,
body:not(.light-mode) #stock-filter {
    background: var(--btn-bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--btn-border) !important;
}


/* ─────────────────────────────────────────────────────────────────────────────
   18. LIGHT MODE PATCHES
   Overrides for properties that variables can't reach — structural differences
   (shadow shape, border-radius bump), base rules using hardcoded colours
   instead of tokens, and JS-injected inline style corrections.
   ───────────────────────────────────────────────────────────────────────────── */

body.light-mode {
    background: #f6f1e8 !important;
}

/* Card titles and compat body text — darkened so they don't ghost on cream */
/* Card titles, descriptions, and price labels — unified dark warm tone */
body.light-mode [id$="-desc"],
body.light-mode .card h2,
body.light-mode .card h3,
body.light-mode .card [data-i18n="compatBody1"],
body.light-mode .card [data-i18n="compatBody2"],
body.light-mode .details-box span:not([id$="-price-aqua"]),
body.light-mode .details-box div {
    color: #6c6258 !important;
    opacity: 1 !important;
}

/* Warning container inner text — same fix for the compat notice body */
body.light-mode .warning-container p,
body.light-mode .warning-container span,
body.light-mode .warning-container div {
    color: #5a3e2b !important;
    opacity: 1 !important;
}

/* Cards get a slight radius bump and a warm ambient shadow in light mode */
body.light-mode .card,
body.light-mode .total-box,
body.light-mode .modal-content {
    border-radius: 14px !important;
    box-shadow: 0 8px 22px rgba(88, 67, 48, 0.08) !important;
}

/* Page heading — warm copper accent */
body.light-mode h1 { color: #b66f3d !important; }

/* App subtitle — muted warm grey */
body.light-mode [data-i18n="subtitle"] { color: #7a6f63 !important; }

/* Links — slate blue (overrides the cyan used in dark mode via inline styles) */
body.light-mode a,
body.light-mode .card a,
body.light-mode .details-box a,
body.light-mode strong[style*="color: var(--text)"],
body.light-mode a[style*="color: var(--text)"] {
    color: #5f6f85 !important;
    text-decoration-color: rgba(95, 111, 133, 0.45) !important;
}
body.light-mode a:hover,
body.light-mode .card a:hover,
body.light-mode .details-box a:hover { color: #3f4d61 !important; text-decoration-color: #3f4d61 !important; }

/* Part name links and spec description  */
body.light-mode .part-row a,
body.light-mode .part-row a strong,
body.light-mode .part-row strong,
body.light-mode .part-row div[style*="font-size"],
body.light-mode .part-row .part-desc { color: #5f6f85 !important; }

/* Row separators — base rule uses a hardcoded dark colour, so we override */
body.light-mode .part-row       { border-bottom: 1px solid #dbe3ee; }
body.light-mode .part-row:hover { background-color: #f1f5f9; }

/* Pricing — green for valid prices */
body.light-mode #total-price,
body.light-mode #total-wattage,
body.light-mode #cpu-price-aqua,
body.light-mode #gpu-price-aqua,
body.light-mode #mobo-price-aqua,
body.light-mode #cooler-price-aqua,
body.light-mode #psu-price-aqua,
body.light-mode #case-price-aqua { color: #4aaf67 !important; }

/* JOD label next to static part prices — keep green in light mode */
body.light-mode .details-box span[data-i18n="jod"] { color: #4aaf67 !important; }

/* Dynamic module price spans (RAM / Storage / Accessories) — keep green, not overridden by broad span rule */
body.light-mode #ram-container .details-box span:not([style*="#ff4d4d"]),
body.light-mode #storage-container .details-box span:not([style*="#ff4d4d"]),
body.light-mode #accessory-container .details-box span:not([style*="#ff4d4d"]) {
    color: #4aaf67 !important;
}

/* Placeholder text in the modal search bar */
body.light-mode #modal-search::placeholder { color: #64748b; }

/* Dividers in the contact form and total box */
body.light-mode #contact-form .summary-item,
body.light-mode #contact-form hr,
body.light-mode .total-box hr,
body.light-mode .summary-item[style*="border-top"] { border-color: #dbe3ee !important; }

/* Change button: small radius bump to match the parchment card aesthetic */
body.light-mode .change-btn           { border-radius: 9px !important; }
body.light-mode .change-btn:hover     { background: #e5d2bc !important; color: #2f241b !important; }

/* Add-part button: slightly warmer than var(--details-bg) */
body.light-mode .add-part-btn         { background: #f8efe2 !important; color: #6e5c4a !important; border: 1px solid #d8c5af; }
body.light-mode .add-part-btn:hover   { 
    background: #f2e4d3 !important; 
    color: #4e3f31 !important; 
    border-color: var(--accent) !important;
    border-style: solid !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: translateY(-2px) !important;
}

/* Remove button: soft terracotta instead of the base bright red */
body.light-mode .remove-btn           { background: #f3e3e0 !important; color: #9c4f42 !important; border: 1px solid #ddb7af !important; }
body.light-mode .remove-btn:hover     { background: #e7c9c2 !important; color: #6d2f25 !important; }

/* Add button inside part rows */
body.light-mode .part-row .add-btn       { background: #efe2d1 !important; color: #3c3026 !important; border: 1px solid #d9c6b0 !important; }
body.light-mode .part-row .add-btn:hover { background: #e4d4c0 !important; }

/* Inquiry / contact CTA — warm sand */
body.light-mode .inquiry-btn            { background: #d9c2a7; color: #3b2f24; border: 1px solid #c4aa8d; }
body.light-mode .inquiry-btn:hover      { background: #ccb090; transform: translateY(-1px); }

/* Theme and language toggle buttons — pill shape */
body.light-mode #theme-btn,
body.light-mode #store-btn,
body.light-mode #lang-switcher > button {
    background: #f1e2cf !important;
    color: #3c3026 !important;
    border: 1px solid #d4bea6 !important;
    border-radius: 999px !important;
}

/* Hardware conflict warnings — red (socket, RAM, M.2, SATA, cooler, PSU) */
body.light-mode #psu-warning.visible,
body.light-mode #socket-warning.visible,
body.light-mode #ram-warning.visible,
body.light-mode #m2-warning.visible,
body.light-mode #sata-warning.visible,
body.light-mode #cooler-warning.visible {
    color: #8f4b43 !important;
    background: #f7e7e4 !important;
    border: 1px solid #e8c7c2 !important;
}

/* Advisory warnings — amber (OOS, case size) */
body.light-mode #oos-warning.visible,
body.light-mode #case-warning.visible {
    color: #7a5f43 !important;
    background: #f7efdf !important;
    border: 1px solid #e5d4b6 !important;
}


/* =========================================
   19. LIGHT MODE (HUD STYLE & GLOW)
   ========================================= */

/* A. High-Contrast Text for Build Slots */
body.light-mode .empty-slot, 
body.light-mode .add-more-slot,
body.light-mode .part-title {
    color: var(--text) !important;
    font-weight: 700 !important;
}

/* B. Dropdown & Search Contrast Fix */
body.light-mode select, 
body.light-mode option,
body.light-mode input {
    background-color: #ffffff !important;
    color: var(--input-text) !important;
    border: 1px solid var(--accent) !important;
}

/* C. Gaming Border Glows */
body.light-mode .total-box,
body.light-mode .details-box,
body.light-mode .modal-content {
    border: 1px solid rgba(0, 212, 255, 0.4) !important;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.05) !important;
}

/* D. Breathing Error Animation */
@keyframes errorBreatheLight {
    0%   { box-shadow: 0 0 4px rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.4); }
    50%  { box-shadow: 0 0 18px rgba(239, 68, 68, 0.35); border-color: rgba(239, 68, 68, 1); }
    100% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.4); }
}

body.light-mode .warning-container.visible,
body.light-mode #compat-warning {
    background: #fff1f2 !important;
    color: #991b1b !important;
}

/* Full-screen component picker */
#part-modal {
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#part-modal .component-picker-content {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: min(95vw, 1500px) !important;
    height: 95vh;
    height: 95dvh;
    max-width: 1500px;
    max-height: 1000px;
    margin: auto;
    padding: 18px;
    overflow: hidden;
}

#part-modal .component-picker-header {
    position: relative;
    flex: 0 0 auto;
    padding: 2px 52px 14px 0;
    margin: 0 0 14px;
}

#part-modal .component-picker-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.25rem;
}

#part-modal .component-picker-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-bottom: 14px;
}

#part-modal .component-picker-toolbar input,
#part-modal .component-picker-toolbar select,
#part-modal .modal-filter-section select {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--input-border);
}

#part-modal select,
#part-modal select option {
    color: var(--text) !important;
}

#part-modal select option {
    background: var(--input-bg);
}

#part-modal select:hover,
#part-modal select:focus-visible {
    border-color: var(--accent);
    outline-color: var(--accent);
}

#part-modal select option:hover {
    color: var(--accent);
}

#part-modal select option:checked {
    color: var(--text);
    background: var(--input-bg);
}

#part-modal .modal-result-count {
    min-width: 0;
    color: var(--muted, var(--text-muted));
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#part-modal .modal-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--btn-bg);
}

#part-modal .modal-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
}

#part-modal .modal-view-button[aria-pressed="true"] {
    background: var(--accent);
    color: #fff;
}

#part-modal .modal-view-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

#part-modal .modal-filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--input-border);
    border-radius: 7px;
    background: var(--btn-bg);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

#part-modal .modal-filter-count {
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

#part-modal .component-picker-body {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    flex: 1 1 auto;
    min-height: 0;
}

#part-modal .modal-filter-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 0 12px 0 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid var(--details-border);
    scrollbar-width: thin;
}

#part-modal .modal-filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0 8px;
    color: var(--text);
}

#part-modal .modal-filter-section {
    padding: 11px 12px;
    border: 1px solid var(--details-border);
    border-radius: 8px;
    background: var(--card-bg);
}

#part-modal .modal-filter-section summary {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
}

#part-modal .modal-filter-section select {
    display: block;
    margin-top: 10px;
    cursor: pointer;
}

#part-modal .modal-filter-section select[style*="display: none"] {
    display: none !important;
}

#part-modal .modal-filter-section select[hidden] {
    display: none !important;
}

#part-modal .modal-price-range { margin-top: 10px; }

#part-modal .modal-price-slider {
    position: relative;
    height: 28px;
    margin: 2px 4px 8px;
    --range-start: 0%;
    --range-end: 100%;
}

#part-modal .modal-price-slider::before,
#part-modal .modal-price-slider::after {
    position: absolute;
    top: 50%;
    height: 4px;
    border-radius: 999px;
    content: "";
    transform: translateY(-50%);
    pointer-events: none;
}

#part-modal .modal-price-slider::before {
    right: 0;
    left: 0;
    background: var(--input-border);
}

#part-modal .modal-price-slider::after {
    left: var(--range-start);
    width: calc(var(--range-end) - var(--range-start));
    background: var(--accent);
}

#part-modal .modal-price-slider input[type="range"] {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 24px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    appearance: none;
    background: transparent;
    pointer-events: none;
}

#part-modal .modal-price-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

#part-modal .modal-price-slider input[type="range"]::-moz-range-track {
    height: 4px;
    background: transparent;
}

#part-modal #modal-price-min-range { z-index: 3; }
#part-modal #modal-price-max-range { z-index: 2; }

#part-modal .modal-price-slider input[type="range"]:focus {
    outline: none;
}

#part-modal .modal-price-slider input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

#part-modal .modal-price-slider input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

#part-modal .modal-price-slider input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    appearance: none;
    box-sizing: border-box;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--text);
    cursor: grab;
    pointer-events: auto;
}

#part-modal .modal-price-slider input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--text);
    cursor: grab;
    pointer-events: auto;
}

#part-modal .modal-price-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

#part-modal .modal-price-inputs label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--muted);
    font-size: 0.75rem;
}

#part-modal .modal-price-max-note {
    color: var(--muted);
    font-size: 0.7rem;
}

#part-modal .modal-price-max-note[hidden] { display: none; }

#part-modal .modal-price-inputs input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}

#part-modal .modal-filter-toggle-row,
#part-modal .modal-brand-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 32px;
    color: var(--text);
    font-size: 0.84rem;
    cursor: pointer;
}

#part-modal .modal-filter-toggle-row:first-of-type,
#part-modal .modal-brand-options { margin-top: 9px; }

#part-modal .modal-filter-toggle-row input,
#part-modal .modal-brand-option input {
    accent-color: var(--accent);
    flex: 0 0 auto;
}

#part-modal .modal-brand-options {
    display: flex;
    flex-direction: column;
    max-height: 220px;
    overflow-y: auto;
}

#part-modal .modal-brand-name {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

#part-modal .modal-brand-count {
    color: var(--muted);
    font-size: 0.75rem;
}

#part-modal .modal-clear-filters {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--accent, var(--accent-blue));
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

#part-modal .modal-clear-filters[hidden],
#part-modal .modal-filter-count[hidden],
#part-modal .modal-active-filters[hidden] {
    display: none !important;
}

#part-modal .modal-clear-filters:disabled {
    opacity: 0.55;
    cursor: default;
}

#part-modal .modal-results {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

#part-modal .modal-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
    margin: 0 0 10px;
}

#part-modal .modal-filter-chip {
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--input-border);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

#part-modal .modal-chip-clear { margin-left: 2px; }

#part-modal #compat-warning {
    flex: 0 0 auto;
}

#part-modal #modal-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding-right: 8px;
    overflow-x: hidden;
    overflow-y: auto;
}

#part-modal #modal-list.view-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#part-modal #modal-list .modal-load-more {
    align-self: center;
    grid-column: 1 / -1;
    margin: 8px 0 16px;
    padding: 10px 18px;
    border: 1px solid var(--btn-border);
    border-radius: 6px;
    background: var(--btn-bg);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

#part-modal #modal-list .modal-load-more:hover {
    border-color: var(--accent);
}

#part-modal #modal-list .modal-part-card {
    box-sizing: border-box;
    min-height: 164px;
    margin-bottom: 0 !important;
    padding: 18px !important;
}

#part-modal #modal-list .modal-part-card-content {
    grid-template-columns: 100px minmax(0, 1fr) 100px !important;
    gap: 18px !important;
    min-height: 126px;
}

#part-modal #modal-list .modal-part-card-details {
    min-width: 0;
    align-self: stretch;
}

#part-modal #modal-list .modal-part-title-link {
    display: block !important;
    max-width: 100%;
    min-width: 0;
}

#part-modal #modal-list .modal-part-title {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

#part-modal #modal-list .modal-part-card-actions {
    grid-column: 3;
    justify-self: end;
    min-width: 0;
    gap: 10px !important;
    padding-left: 4px;
}

#part-modal #modal-list .modal-part-card-actions .saved-part-toggle {
    flex: 0 0 auto;
}

#part-modal #modal-list .modal-part-card-actions .add-btn {
    max-width: 100%;
    white-space: nowrap;
}

#part-modal #modal-list.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    align-content: start;
    align-items: stretch;
    gap: 12px;
}

#part-modal #modal-list .modal-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 100%;
    padding: 48px 24px;
    color: #94a3b8;
    text-align: center;
}

#part-modal #modal-list.view-grid .modal-no-results {
    grid-column: 1 / -1;
    grid-row: 1;
}

#part-modal #modal-list.view-grid .modal-part-card,
#part-modal #modal-list.view-grid .modal-part-card-content {
    height: 100%;
}

#part-modal #modal-list.view-grid .modal-part-card-actions {
    justify-content: center;
}

#part-modal .modal-filter-mobile-actions { display: none; }

@media (max-width: 1024px) and (min-width: 769px) {
    #part-modal .component-picker-body { grid-template-columns: 250px minmax(0, 1fr); gap: 14px; }
    #part-modal .component-picker-toolbar { grid-template-columns: minmax(0, 1fr) auto auto; }
}

@media (min-width: 1401px) {
    #part-modal #modal-list.view-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    #part-modal .component-picker-content {
        width: 100vw !important;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0;
        padding: 14px;
        border-radius: 0;
    }

    #part-modal .component-picker-header {
        padding: 2px 48px 12px 0;
        margin-bottom: 12px;
    }

    #part-modal .component-picker-header h2 { font-size: 1.12rem; }

    #part-modal .component-picker-toolbar {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 8px;
        margin-bottom: 10px;
    }
    #part-modal #modal-search { grid-column: 1 / -1; }
    #part-modal .modal-result-count { grid-column: 1; grid-row: 2; }
    #part-modal .modal-view-toggle { grid-column: 2; grid-row: 2; }
    #part-modal .modal-filter-toggle { display: inline-flex; grid-column: 3; grid-row: 2; }
    #part-modal .modal-view-button { width: 27px; height: 30px; }
    #part-modal .component-picker-body { display: block; }
    #part-modal .modal-filter-sidebar { display: none; }
    #part-modal .modal-results { height: 100%; }
    #part-modal .modal-filter-mobile-actions {
        display: flex;
        gap: 10px;
        margin-top: auto;
        padding: 12px 0 max(8px, env(safe-area-inset-bottom));
        background: var(--modal-bg);
    }
    #part-modal .modal-filter-mobile-actions button {
        flex: 1;
        min-height: 44px;
        border: 1px solid var(--input-border);
        border-radius: 8px;
        background: var(--btn-bg);
        color: var(--text);
        font: inherit;
        font-weight: 650;
        cursor: pointer;
    }
    #part-modal .modal-filter-mobile-actions .modal-apply-filters {
        border-color: var(--accent, var(--accent-blue));
        background: var(--accent, var(--accent-blue));
        color: #fff;
    }
    #part-modal.filters-open .component-picker-content::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 11000;
        background: rgba(0, 0, 0, 0.55);
    }
    #part-modal.filters-open .modal-filter-sidebar {
        position: fixed;
        z-index: 11001;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        max-height: min(78vh, 640px);
        max-height: min(78dvh, 640px);
        padding: 18px 18px max(10px, env(safe-area-inset-bottom));
        overflow-y: auto;
        border: 1px solid var(--details-border);
        border-bottom: 0;
        border-radius: 18px 18px 0 0;
        background: var(--modal-bg);
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28);
    }
}

@media (max-width: 420px) {
    #part-modal .component-picker-content { padding: 12px; }
    #part-modal .component-picker-toolbar { gap: 5px; }
    #part-modal .modal-result-count { font-size: 0.72rem; }
    #part-modal .modal-filter-toggle { gap: 4px; padding: 6px 8px; font-size: 0.82rem; }
    #part-modal #modal-list .modal-part-card { padding: 12px !important; }
    #part-modal #modal-list .modal-part-card-content {
        grid-template-columns: 64px minmax(0, 1fr) 76px !important;
        gap: 9px !important;
        min-height: 100px;
    }
    #part-modal #modal-list .modal-part-card-content > a:first-child,
    #part-modal #modal-list .modal-part-card-content > a:first-child > div {
        width: 64px !important;
        height: 64px !important;
    }
    #part-modal #modal-list .modal-part-card-actions {
        grid-column: 3;
        min-width: 0;
        gap: 8px !important;
        padding-left: 0;
    }
    #part-modal #modal-list .modal-part-card-actions .saved-part-toggle {
        width: 30px !important;
        height: 30px !important;
    }
    #part-modal #modal-list .modal-part-card-actions .add-btn {
        padding: 8px 7px !important;
        font-size: 0.76rem;
    }
}



/* Contact Support — title and subtitle */
body.light-mode #contact-form h2,
body.light-mode #contact-form h3,
body.light-mode #contact-card h2,
body.light-mode #contact-card h3,
body.light-mode #contact-section h2,
body.light-mode #contact-section h3 {
    color: #3b2f22 !important;
}

body.light-mode #contact-subtitle {
    color: #6c6258 !important;
}

/* Contact inputs and textarea — text and placeholder */
body.light-mode #contact-form input,
body.light-mode #contact-form textarea {
    color: #3b2f22 !important;
    background: #fffdf9 !important;
    border-color: #d9c6b0 !important;
}

body.light-mode #contact-form input::placeholder,
body.light-mode #contact-form textarea::placeholder {
    color: #a0897a !important;
}
/* Animations for UI Elements */

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes modalPopIn {
    from { opacity: 0; transform: scale(0.95) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modalPopOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.95) translateY(-20px); }
}

#part-modal.anim-open {
    animation: modalFadeIn 0.3s forwards;
}

#part-modal.anim-open .modal-content {
    animation: modalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#part-modal.anim-close {
    animation: modalFadeOut 0.2s forwards;
}

#part-modal.anim-close .modal-content {
    animation: modalPopOut 0.2s forwards;
}

@keyframes partSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes partSlideOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-10px) scale(0.98); }
}

.part-anim-in {
    animation: partSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.part-anim-out {
    animation: partSlideOut 0.2s forwards;
}

@keyframes clearShake {
    0%   { transform: translateX(0)    scale(1);    background: transparent;          box-shadow: none; }
    10%  { transform: translateX(-7px) scale(1.03); background: rgba(255,77,77,0.25); box-shadow: 0 0 18px rgba(255,77,77,0.35); }
    25%  { transform: translateX(7px)  scale(1.03); background: rgba(255,77,77,0.3);  box-shadow: 0 0 22px rgba(255,77,77,0.4); }
    40%  { transform: translateX(-6px) scale(1.02); background: rgba(255,77,77,0.2);  box-shadow: 0 0 16px rgba(255,77,77,0.3); }
    55%  { transform: translateX(6px)  scale(1.02); background: rgba(255,77,77,0.15); box-shadow: 0 0 12px rgba(255,77,77,0.25); }
    70%  { transform: translateX(-3px) scale(1.01); background: rgba(255,77,77,0.1);  box-shadow: 0 0 8px  rgba(255,77,77,0.2); }
    85%  { transform: translateX(3px)  scale(1);    background: rgba(255,77,77,0.05); box-shadow: 0 0 4px  rgba(255,77,77,0.1); }
    100% { transform: translateX(0)    scale(1);    background: transparent;          box-shadow: none; }
}

.anim-shake {
    animation: clearShake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   20. PART VISIBILITY CONTROL
   The mobile media query sets `.details-box { display: grid !important }` which
   beats a plain JS `el.style.display = "none"` (non-!important inline style).
   Using a double-class selector gives this rule higher specificity than the
   single-class media query rule, AND the !important ensures it wins regardless.
   JS must add/remove this class — never touch .style.display directly.
   ───────────────────────────────────────────────────────────────────────────── */
.details-box.part-hidden {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   21. AI WIZARD MODAL
   Friendly multi-step questionnaire — triggered by .ask-ai-mini-btn
   ───────────────────────────────────────────────────────────────────────────── */
.ai-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 6000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ai-modal-overlay.is-open {
    display: flex;
}

#aiModal.anim-open {
    animation: modalFadeIn 0.3s forwards;
}

#aiModal.anim-open .ai-modal-content {
    animation: modalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#aiModal.anim-close {
    animation: modalFadeOut 0.2s forwards;
}

#aiModal.anim-close .ai-modal-content {
    animation: modalPopOut 0.2s forwards;
}

.ai-modal-content--chat {
    display: flex;
    flex-direction: column;
    max-width: 960px;
    width: 95vw;
    height: 85vh;
    max-height: 850px;
    padding: 24px 28px;
}

.ai-wizard-body--chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin-top: 8px;
    overflow: hidden;
}

.chat-message-log::-webkit-scrollbar {
    width: 6px;
}

.chat-message-log::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 10px;
}

/* Gemini-style Multiline Chat Input */
.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 20px;
    padding: 10px 14px 10px 18px;
    box-shadow: none !important;
    outline: none !important;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.chat-input-bar:focus-within {
    outline: none !important;
    box-shadow: none !important;
    border-color: var(--input-border);
}

#aiUserQuery {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    min-height: 56px;
    max-height: 180px;
    resize: none;
    padding: 6px 0;
    margin: 0;
    overflow-y: auto;
}

#aiUserQuery:focus,
#aiUserQuery:focus-visible,
#aiUserQuery:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

#aiUserQuery::placeholder {
    color: var(--text-muted, #71717a);
    opacity: 0.8;
}

#aiUserQuery::-webkit-scrollbar {
    width: 5px;
}

#aiUserQuery::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 10px;
}

#sendAiQueryBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--text);
    color: var(--bg);
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 8px 18px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    height: 38px;
    margin-bottom: 4px;
    flex-shrink: 0;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

#sendAiQueryBtn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

#sendAiQueryBtn:focus,
#sendAiQueryBtn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

#sendAiQueryBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ai-modal-content {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px 24px 24px;
    background: var(--modal-bg);
    color: var(--text);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 32px var(--glow-color);
}

/* AI Hardware Chart & Table Styling */
.ai-msg table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 14px 0 16px 0;
    border-radius: 10px;
    overflow: visible;
    background: rgba(18, 24, 33, 0.7);
    border: 1px solid var(--card-border);
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

body.light-mode .ai-msg table {
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.ai-msg table thead th {
    background: rgba(30, 41, 59, 0.85);
    color: var(--text);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 2px solid var(--card-border);
}

[dir="rtl"] .ai-msg table thead th {
    text-align: right;
}

body.light-mode .ai-msg table thead th {
    background: #f1f5f9;
    color: #334155;
}

.ai-msg table tbody tr {
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode .ai-msg table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.ai-msg table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

body.light-mode .ai-msg table tbody tr:hover {
    background: #f8fafc;
}

.ai-msg table tbody td {
    padding: 11px 14px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.45;
}

body.light-mode .ai-msg table tbody td {
    border-bottom: 1px solid #f1f5f9;
}

/* Make Component column stand out like a tag */
.ai-msg table tbody td:first-child {
    font-weight: 700;
    color: #60a5fa;
    white-space: nowrap;
}

/* Green pricing across AI tables & text */
.ai-msg table tbody td:nth-child(3),
.ai-msg .ai-price,
.ai-msg td.price-cell {
    color: #22c55e !important;
    font-weight: 800 !important;
    font-size: 0.98rem;
    white-space: nowrap;
}

/* Total row highlight */
.ai-msg table tr.total-row,
.ai-msg table tr:last-child {
    background: rgba(34, 197, 94, 0.08) !important;
    border-top: 2px solid rgba(34, 197, 94, 0.35) !important;
}

body.light-mode .ai-msg table tr.total-row,
body.light-mode .ai-msg table tr:last-child {
    background: rgba(34, 197, 94, 0.06) !important;
}

.ai-msg table tr.total-row td,
.ai-msg table tr:last-child td {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
    border-bottom: none;
}

.ai-msg table tr.total-row td:nth-child(3),
.ai-msg table tr:last-child td:nth-child(3) {
    color: #22c55e !important;
    font-size: 1.15rem !important;
}

/* AI commentary bullet list */
.ai-msg ul {
    margin: 14px 0 4px 0;
    padding: 0 0 0 18px;
    list-style: none;
}

.ai-msg ul li {
    position: relative;
    padding: 6px 0 6px 14px;
    line-height: 1.55;
    font-size: 0.9rem;
    color: var(--text);
}

.ai-msg ul li::before {
    content: '▸';
    position: absolute;
    left: -4px;
    color: #6366f1;
    font-weight: 700;
}

.ai-msg ul li b {
    color: #a5b4fc;
    font-weight: 700;
}

body.light-mode .ai-msg ul li b {
    color: #4f46e5;
}

/* Product images in AI build tables */
.ai-table-part-img {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
    margin-right: 10px;
    flex-shrink: 0;
    cursor: zoom-in;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s ease,
                z-index 0s;
    position: relative;
    z-index: 1;
}

.ai-table-part-img:hover {
    transform: scale(4);
    z-index: 1000;
    object-fit: cover;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    border-color: rgba(99, 102, 241, 0.5);
    background: #1e293b;
}

body.light-mode .ai-table-part-img {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-mode .ai-table-part-img:hover {
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

[dir="rtl"] .ai-table-part-img {
    margin-right: 0;
    margin-left: 10px;
}

/* Make Part Name cell use flex for image + text alignment */
.ai-msg table tbody td:nth-child(2) {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Ensure table rows don't clip the zoomed image */
.ai-msg table {
    overflow: visible;
}

.ai-msg table tbody {
    overflow: visible;
}

.ai-msg table tbody tr {
    overflow: visible;
}

.ai-msg table tbody td {
    overflow: visible;
}

.ai-wizard-status {
    position: absolute;
    top: 14px;
    left: 18px;
    right: 52px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: none;
}

.ai-wizard-status-text {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent);
}

.ai-wizard-progress-track {
    height: 2px;
    width: 100%;
    max-width: 140px;
    background: var(--input-border);
    border-radius: 1px;
    overflow: hidden;
}

.ai-wizard-progress-fill {
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--glow-color);
    border-radius: 1px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--btn-border);
    border-radius: 50%;
    background: var(--btn-bg);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ai-modal-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}

.ai-wizard-status {
    display: none !important;
}

.ai-wizard-body {
    display: flex;
    flex-direction: column;
    margin-top: 28px;
}

.ai-wizard-step-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cascade fade-in for each wizard block — matches .card pop-up-fade stagger */
.ai-wizard-enter > .ai-wizard-header,
.ai-wizard-enter > .ai-wizard-budget-wrap,
.ai-wizard-enter > .ai-wizard-actions,
.ai-wizard-enter > .ai-wizard-success,
.ai-wizard-enter .wizard-card-option {
    animation: pop-up-fade 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ai-wizard-enter > .ai-wizard-header       { animation-delay: 0.05s; }
.ai-wizard-enter .wizard-card-option:nth-child(1) { animation-delay: 0.12s; }
.ai-wizard-enter .wizard-card-option:nth-child(2) { animation-delay: 0.17s; }
.ai-wizard-enter .wizard-card-option:nth-child(3) { animation-delay: 0.22s; }
.ai-wizard-enter .wizard-card-option:nth-child(4) { animation-delay: 0.27s; }
.ai-wizard-enter > .ai-wizard-budget-wrap   { animation-delay: 0.12s; }
.ai-wizard-enter > .ai-wizard-actions       { animation-delay: 0.32s; }
.ai-wizard-enter > .ai-wizard-success      { animation-delay: 0.1s; }

.ai-wizard-header {
    padding-right: 4px;
}

.ai-wizard-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.01em;
    line-height: 1.35;
}

.ai-wizard-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.ai-wizard-options {
    display: grid;
    gap: 12px;
}

.ai-wizard-options--grid {
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .ai-wizard-options--grid {
        grid-template-columns: 1fr 1fr;
    }
}

.wizard-card-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 16px 14px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.wizard-card-option:hover {
    background: var(--btn-bg);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 18px var(--glow-color);
    transform: translateY(-2px);
}

.wizard-card-option.active {
    border: 1px solid var(--accent);
    box-shadow: 0 0 12px var(--glow-color);
    background: color-mix(in srgb, var(--accent) 10%, var(--input-bg));
    color: var(--text);
}

.wizard-card-option:active {
    transform: translateY(1px) scale(0.98);
}

.wizard-card-option:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.ai-wizard-budget-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-wizard-budget-wrap label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.ai-wizard-budget-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-wizard-budget-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--glow-color);
}

.ai-wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.ai-wizard-actions--center {
    justify-content: center;
}

.ai-wizard-btn {
    padding: 11px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid var(--btn-border);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-wizard-btn--primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-border);
}

.ai-wizard-btn--primary:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--glow-color);
}

.ai-wizard-btn--primary:active {
    transform: translateY(1px) scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ai-wizard-btn--sequencer {
    width: 100%;
    max-width: 100%;
    padding: 14px 20px;
    font-size: 0.9rem;
}

.ai-wizard-btn--ghost {
    color: var(--muted);
    background: transparent;
}

.ai-wizard-btn--ghost:hover {
    color: var(--text);
    border-color: var(--accent);
}

.ai-wizard-success {
    text-align: center;
    padding: 12px 0 4px;
}

.ai-wizard-success-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    color: var(--accent);
    text-shadow: 0 0 20px var(--glow-color);
}

.ai-wizard-success p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.ai-wizard-alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-wizard-budget-alert {
    padding: 12px 14px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 8%, var(--input-bg));
    border: 1px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 0 12px var(--glow-color);
}

body.light-mode .ai-wizard-budget-alert {
    background: #fff1f2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
    box-shadow: none !important;
}

/* Wizard + Ask AI — light mode patches (match Section 18 button feel) */
body.light-mode .ask-ai-btn:hover {
    background: #f2e4d3 !important;
    color: #4e3f31 !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 18px var(--glow-color) !important;
}

body.light-mode .ai-wizard-btn--primary:hover {
    background: #e5d2bc !important;
    color: #2f241b !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 18px var(--glow-color) !important;
}

body.light-mode .wizard-card-option {
    background: #f8efe2 !important;
    color: #6e5c4a !important;
    border-color: #d8c5af !important;
}

body.light-mode .wizard-card-option:hover {
    background: #f2e4d3 !important;
    color: #4e3f31 !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 18px var(--glow-color) !important;
}

body.light-mode .wizard-card-option.active {
    background: color-mix(in srgb, var(--accent) 15%, #f8efe2) !important;
    color: #2f241b !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 12px var(--glow-color) !important;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SUMMARY SIDEBAR & DASHBOARD WIDGETS
   Estimated Total, Live Warnings, Power Meter, Store Breakdown & Ask AI Panel
   ───────────────────────────────────────────────────────────────────────────── */
.total-box {
    padding: 20px 22px;
    border-radius: 14px;
    background: var(--total-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

html[lang="ar"] .total-box {
    text-align: right;
}

/* Header */
.summary-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--details-border);
}

.summary-title-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex-shrink: 0;
}

.summary-header-icon {
    font-size: 1.05rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.summary-heading {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: none !important;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.2px;
    white-space: nowrap;
    line-height: 1.2;
}

.clear-all-btn {
    width: auto !important;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.clear-all-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.55);
    color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.clear-all-btn:active {
    transform: scale(0.96);
}

/* Warnings Wrapper & Zero-Height Flex Gap Prevention */
.warnings-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.warning-container:not(.visible) {
    display: none !important;
}

/* Big Price Display */
.summary-total-display {
    text-align: center;
    padding: 8px 12px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--success-green) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--success-green) 20%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-price-number {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--success-green);
    letter-spacing: -1px;
    text-shadow: 0 0 20px color-mix(in srgb, var(--success-green) 10%, transparent);
    line-height: 1;
}

body.light-mode .summary-total-display {
    background: color-mix(in srgb, var(--success-green) 9%, transparent);
    border-color: color-mix(in srgb, var(--success-green) 25%, transparent);
}

body.light-mode .summary-price-number {
    color: color-mix(in srgb, var(--success-green) 80%, black);
    text-shadow: none;
}

/* Summary Card Sub-Sections */
.summary-card-section {
    background: var(--details-bg);
    border: 1px solid var(--details-border);
    border-radius: 10px;
    padding: 13px 15px;
    transition: all 0.2s ease;
}

/* Power Meter Box */
.power-meter-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.power-meter-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.power-bolt-icon {
    color: #fbbf24;
}

.power-wattage-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fbbf24;
}

.power-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0 10px;
}

.power-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
    background: var(--accent);
}

.power-meter-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--muted);
}

.psu-rec-value {
    color: var(--accent);
    font-weight: 700;
}

.psu-advice-msg {
    margin: 6px 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
}

/* Store Breakdown Box */
.store-breakdown-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.store-breakdown-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.store-count-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.store-badge-single {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
}

.store-badge-multi {
    background: rgba(56, 189, 248, 0.12) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.25) !important;
}

.mini-store-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.store-breakdown-empty {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
    padding: 4px 0;
}

.store-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body.light-mode .store-breakdown-row {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.store-breakdown-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.store-pill-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Round store favicon that replaces the initials in the store breakdown */
.store-pill-logo {
    position: relative;
    width: 22px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.6rem;
    letter-spacing: 0;
    overflow: hidden;
}

.store-pill-logo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    /* Cancel the global img black background so transparent logos show the white tile */
    background: #ffffff;
    transform-origin: center;
}

/* Small round store favicon shown next to store names in the parts modal */
.store-tag-logo {
    display: inline-flex;
    position: relative;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: #ffffff;
    vertical-align: -2px;
}

.store-tag-logo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    /* Cancel the global img black background so transparent logos show the white tile */
    background: #ffffff;
    transform-origin: center;
}

.store-pill-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.store-pill-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-pill-count {
    font-size: 0.7rem;
    color: var(--muted);
}

.store-breakdown-price {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    flex-shrink: 0;
}

/* AI Assistant Box */
.ai-assistant-box {
    background: color-mix(in srgb, var(--wizard-accent) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--wizard-accent) 25%, transparent);
    text-align: center;
}

body.light-mode .ai-assistant-box {
    background: color-mix(in srgb, var(--wizard-accent) 6%, transparent);
    border-color: color-mix(in srgb, var(--wizard-accent) 20%, transparent);
}

.ai-assistant-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ai-assistant-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: color-mix(in srgb, var(--wizard-accent) 80%, white);
    background: color-mix(in srgb, var(--wizard-accent) 20%, transparent);
    padding: 2px 8px;
    border-radius: 999px;
}

.ai-assistant-subtitle {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.ai-assistant-text {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 4px 0 12px;
    line-height: 1.35;
    text-align: center;
}

.ai-assistant-box .ask-ai-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--wizard-accent);
    color: #ffffff;
    border: none;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 14px var(--wizard-glow);
}
.ai-assistant-box .ask-ai-btn:hover {
    background: color-mix(in srgb, var(--wizard-accent) 80%, black);
    color: #ffffff;
    box-shadow: 0 6px 20px var(--wizard-glow);
    transform: translateY(-2px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER & LOGO
   ───────────────────────────────────────────────────────────────────────────── */
header {
    position: relative;
    z-index: 2000;
    padding: 0 24px;
    background-color: var(--bg);
    border-bottom: 1px solid var(--header-border);
    /* Toolbar font stack mirrors index.html so both headers render identically */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-left: -8px;
    gap: 12px;
}

.logo-img {
    height: 64px;
    width: auto;
    display: block;
    object-fit: contain;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    transition: none !important;
}

.logo-img:hover {
    transform: none !important;
}

.logo-text {
    font-size: 1.4375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* "Nashmi" reads as a soft grey-white, "Tech" uses the brand blue */
.logo-nashmi {
    color: #e2e8f0;
}

.logo-tech {
    color: #2563eb;
}

body.light-mode .logo-nashmi {
    color: #334155;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

nav a:hover,
nav a.active { color: var(--text); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    color: var(--muted);
    cursor: pointer;
    background: none;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 1.2rem;
    line-height: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#lang-icon { color: #38bdf8; }
#theme-icon { color: #f59e0b; padding: 6px 8px; }

.header-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--glow-color);
}

body.light-mode .header-icon {
    background: #f1e2cf;
    color: #3c3026;
    border: 1px solid #d4bea6;
    border-radius: 999px;
}

/* Dropdowns — mirrors index.html's inline .dropdown/.dropdown-content rules so the
   builder toolbar renders identically to the landing page. */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: block;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background-color: var(--card-bg);
    min-width: 140px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.dropdown-content.show,
.dropdown-content.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:hover {
    background: var(--dropdown-hover-bg);
    color: var(--text);
}

/* Selected option — blue accent copied from index.html */
.dropdown-item.active {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

/* Collapse the nav on small screens, matching index.html */
@media (max-width: 768px) {
    nav { display: none; }
}

.main-logo {
    color: var(--accent);
    letter-spacing: 1px;
    margin: 0;
    font-size: 2.5rem;
    text-shadow: 0 0 20px var(--glow-color);
}

.main-subtitle {
    color: var(--muted);
    margin: 8px 0 0;
    font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   22. SLEEK PRODUCT ROWS
   When a component is selected it becomes a premium row: thumbnail, bold
   product name, a green "source" pill (price + store) and a muted
   "+ N other stores from X JOD" link. Left info and right actions are pushed
   apart with justify-content: space-between / align-items: center.
   ───────────────────────────────────────────────────────────────────────────── */

/* Row skeleton — info on the left, actions pinned to the right */
.part-row-flex {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px !important;
}

.part-row-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.part-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid #1f2937;
    background: #000;
    overflow: hidden;
}

.part-row-text {
    min-width: 0;
    flex: 1;
}

.part-row-name {
    color: var(--accent);
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: 0.2px;
    word-wrap: break-word;
}

.part-row-name a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
    transition: color 0.2s, text-decoration-color 0.2s;
}

.part-row-name a:hover {
    color: var(--success-green);
    text-decoration-color: var(--success-green);
}

/* Meta line: price pill + offers link + edit controls */
.part-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* Green source pill — "185 JOD at City Center" */
.cheapest-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.30);
    color: var(--success-green);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}
.cheapest-pill .price-text-display {
    color: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    margin: 0;
}
.cheapest-pill .pill-jod,
.cheapest-pill #cpu-jod-edit,
.cheapest-pill #cooler-jod-edit,
.cheapest-pill #gpu-jod-edit,
.cheapest-pill #mobo-jod-edit,
.cheapest-pill #psu-jod-edit,
.cheapest-pill #case-jod-edit { color: inherit; }
.cheapest-pill .pill-at {
    color: inherit;
    opacity: 0.85;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Custom Price Variant: Amber tint + dashed border */
.cheapest-pill.is-custom {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px dashed rgba(245, 158, 11, 0.6) !important;
    color: var(--warning-amber) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}
.cheapest-pill.is-custom span,
.cheapest-pill.is-custom .price-text-display,
.cheapest-pill.is-custom .pill-at,
.cheapest-pill.is-custom .pill-jod,
.cheapest-pill.is-custom #cpu-jod-edit,
.cheapest-pill.is-custom #cooler-jod-edit,
.cheapest-pill.is-custom #gpu-jod-edit,
.cheapest-pill.is-custom #mobo-jod-edit,
.cheapest-pill.is-custom #psu-jod-edit,
.cheapest-pill.is-custom #case-jod-edit,
.cheapest-pill.is-custom #cpu-store-badge,
.cheapest-pill.is-custom #cooler-store-badge,
.cheapest-pill.is-custom #gpu-store-badge,
.cheapest-pill.is-custom #mobo-store-badge,
.cheapest-pill.is-custom #psu-store-badge,
.cheapest-pill.is-custom #case-store-badge {
    color: var(--warning-amber) !important;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

/* Out of Stock Variant: Red tint + solid red border + red text */
.cheapest-pill.is-oos {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.38) !important;
    color: var(--danger-red) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}
.cheapest-pill.is-oos span,
.cheapest-pill.is-oos .price-text-display,
.cheapest-pill.is-oos .pill-at,
.cheapest-pill.is-oos .pill-jod {
    color: var(--danger-red) !important;
    text-shadow: none !important;
}
.cheapest-pill.is-oos .price-text-display {
    text-decoration: line-through;
    text-decoration-color: var(--danger-red);
}

/* Out of Stock Card State */
.details-box.is-oos {
    opacity: 0.55 !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    background: rgba(239, 68, 68, 0.03) !important;
}

.details-box.is-oos img {
    filter: grayscale(1) brightness(0.7) !important;
}

.details-box.is-oos .part-row-name,
.details-box.is-oos .part-row-name a {
    color: var(--muted) !important;
    text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent) !important;
}

.details-box.is-oos .part-row-name a:hover {
    color: var(--text) !important;
    text-decoration-color: var(--text) !important;
}

.part-oos-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: var(--danger-red);
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
}

body.light-mode .details-box.is-oos {
    opacity: 0.65 !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    background: #fbf7f5 !important;
}

body.light-mode .details-box.is-oos .part-row-name,
body.light-mode .details-box.is-oos .part-row-name a {
    color: #8b95a5 !important;
    text-decoration-color: rgba(139, 149, 165, 0.4) !important;
}

body.light-mode .details-box.is-oos .part-row-name a:hover {
    color: #3f4d61 !important;
    text-decoration-color: #3f4d61 !important;
}

body.light-mode .part-oos-badge {
    background: #fef2f2;
    border: 1px solid #f87171;
    color: #dc2626;
}

/* Other stores hint pill in modal list */
.other-stores-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.3;
    width: fit-content;
}

/* Right-hand action cluster */
.part-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Light-mode contrast — beat the broad `.details-box span` override */
body.light-mode .details-box .cheapest-pill,
body.light-mode .details-box .cheapest-pill span,
body.light-mode .details-box .cheapest-pill .price-text-display {
    color: #1f9d58 !important;
}
body.light-mode .details-box .cheapest-pill.is-custom,
body.light-mode .details-box .cheapest-pill.is-custom span,
body.light-mode .details-box .cheapest-pill.is-custom .price-text-display,
body.light-mode .details-box .cheapest-pill.is-custom .pill-at,
body.light-mode .details-box .cheapest-pill.is-custom .pill-jod,
body.light-mode .details-box .cheapest-pill.is-custom #cpu-jod-edit,
body.light-mode .details-box .cheapest-pill.is-custom #cooler-jod-edit,
body.light-mode .details-box .cheapest-pill.is-custom #gpu-jod-edit,
body.light-mode .details-box .cheapest-pill.is-custom #mobo-jod-edit,
body.light-mode .details-box .cheapest-pill.is-custom #psu-jod-edit,
body.light-mode .details-box .cheapest-pill.is-custom #case-jod-edit,
body.light-mode .details-box .cheapest-pill.is-custom #cpu-store-badge,
body.light-mode .details-box .cheapest-pill.is-custom #cooler-store-badge,
body.light-mode .details-box .cheapest-pill.is-custom #gpu-store-badge,
body.light-mode .details-box .cheapest-pill.is-custom #mobo-store-badge,
body.light-mode .details-box .cheapest-pill.is-custom #psu-store-badge,
body.light-mode .details-box .cheapest-pill.is-custom #case-store-badge,
body.light-mode .details-box .cheapest-pill.is-custom input[type="number"],
body.light-mode .details-box .cheapest-pill.is-custom input.price-editable,
body.light-mode .cheapest-pill.is-custom,
body.light-mode .cheapest-pill.is-custom span,
body.light-mode .cheapest-pill.is-custom .price-text-display,
body.light-mode .cheapest-pill.is-custom .pill-at,
body.light-mode .cheapest-pill.is-custom .pill-jod,
body.light-mode .cheapest-pill.is-custom input[type="number"],
body.light-mode .cheapest-pill.is-custom input.price-editable {
    color: #b45309 !important;
}
body.light-mode .details-box .cheapest-pill.is-custom,
body.light-mode .cheapest-pill.is-custom {
    background: #fff8ee !important;
    border: 1px dashed #d97706 !important;
}
body.light-mode .details-box .cheapest-pill.is-custom input[type="number"],
body.light-mode .details-box .cheapest-pill.is-custom input.price-editable,
body.light-mode input[type="number"].price-editable {
    border-color: #d97706 !important;
    background: #fff8ee !important;
    color: #b45309 !important;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25) !important;
}
body.light-mode .custom-price-btn.active {
    color: #b45309 !important;
    text-shadow: 0 0 6px rgba(180, 83, 9, 0.25) !important;
}
body.light-mode .details-box .cheapest-pill {
    background: rgba(16, 185, 129, 0.10) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
}
body.light-mode .details-box .part-row-name,
body.light-mode .details-box .part-row-name a { color: #5f6f85 !important; text-decoration-color: rgba(95, 111, 133, 0.4) !important; }
body.light-mode .details-box .part-row-name a:hover { color: #1f9d58 !important; text-decoration-color: #1f9d58 !important; }
body.light-mode .other-stores-pill {
    background: #eedfcd !important;
    border-color: #d4bea6 !important;
    color: #6c6258 !important;
}

/* Light mode Out of Stock pill */
body.light-mode .details-box .cheapest-pill.is-oos,
body.light-mode .cheapest-pill.is-oos {
    background: #fef2f2 !important;
    border: 1px solid #f87171 !important;
    color: #dc2626 !important;
    box-shadow: none !important;
}
body.light-mode .details-box .cheapest-pill.is-oos span,
body.light-mode .details-box .cheapest-pill.is-oos .price-text-display,
body.light-mode .details-box .cheapest-pill.is-oos .pill-at,
body.light-mode .details-box .cheapest-pill.is-oos .pill-jod,
body.light-mode .cheapest-pill.is-oos span,
body.light-mode .cheapest-pill.is-oos .price-text-display,
body.light-mode .cheapest-pill.is-oos .pill-at,
body.light-mode .cheapest-pill.is-oos .pill-jod {
    color: #dc2626 !important;
    text-shadow: none !important;
}
body.light-mode .details-box .cheapest-pill.is-oos .price-text-display,
body.light-mode .cheapest-pill.is-oos .price-text-display {
    text-decoration: line-through;
    text-decoration-color: #dc2626 !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PAGE ENTRANCE CASCADE
   Every top-level block fades + rises into place on load, staggered ~70 ms
   apart so the page assembles as a wave down the page instead of popping in.
   Inner rows / buttons / pills simply appear with their parent block.
   ───────────────────────────────────────────────────────────────────────────── */
header,
.main-container > .summary-sidebar > *,
.build-sheet > .card,
.build-sheet > .summary-sidebar {
    animation: pop-up-fade 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Header leads the wave */
header { animation-delay: 0s; }

/* Right column — summary sidebar blocks */
.main-container > .summary-sidebar > *:nth-child(1) { animation-delay: 0.07s; }
.main-container > .summary-sidebar > *:nth-child(2) { animation-delay: 0.14s; }

/* Left column — build-sheet blocks cascade downward */
.build-sheet > .card:nth-child(1)  { animation-delay: 0.07s; }
.build-sheet > .card:nth-child(2)  { animation-delay: 0.14s; }
.build-sheet > .card:nth-child(3)  { animation-delay: 0.21s; }
.build-sheet > .card:nth-child(4)  { animation-delay: 0.28s; }
.build-sheet > .card:nth-child(5)  { animation-delay: 0.35s; }
.build-sheet > .card:nth-child(6)  { animation-delay: 0.42s; }
.build-sheet > .card:nth-child(7)  { animation-delay: 0.49s; }
.build-sheet > .card:nth-child(8)  { animation-delay: 0.56s; }
.build-sheet > .card:nth-child(9)  { animation-delay: 0.63s; }
.build-sheet > .card:nth-child(10) { animation-delay: 0.70s; }
.build-sheet > .summary-sidebar    { animation-delay: 0.77s; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    header,
    .main-container > .summary-sidebar > *,
    .build-sheet > .card,
    .build-sheet > .summary-sidebar {
        animation: none !important;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   CONFIRMATION DIALOG
   Themed modal for destructive actions (e.g. Clear Build). Fades in with a
   subtle pop; Escape / backdrop click / Cancel all dismiss it.
   ───────────────────────────────────────────────────────────────────────────── */
#confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.2s ease;
}
#confirm-modal.show { opacity: 1; }

#confirm-modal .confirm-box {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#confirm-modal.show .confirm-box { transform: none; }

#confirm-modal .confirm-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

#confirm-modal .confirm-message {
    margin: 0 0 22px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--muted);
}

#confirm-modal .confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

#confirm-modal .confirm-actions button {
    flex: 1;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s ease;
}

#confirm-modal .confirm-cancel {
    background: var(--btn-bg);
    color: var(--text);
    border: 1px solid var(--btn-border);
}
#confirm-modal .confirm-cancel:hover { filter: brightness(1.15); }

#confirm-modal .confirm-ok {
    background: var(--danger-red);
    color: #ffffff;
    border: 1px solid var(--danger-red);
}
#confirm-modal .confirm-ok:hover { filter: brightness(1.1); }

body.light-mode #confirm-modal { background: rgba(15, 23, 42, 0.45); }
