@media (max-width: 768px) {
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* === MOBILE OVERRIDE: force 1 column (added by ops) === */
@media (max-width: 768px) {

    .ideas-grid,
    .prompt-ideas-grid,
    .cards-grid,
    .grid-ideas,
    #ideasGrid,
    #promptIdeasGrid,
    #prompt-ideas-grid,
    [data-ideas-grid],
    .prompt-ideas {
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    /* Si alguna parte usa flex en vez de grid */
    .ideas-grid>*,
    .prompt-ideas-grid>*,
    .cards-grid>* {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* OS CORE THEME
   - Dark/Cyber-Minimal Aesthetic
   - 3-Column Grid
   - No Scrollbars (except inside panels)
*/

:root {
    --bg-os: #0f172a;
    /* Slate 900 */
    --bg-panel: #1e293b;
    /* Slate 800 */
    --border-color: #334155;
    /* Slate 700 */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --brand-color: #3b82f6;
    /* Blue 500 */
    --success-color: #10b981;
    /* Emerald 500 */
    --audit-color: #000000;

    --col-left-width: 260px;
    --col-right-width: 300px;
}

* {
    box-sizing: border-box;
}

body.os-body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-os);
    color: var(--text-primary);
    overflow: hidden;
    /* App-like feel */
    height: 100vh;
    width: 100vw;
}

/* --- GRID LAYOUT --- */
.os-grid {
    display: grid;
    grid-template-columns: var(--col-left-width) 1fr var(--col-right-width);
    height: 100vh;
    position: relative;
}

.os-panel {
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.panel-left {
    background: #0f172a;
    /* Darker sidebar */
}

.panel-center {
    background: #1e293b;
    position: relative;
}

.panel-right {
    border-left: 1px solid var(--border-color);
    border-right: none;
    background: #0f172a;
}

/* --- PANEL COMPONENTS --- */
.panel-header {
    height: 50px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.panel-footer {
    height: 60px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

/* --- BRAND --- */
.brand-os {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-primary);
}

.brand-version {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* --- BROWSER HEADER (FOCUS) --- */
.browser-header {
    height: 50px;
    background: #0f172a;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
}

.browser-controls {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.7;
}

.red {
    background: #ef4444;
}

.yellow {
    background: #eab308;
}

.green {
    background: #22c55e;
}

.address-bar {
    flex: 1;
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.protocol {
    opacity: 0.5;
    margin-right: 4px;
}

.path {
    color: var(--text-primary);
}

.browser-actions .btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}

/* --- VIEWPORT --- */
.focus-viewport {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-state h1 {
    font-weight: 300;
    font-size: 2rem;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* --- ACTION DOCK (COST DRIVEN) --- */
.action-dock {
    padding: 16px;
    background: #0f172a;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn-os-green {
    background: var(--success-color);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s;
}

.btn-os-green:active {
    transform: scale(0.98);
}

.btn-os-black {
    background: var(--audit-color);
    color: #fff;
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
}

.cost-tag {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* --- LISTS & STATS --- */
.os-list-header {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.os-list .os-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.os-list .os-item:hover,
.os-list .os-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--success-color);
    font-family: 'JetBrains Mono', monospace;
}

.console-log {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    margin-bottom: 6px;
    opacity: 0.8;
}

.log-entry .time {
    color: var(--brand-color);
    margin-right: 6px;
}

/* --- BUTTONS --- */
.btn-os-secondary {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.btn-os-secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* --- UTILS --- */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* === MOBILE OVERRIDE: force 1 column (added by ops) === */
@media (max-width: 768px) {

    .ideas-grid,
    .prompt-ideas-grid,
    .cards-grid,
    .grid-ideas,
    #ideasGrid,
    #promptIdeasGrid,
    #prompt-ideas-grid,
    [data-ideas-grid],
    .prompt-ideas {
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    /* Si alguna parte usa flex en vez de grid */
    .ideas-grid>*,
    .prompt-ideas-grid>*,
    .cards-grid>* {
        width: 100% !important;
        max-width: 100% !important;
    }
}