/* ========================================== */
/* FINAL MOBILE LIGHT THEME - INLINE DOCK     */
/* Replace your entire @media block with this */
/* ========================================== */

@media (max-width: 768px) {

/* 1. HIDE DESKTOP ELEMENTS & DUPLICATE HEADER */
.tabs-container,
.engine-selector,
.mobile-header {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 2. MOBILE LAYOUT (Adjusted for inline dock) */
.mobile-app {
    max-width: 480px;
    margin: 0 auto;
    /* Reduced bottom padding since dock is no longer floating */
    padding: 12px 16px 40px 16px; 
    background-color: #eef1f5;
    /* Short gradient covering just the top toggle */
    background-image: linear-gradient(to bottom, #151a22 0%, #151a22 65px, transparent 100px);
    background-repeat: no-repeat;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
}

/* 3. SEGMENTED PILL (Tight spacing) */
.mode-pill-container {
    padding: 0 0 10px 0; 
}

.mode-pill {
    display: flex;
    background: #212836;
    border-radius: 40px;
    padding: 4px;
    border: none;
}

.mode-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    background: transparent;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mode-btn.active {
    background: linear-gradient(135deg, #fdf0a6, #facc15);
    color: #000000;
}

.mode-icon {
    font-size: 0.95rem;
}

/* 4. PLATFORM CAROUSEL */
.platform-carousel-container {
    padding: 4px 0 8px 0;
}

.platform-carousel {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 4px 2px 8px 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.platform-carousel::-webkit-scrollbar {
    display: none;
}

.platform-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 8px 16px;
    border-radius: 30px;
    background: #2a3241;
    border: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.platform-chip.active {
    background: #fcaa48;
    color: #000000;
}

/* 5. ASPECT RATIO */
.aspect-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0 12px 0;
}

.aspect-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a1a;
}

.aspect-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.aspect-chip {
    flex: 1;
    padding: 8px 12px;
    border-radius: 20px;
    border: none;
    background: #d1d5db;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-height: 36px;
}

.aspect-chip.active {
    background: #1e2430;
    color: #facc15;
}

/* 6. CORE PROMPT */
.core-prompt-section {
    padding: 8px 0 12px 0;
}

.prompt-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.core-textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s ease;
    min-height: 80px;
    line-height: 1.5;
}

.core-textarea:focus {
    outline: none;
    border-color: #fcaa48;
    box-shadow: 0 0 0 3px rgba(252,170,72,0.15);
}

.core-textarea::placeholder {
    color: #94a3b8;
}

/* 7. QUICK INSERT */
.quick-insert-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0 12px 0;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
}

.quick-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-chip {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #e2e8f0;
    color: #1a1a1a;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    min-height: 32px;
}

/* 8. CONTROL DECK */
.control-deck {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #1e2430;
    border-radius: 16px;
    margin-top: 8px;
    margin-bottom: 16px;
}

.deck-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 0 12px 0;
}

.deck-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f3ce73;
    text-transform: uppercase;
}

.deck-badge { display: none; }

.deck-card {
    background: #151a22;
    border: 1px solid #dcb265;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.deck-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.deck-icon {
    font-size: 1.4rem;
    color: #f3ce73;
}

.deck-card-text {
    display: flex;
    flex-direction: column;
}

.deck-title-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.deck-subtext {
    font-size: 0.8rem;
    color: #ffffff;
    margin-top: 2px;
    font-weight: 500;
}

.deck-subtext.empty {
    color: rgba(255,255,255,0.4);
    font-weight: 400;
}

.deck-badge-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}

.deck-badge-status.active {
    background: #facc15;
    color: #000000;
}

/* 9. ADVANCED ACCORDION */
.advanced-accordion,
.collapsible-accordion {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #ffffff;
}

.accordion-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a1a;
    list-style: none;
    font-family: inherit;
}
.accordion-summary::-webkit-details-marker { display: none; }

.accordion-arrow {
    transition: transform 0.25s ease;
    color: #64748b;
}

.advanced-accordion[open] .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 14px 14px 14px;
}

/* 10. STEPPERS */
.stepper-row {
    display: flex;
    gap: 16px;
    padding: 8px 0 12px 0;
}

.stepper-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.stepper-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    min-width: 50px;
}

.stepper-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #e2e8f0;
    border-radius: 30px;
    padding: 2px;
    border: 1px solid #cbd5e1;
}

.stepper-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 30px;
    background: transparent;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.stepper-value {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    color: #0f172a;
}

/* 11. INLINE BOTTOM DOCK (REPLACED STICKY BEHAVIOR) */
.sticky-dock {
    position: relative !important; /* Forces it inline */
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 480px;
    background: #111827 !important;
    border-radius: 16px !important; /* All 4 corners rounded now */
    padding: 16px !important;
    margin-top: 16px !important; /* Spacing below advanced settings */
    margin-bottom: 24px !important;
    z-index: 10;
}

.dock-header {
    display: none; /* Hide if not needed in inline view */
}

.dock-collapsed {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.dock-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.dock-tokens {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4ade80; 
    white-space: nowrap;
}

.dock-tokens span:first-child {
    font-size: 0.85rem;
}

.dock-preview {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.dock-copy-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: #facc15;
    color: #000000;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Expand Arrow & Dock Expanded */
.dock-expand-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-expanded {
    display: none; /* Add Javascript toggle for this or keep visible if preferred */
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 16px;
}

.sticky-dock.expanded .dock-expanded {
    display: block;
}

.dock-prompt-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #ffffff;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    resize: vertical;
    line-height: 1.5;
}

.dock-enhance-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.enhance-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    color: #ffffff;
}

.enhance-btn.claude { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.enhance-btn.gemini { background: linear-gradient(135deg, #4285f4, #34a853); }
.enhance-btn.grok { background: #000000; border: 1px solid rgba(255,255,255,0.1); }

.dock-compile-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #facc15;
    color: #000000;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
}

/* 12. BOTTOM SHEET & MODALS */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 480px;
    max-height: 70vh;
    background: #f8fafc;
    border-radius: 20px 20px 0 0;
    z-index: 10000;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.4, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
}

.bottom-sheet.open {
    transform: translateX(-50%) translateY(0);
}

.sheet-handle {
    padding: 12px 0 8px 0;
    display: flex;
    justify-content: center;
    cursor: grab;
    touch-action: pan-y;
}

.sheet-grabber {
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 4px;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 12px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.sheet-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.sheet-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.sheet-body {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: 50vh;
}

.sheet-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.sheet-chip {
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: #e2e8f0;
    color: #1a1a1a;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
    min-height: 44px;
}

.sheet-chip:active {
    transform: scale(0.97);
}

.sheet-chip.selected {
    background: #fcaa48;
    color: #000000;
}

.sheet-footer {
    padding: 12px 20px 20px 20px;
    border-top: 1px solid #e2e8f0;
}

.sheet-apply-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #fcaa48;
    color: #000000;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    min-height: 48px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: none; 
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal-content {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* 13. VIDEO ONLY */
.video-only { display: none; }
.mode-video .video-only { display: block; }

/* 14. HAPTIC & MISC */
.core-textarea:focus { font-size: 16px; }
.haptic-feedback { animation: hapticPulse 0.15s ease; }
@keyframes hapticPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.96); }
    100% { transform: scale(1); }
}

} /* End of @media (max-width: 768px) */