/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
    --accent-color: #667eea;
    --glass-bg:     rgba(255,255,255,0.05);
    --glass-border: rgba(255,255,255,0.1);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
html, body { height:100%; margin:0; scroll-behavior:smooth; }
body {
    min-height:100vh;
    font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
    display:flex; flex-direction:column;
}
.small { font-size:.875em!important; }

/* ── Glass panel ───────────────────────────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
    border:1px solid var(--glass-border);
    border-radius:20px; padding:1rem;
    box-shadow:0 20px 50px rgba(0,0,0,0.3);
}

/* ── App shell (sidebar + main) ─────────────────────────────────────────
   ❌ was: height:100vh; background:#0f1117; color:white
   ✅ fix: no forced height, transparent bg so glass-panel shows through  */
.app-shell {
    display:flex;
    min-height:500px;
    border-radius:12px;
    overflow:hidden;
    border:1px solid var(--glass-border);
}

.app-sidebar {
    width: 375px;
    min-width: 0;  
    flex-shrink: 0;
    background: #f8f9fa;
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
}

.app-main {
    overflow-y:auto;
    min-width:0;        /* prevent flex overflow */
    flex:1;
}

/* ── Mode panels ────────────────────────────────────────────────────────── */
.mode-panel { display:none; }
.mode-panel.active { display:block; }

/* ── Mode toggle buttons ────────────────────────────────────────────────── */
.mode-toggle { display:flex; gap:8px; }
.mode-toggle .btn { flex:1; }

/* ── Upload zone ────────────────────────────────────────────────────────── */
.image-upload-zone {
    border:2px dashed #7456b3;
    border-radius:10px;
    text-align:center;
    cursor:pointer;
    transition:all .3s ease;
    background:#efefefE9;
    position:relative;
}
.image-upload-zone:hover { background:#f0f2ff; border-color:#764ba2; transform:translateY(-2px); }
.image-upload-zone.large { padding:30px 20px; min-height:120px; }
.image-upload-zone.large .upload-icon { font-size:2.5rem; display:block; margin-bottom:8px; }
.image-upload-zone.compact { padding:10px 15px; display:flex; align-items:center; gap:8px; }
.image-preview { max-width:100%; max-height:300px; border-radius:12px; box-shadow:0 4px 15px rgba(0,0,0,.1); margin-top:.5rem; }

/* ── Reference image previews ───────────────────────────────────────────── */
.ref-previews-grid { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.ref-image-preview { position:relative; width:100px; height:100px; border-radius:8px; overflow:hidden; border:2px solid rgba(255,255,255,.2); background:rgba(0,0,0,.3); transition:all .2s ease; }
.ref-image-preview:hover { transform:scale(1.05); border-color:#fff; }
.ref-image-preview img { width:100%; height:100%; object-fit:cover; }
.ref-image-preview .remove-btn { position:absolute; top:3px; right:3px; width:22px; height:22px; padding:0; background:rgba(220,53,69,.9); border:none; border-radius:50%; color:white; cursor:pointer; opacity:0; transition:opacity .2s; display:flex; align-items:center; justify-content:center; font-size:14px; }
.ref-image-preview:hover .remove-btn { opacity:1; }
.ref-image-preview .image-index { position:absolute; bottom:3px; left:3px; background:rgba(0,0,0,.7); color:white; padding:1px 5px; border-radius:3px; font-size:10px; font-weight:bold; }

/* ── Nav pills (sidebar mode toggle uses plain buttons, but keep for any lib usage) */
.nav-pills .nav-link { color:rgba(255,255,255,.6); border-radius:50px; padding:10px 25px; }
.nav-pills .nav-link.active { background-color:white; color:#302b63; font-weight:bold; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-glow {
    background:linear-gradient(90deg,#667eea 0%,#764ba2 100%);
    border:none; color:white; font-weight:bold;
    padding:14px 30px; border-radius:50px;
    font-size:1rem; width:100%;
    transition:transform .2s, box-shadow .2s;
    cursor:pointer;
}
.btn-glow:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 10px 20px rgba(118,75,162,.4); }
.btn-glow:disabled { opacity:.6; cursor:not-allowed; }

/* ── Model variant buttons ──────────────────────────────────────────────── */
.model-variant-btn {
    border: 2px solid #dee2e6 !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    transition: all .3s ease !important;
    background: #ededed !important;
    width: 47%;
    font-size: 0.85rem;
}

/* Restore min-width on wider screens where two side-by-side buttons fit */
@media (min-width: 481px) {
    .model-variant-btn { min-width: 120px !important; }
}
.model-variant-btn:hover:not(.active) { border-color:rgba(139,139,139,.4)!important; background:#dee2e6!important; transform:translateY(-2px)!important; }
.model-variant-btn.active { border:2px solid #667eea!important; background:linear-gradient(135deg,rgba(102,126,234,.25) 0%,rgba(118,75,162,.25) 100%)!important; box-shadow:0 0 20px rgba(102,126,234,.35)!important; }

/* ── Resolution / aspect ratio pills ───────────────────────────────────── */
.resolution-pill { padding:6px 14px; border:2px solid darkgrey; border-radius:20px; cursor:pointer; font-size:13px; background:#c8d1f8; transition:all .3s ease; }
.resolution-pill:hover { border-color:rgba(255,255,255,.4); }
.resolution-pill.selected { background:linear-gradient(90deg,#667eea 0%,#764ba2 100%); color:#fff; border-color:transparent; }
.resolution-pill .credit-cost { font-size:11px; opacity:.8; margin-left:4px; }
.aspect-ratio-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(95px,1fr)); gap:8px; }
.aspect-ratio-btn { padding:10px; border:2px solid rgba(172,172,172,.2); border-radius:8px; cursor:pointer; text-align:center; background:rgba(255,255,255,.05); font-size:13px; transition:all .3s ease; }
.aspect-ratio-btn:hover { border-color:rgba(255,255,255,.4); }
.aspect-ratio-btn.selected { background:linear-gradient(90deg,#667eea 0%,#764ba2 100%); color:#fff; border-color:transparent; }

/* ── Generate button cost badge ─────────────────────────────────────────── */
.generate-btn-cost { background:rgba(255,255,255,.2); padding:3px 9px; border-radius:12px; margin-left:8px; font-size:12px; white-space:nowrap; }
.badge-hidden { display:none!important; }

/* ── Result container ───────────────────────────────────────────────────── */
#resultContainer { display:none; margin-top:24px; border-top:1px solid rgba(255,255,255,.1); padding-top:24px; }
.video-wrapper { border-radius:12px; overflow:hidden; box-shadow:0 10px 30px rgba(0,0,0,.5); background:black; }
.image-result-wrapper { position:relative; border-radius:12px; overflow:hidden; margin:16px 0; box-shadow:0 8px 32px rgba(0,0,0,.3); }
.image-result-wrapper img { width:100%; height:auto; display:block; }
.generation-complete-badge { position:absolute; top:12px; right:12px; background:rgba(0,255,0,.9); color:white; padding:6px 14px; border-radius:20px; font-weight:bold; font-size:13px; }

/* ── Toast container
   ❌ was: gradient background on the container itself
   ✅ fix: container is transparent; individual .alert children keep their own styles */
#toastContainer {
    position:fixed; top:80px; right:20px; z-index:9999;
    max-width:380px; background:transparent;
}
#toastContainer .alert { animation:slideInRight .4s ease-out; }

@keyframes slideInRight {
    from { transform:translateX(120%); opacity:0; }
    to   { transform:translateX(0);    opacity:1; }
}

/* ── Family / model info cards ──────────────────────────────────────────── */
#familyDescription, #videoFamilyDescription { background:#fcfcfc; border:none; }
#selectedModelInfo   { background:rgba(40,167,69,.08); border:1px solid rgba(40,167,69,.25); }

/* ── LoRA video player ──────────────────────────────────────────────────── */
.video-container { position:relative; width:fit-content; margin:0 auto; border-radius:8px; overflow:hidden; }
#videoPlayer { width:260px; height:auto; }
video { width:100%; height:auto; display:block; }
.lora-content-wrapper { display:flex; gap:16px; align-items:flex-start; }
@media (min-width:768px) { .lora-description { flex:1; order:1; } .lora-video { flex:0 0 340px; order:2; } }
@media (max-width:767px) { .lora-content-wrapper { flex-direction:column; } .lora-video { order:1; width:100%; } .lora-description { order:2; width:100%; } }

.blur-overlay { position:absolute; inset:0; backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); background:rgba(255,255,255,.3); display:flex; justify-content:center; align-items:center; transition:opacity .3s ease; }
.blur-overlay.hidden { opacity:0; pointer-events:none; }
.show-video-btn { padding:12px 24px; font-size:15px; font-weight:bold; color:white; background:#dc3545; border:none; border-radius:5px; cursor:pointer; transition:background .3s, transform .1s; }
.show-video-btn:hover { background:#c82333; transform:translateY(-2px); }

/* ── Age modal ──────────────────────────────────────────────────────────── */
.age-modal { position:fixed; inset:0; background:rgba(0,0,0,.7); z-index:10000; display:flex; justify-content:center; align-items:center; }
.age-modal-content { background:white; padding:28px; border-radius:10px; max-width:480px; width:90%; box-shadow:0 10px 25px rgba(0,0,0,.3); }
.age-modal-content h3 { margin-top:0; color:#333; font-size:22px; }
.age-modal-content p  { color:#666; line-height:1.6; }
.age-consent-checkbox { display:flex; align-items:center; gap:10px; padding:12px; background:#f8f9fa; border-radius:5px; margin-bottom:20px; }
.age-consent-checkbox input { width:18px; height:18px; cursor:pointer; }
.age-modal-buttons { display:flex; gap:10px; justify-content:flex-end; }
.age-modal-buttons button { padding:9px 18px; border:none; border-radius:5px; font-size:15px; cursor:pointer; transition:all .3s; }
.btn-cancel { background:#6c757d; color:white; }
.btn-cancel:hover { background:#5a6268; }
.btn-confirm { background:#28a745; color:white; }
.btn-confirm:hover:not(:disabled) { background:#218838; }
.btn-confirm:disabled { background:#ccc; cursor:not-allowed; opacity:.6; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero-video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; }
.hero-content, .scroll-indicator { position:relative; z-index:2; }
.hero-showcase {
    min-height:100vh; display:flex; flex-direction:column; justify-content:center;
    align-items:center; text-align:center; padding:80px 20px 40px;
    background:linear-gradient(135deg,rgba(102,126,234,.1) 0%,rgba(118,75,162,.1) 100%);
    position:relative; overflow:hidden;
}
.hero-showcase::before { z-index:1; pointer-events:none; content:''; position:absolute; inset:0; background:radial-gradient(circle at 30% 50%,rgba(102,126,234,.15),transparent 50%),radial-gradient(circle at 70% 50%,rgba(118,75,162,.15),transparent 50%); animation:pulseGradient 8s ease-in-out infinite; }
.hero-showcase::after  { content:''; position:absolute; inset:0; background:rgba(0,0,0,.25); z-index:1; pointer-events:none; }
@keyframes pulseGradient { 0%,100%{opacity:.5} 50%{opacity:1} }
.hero-content { position:relative; z-index:2; max-width:900px; }
.hero-title { font-size:clamp(2.5rem,6vw,5rem); font-weight:800; background-clip:text; margin-bottom:1.5rem; line-height:1.2; animation:fadeInUp 1s ease-out; color:white; }
.hero-subtitle { font-size:clamp(1.1rem,2vw,1.5rem); color:white; margin-bottom:2rem; animation:fadeInUp 1s ease-out .2s backwards; }
.hero-cta { display:inline-flex; gap:1rem; animation:fadeInUp 1s ease-out .4s backwards; }
.hero-btn { padding:16px 40px; font-size:1.1rem; font-weight:600; border-radius:50px; text-decoration:none; transition:all .3s ease; display:inline-flex; align-items:center; gap:10px; border:5px white solid; }
.hero-btn-primary { background:linear-gradient(135deg,#667eea 0%,#764ba2 100%); color:white; box-shadow:0 10px 30px rgba(102,126,234,.4); }
.hero-btn-primary:hover { transform:translateY(-3px); box-shadow:0 15px 40px rgba(102,126,234,.6); color:white; }
.hero-btn-secondary { border:4px rgba(255,255,255,.3) solid; color:white; backdrop-filter:blur(10px); background:#ff9900; }
.hero-btn-secondary:hover { background:#ffc800; border-color:rgba(255,255,255,.5); }
.scroll-indicator { position:absolute; bottom:30px; left:50%; transform:translateX(-50%); animation:bounce 2s infinite; cursor:pointer; z-index:1; }
.scroll-indicator i { font-size:2rem; color:rgba(255,255,255,.6); }
@keyframes bounce { 0%,20%,50%,80%,100%{transform:translateX(-50%) translateY(0)} 40%{transform:translateX(-50%) translateY(-10px)} 60%{transform:translateX(-50%) translateY(-5px)} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }

/* ── Gallery ────────────────────────────────────────────────────────────── */
.showcase-gallery { padding:60px 10px; background:#e3e3e3 }
.gallery-header { text-align:center; margin-bottom:60px; }
.gallery-header h2 { font-size:clamp(2rem,4vw,3.5rem); font-weight:700; margin-bottom:1rem; background:linear-gradient(135deg,#667eea 0%,#764ba2 100%); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.gallery-header p { font-size:1.2rem; color:rgba(255,255,255,.7); }
.gallery-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:25px; max-width:1400px; margin:0 auto; }
.gallery-item { position:relative; border-radius:16px; overflow:hidden; background:rgba(255,255,255,.05); backdrop-filter:blur(10px); border:1px solid rgba(255,255,255,.1); transition:all .4s cubic-bezier(.175,.885,.32,1.275); cursor:pointer; aspect-ratio:1/1; }
.gallery-item:hover { box-shadow:0 20px 60px rgba(102,126,234,.3); border-color:rgba(102,126,234,.5); }
.gallery-item img, .gallery-item video { width:100%; height:100%; object-fit:cover; }
.gallery-item-overlay { position:absolute; inset:0; opacity:0; display:flex; flex-direction:column; justify-content:flex-end; padding:20px; }
.gallery-item:hover .gallery-item-overlay { opacity:1; }
.gallery-item-title { font-size:1.1rem; font-weight:600; color:white; margin-bottom:.5rem; }
.gallery-item-meta { font-size:.9rem; color:rgba(255,255,255,.7); display:flex; align-items:center; gap:10px; }
.gallery-badge { background:linear-gradient(135deg,#667eea 0%,#764ba2 100%); color:white; padding:4px 12px; border-radius:20px; font-size:.75rem; font-weight:600; }

/* ── Floating CTA ───────────────────────────────────────────────────────── */
.floating-cta { position:fixed; bottom:30px; right:30px; z-index:999; }
.floating-cta-btn { display:flex; align-items:center; gap:12px; padding:16px 28px; background:linear-gradient(135deg,#667eea 0%,#764ba2 100%); color:white; border:5px white solid; border-radius:50px; font-size:1.1rem; font-weight:600; box-shadow:0 10px 40px rgba(102,126,234,.5); cursor:pointer; transition:all .3s ease; text-decoration:none; }
.floating-cta-btn:hover { transform:translateY(-3px) scale(1.05); box-shadow:0 15px 50px rgba(102,126,234,.7); color:white; }

/* ── Generator section ──────────────────────────────────────────────────── */
.generator-section { padding:10px 10px;}

/* ── Sample image ───────────────────────────────────────────────────────── */
#selectedModelImage { cursor:pointer; transition:transform .2s ease, box-shadow .2s ease; }
#selectedModelImage:hover { transform:scale(1.05); box-shadow:0 4px 12px rgba(102,126,234,.3); }

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

/* ── Mobile ─────────────────────────────────────────────────────────────── */
/* ── Tablet — narrower sidebar so main area has room ─────────────────────── */
@media (max-width: 1024px) and (min-width: 769px) {
    .app-sidebar { width: 320px; }
}

@media (max-width:768px) {
    .app-shell { flex-direction:column; }
    .app-sidebar {
        width: 100%;
        min-width: 0;          /* ← critical: overrides any residual min-width */
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    .hero-showcase { padding:60px 15px 30px; }
    .hero-cta { flex-direction:column; width:100%; }
    .hero-btn { width:100%; justify-content:center; }
    .gallery-grid { grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:15px; }
    .floating-cta { bottom:20px; right:20px; }
    .floating-cta-btn { padding:12px 18px; font-size:.95rem; }
    #selectedModelImageCol { margin-bottom:.75rem; }
    #selectedModelImage { max-width:90px!important; max-height:90px!important; }

    /* ── Sidebar content fixes for narrow screens ─────────────────────── */
    /* Variant buttons: stack full-width instead of side-by-side */
    .model-variant-btn {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Sample prompts dropdown: don't force 340px on a 320px screen */
    .sample-prompts-menu {
        min-width: 0 !important;
        max-width: 92vw !important;
    }
}

/* ── Very narrow screens (≤480px) — single-column grids ──────────────────── */
@media (max-width: 480px) {
    .image-output-grid,
    .video-output-grid,
    .required-images-grid,
    .meshy-options-grid,
    .tripo-options-grid {
        grid-template-columns: 1fr;
    }
}
/* ── Sample Prompts Dropdown ─────────────────────────────────── */
.sample-prompts-menu {
    min-width: min(340px, 92vw);
    max-width: min(480px, 92vw);
    max-height: 310px;
    overflow-y: auto;
    border-radius: 10px !important;
    border: 1px solid rgba(0,0,0,.08) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,.14) !important;
    padding: 6px !important;
}
.sample-prompts-menu::-webkit-scrollbar { width: 4px; }
.sample-prompts-menu::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.15); border-radius: 4px;
}

.sample-prompt-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 9px;
    white-space: normal !important;
    line-height: 1.45;
    padding: 8px 10px !important;
    border-radius: 7px !important;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: #2d3748;
    transition: background .12s;
}
.sample-prompt-item:hover,
.sample-prompt-item:focus { background: #f0f1ff; color: #1a202c; }
.sample-prompt-item:active { background: #e0e2ff; }

.sample-prompt-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
    letter-spacing: 0;
}
.sample-prompt-preview {
    font-size: 12px;
    line-height: 1.45;
    color: inherit;
    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sample-prompts-toggle {
   /* font-size: 11px !important; */
    text-decoration: none !important;
    color: #6c757d !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 !important;
    border: none;
    background: none;
    cursor: pointer;
    transition: color .15s;
}
.sample-prompts-toggle:hover { color: #6366f1 !important; }
.sample-prompts-toggle::after {
    /* Bootstrap caret */
    display: inline-block;
    margin-left: 2px;
    vertical-align: 2px;
    border-top: .3em solid;
    border-right: .3em solid transparent;
    border-bottom: 0;
    border-left: .3em solid transparent;
    content: "";
}
/* ── Multi-image output grid ─────────────────────────────────────────── */
    .image-output-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .image-output-item img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 8px;
        cursor: zoom-in;
        transition: transform .15s ease, box-shadow .15s ease;
    }
    .image-output-item img:hover {
        transform: scale(1.03);
        box-shadow: 0 4px 20px rgba(0,0,0,.35);
    }
/* ── Multi-video output grid ─────────────────────────────────────────────── */
.video-output-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.video-output-item video {
    width: 100%;
    max-height: 180px;
    border-radius: 8px;
    background: #000;
    object-fit: contain;
}
#threeViewerContainer canvas { touch-action: none; }
/* ── Required multi-view image uploads ─────────────────────────── */
.required-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.required-image-slot {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: border-color 0.2s;
    position: relative;
}
.required-image-slot.has-image {
    border-color: var(--bs-primary);
    border-style: solid;
}
.required-image-slot label {
    font-size: .72rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: capitalize;
    display: block;
    margin-bottom: 6px;
}
.required-image-slot .upload-zone {
    cursor: pointer;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.required-image-slot .upload-zone i {
    font-size: 1.5rem;
    color: #6c757d;
}
.required-image-slot .upload-zone p {
    font-size: .68rem;
    margin: 0;
    color: #6c757d;
}
.required-image-slot img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}
.required-image-slot .remove-required-img {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220,53,69,0.9);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    color: #fff;
    font-size: .7rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}
.required-image-slot.has-image .remove-required-img {
    display: flex;
}
/* ── Meshy 3D options panel ─────────────────────────────────────── */
.meshy-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.meshy-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.meshy-field label {
    font-size: .72rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: capitalize;
}
.meshy-field select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meshy-field select,
.meshy-field input[type="number"] {
    font-size: .8rem;
    padding: .25rem .5rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.12);
    width: 100%;  
    max-width: 100%;  
    box-sizing: border-box;  
}
.meshy-field input[type="range"] {
    width: 100%;
}
.meshy-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}
.meshy-toggle label {
    font-size: .78rem;
    font-weight: 600;
    color: #6c757d;
    margin: 0;
    cursor: pointer;
}
.meshy-toggle .form-check-input {
    width: 1.6em;
    height: 1em;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.meshy-polycount-display {
    font-size: .72rem;
    color: #6366f1;
    font-weight: 700;
    text-align: right;
}
/* ── Tripo 3D options panel (reuses .meshy-* classes) ──────────── */
.tripo-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tripo-options-grid .meshy-field,
.tripo-options-grid .meshy-toggle {
    /* reuse existing meshy field/toggle styling */
}
/* ── Tripo help text toggle ─────────────────────────────────────── */
.tripo-help-toggle {
    transition: color .15s, transform .15s;
}
.tripo-help-toggle:hover {
    color: var(--bs-primary) !important;
    transform: scale(1.15);
}
.tripo-help-toggle.active {
    color: var(--bs-primary) !important;
}

@keyframes tripoHelpFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* ── Help text popovers (used by Tripo + Meshy V7 help icons) ──────────── */
.tripo-help-text {
    font-size: .72rem;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 4px;
    line-height: 1.4;
    animation: helpFadeIn .15s ease-out;
}
@keyframes helpFadeIn {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}
.help-toggle {
    transition: color .15s, transform .15s;
}
.help-toggle:hover {
    color: #6366f1 !important;
    transform: scale(1.15);
}
.help-toggle.active {
    color: #6366f1 !important;
}
/* ── Popular badge for model cards ── */
.popular-badge {
            display: inline-block;
            background: #ff8c00;
            color: #ffffff;
            font-size: 9px;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 4px;
            margin-bottom: 3px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            line-height: 1.2;
            vertical-align: middle;
        }
 /* ── Thumbnail for model cards ── */
        .variant-thumb {
            width: 50px;
            height: 50px;
            min-width: 50px;
            border-radius: 4px;
            object-fit: cover;
            align-self: center;
        }
        /* ── Sketcher ──────────────────────────────────────────────────────────── */
.sketcher-toolbar {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 10px 12px;
}

.sketcher-toolbar .sketch-brush-size {
    width: 120px;
    height: 6px;
    padding: 0;
}

.sketcher-toolbar .sketch-color-picker {
    width: 38px;
    height: 30px;
    padding: 2px;
    border-radius: 6px;
}

.sketcher-toolbar .sketch-tool.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.sketcher-canvas-wrap {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    aspect-ratio: 4 / 3;
}

#sketchCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.sketch-canvas-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #adb5bd;
    pointer-events: none;
    font-size: .9rem;
}

.sketch-canvas-hint.hidden {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sketcher-toolbar .sketch-brush-size {
        width: 80px;
    }
    .sketcher-canvas-wrap {
        aspect-ratio: 1 / 1;
    }
}