/* Ollama Model Finder - Bento Grid Design */

/* ============================================
   Bento Grid Layout
   ============================================ */
/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

/* Bento Card Box Styling */
.bento-card {
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.bento-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.header-section {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.header-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header-section .tagline {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 500;
    margin: 8px 0;
    opacity: 0.9;
}

.header-section .subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 8px;
}

/* Card sizing for visual hierarchy */
.chip-card {
    grid-column: span 2;
    grid-row: span 1;
}

.ram-card {
    grid-column: span 2;
    grid-row: span 1;
}

.deploy-card {
    grid-column: span 2;
    grid-row: span 1;
}

.filters-card {
    grid-column: span 2;
    grid-row: span 1;
}

.search-card {
    grid-column: span 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.search-card .search-box {
    flex: 1;
    max-width: 500px;
}

.search-card .refresh-btn {
    flex-shrink: 0;
}

.results-card {
    grid-column: span 4;
}

/* Filters Content */
.filters-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-row .filter-label {
    min-width: 90px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Search icon */
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

/* Responsive Bento Grid - Mobile First */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chip-card,
    .ram-card,
    .deploy-card,
    .filters-card {
        grid-column: span 1;
    }
    
    .search-card,
    .results-card {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .chip-card,
    .ram-card,
    .deploy-card,
    .filters-card,
    .search-card,
    .results-card {
        grid-column: span 1;
    }
    
    .search-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-card .search-box {
        max-width: none;
    }
}

/* Ollama Model Finder - Mac-Friendly Minimal Design */

:root {
    /* Dark Theme Bento Palette */
    --bg-base: #0a0a0f;
    --bg-elevated: #12121a;
    --bg-surface: #1a1a24;
    --bg-active: #22222e;
    
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(255, 255, 255, 0.20);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-tertiary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.35);
    
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-secondary: #22d3ee;
    --accent-success: #10b981;

    --success: #10b981;
    --danger: #ef4444;

    --bg-card: #12121a;
    --border: rgba(255, 255, 255, 0.12);

    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 40px 20px;
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
    display: block;
}

/* ============================================
   Chip Selector - Apple Silicon
   ============================================ */
.chip-selector-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border: 1px solid var(--border);
}

.chip-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.chip-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 18px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--text-primary);
    min-width: 85px;
}

.chip-btn:hover {
    border-color: var(--accent);
    background: var(--bg-active);
}

.chip-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.chip-btn.selected .chip-years {
    color: rgba(255, 255, 255, 0.8);
}

.chip-name {
    font-size: 1rem;
    font-weight: 600;
}

.chip-years {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.chip-specs {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* Specs card in bento style */
.specs-card {
    margin-top: 16px;
    padding: 16px;
}

.specs-card .selector-label {
    margin-bottom: 12px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.spec-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 4px;
}

.spec-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   RAM Selector
   ============================================ */
.ram-selector-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
    /* Emphasize with subtle gradient */
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border: 1px solid var(--border);
}

.section-label {
    display: block;
    font-size: 1.375rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.ram-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ram-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
    min-width: 70px;
}

.ram-btn:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.ram-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    border-width: 2px;
    color: white;
}

.ram-btn.selected::before {
    opacity: 1;
}

.ram-btn.selected .ram-value,
.ram-btn.selected .ram-label {
    position: relative;
    z-index: 1;
}

.ram-value {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
}

.ram-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
}

.ram-btn.selected .ram-label {
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   Deployment Type Toggle
   ============================================ */
.deployment-toggle-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.deployment-toggle {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
}

.deploy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.15s ease;
    font-family: inherit;
}

.deploy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.deploy-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.deployment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    margin-top: 4px;
}

.deployment-badge.local {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.deployment-badge.cloud {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
}

.deployment-badge.both {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* Secondary Controls */
.secondary-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Filter row for horizontal layout */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

/* Column-based layout: 2 columns */
.filter-row.columns-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.filter-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-column .selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-column .selector-label {
    margin-bottom: 0;
}

/* Row-based layout: 2 rows, all content on left */
.filter-row.rows-2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-row-group {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.filter-row-group .selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-row-group .selector-group .selector-label {
    margin-bottom: 4px;
}

.filter-row .selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-row .selector-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.filter-row .filter-group,
.filter-row .deployment-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Filter row selector group */
.filter-row.columns-2 .selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Keep buttons horizontal in filter row */
.filter-row.columns-2 .deployment-toggle,
.filter-row.columns-2 .filter-group,
.filter-row.columns-2 .precision-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Make all buttons in filter row same size */
.filter-row .filter-btn,
.filter-row .deploy-btn,
.filter-row .precision-btn {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Generic selector label */
.selector-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.search-box {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

/* Refresh Button */
.refresh-btn {
    padding: 10px 18px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
    max-width: 110px;
    justify-content: center;
}

.refresh-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.02);
}

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

/* Quantization Filter */
.quant-filter {
    display: flex;
    align-items: center;
}

.quant-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    margin-top: 8px;
    background: var(--bg-base);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
}

.quant-option {
    padding: 12px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.quant-option.fits {
    border-color: var(--success);
}

.quant-option.no-fit {
    border-color: var(--danger);
    opacity: 0.7;
}


.quant-option.recommended {
    border-color: var(--accent);
    background: var(--bg-active);
}

.quant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.quant-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.quant-size {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.quant-ram {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.quant-cmd {
    display: block;
    margin-top: 6px;
    padding: 4px 8px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-family: 'SF Mono', ui-monospace, monospace;
    word-break: break-all;
}

.quant-select {
    padding: 8px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 110px;
    max-width: 110px;
}

.quant-select:hover {
    border-color: var(--accent);
}

.quant-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Precision Filter (Standard vs Quantized) */
.precision-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.precision-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    font-family: inherit;
}

.precision-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.precision-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Results Section */
.results-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.stats {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-bottom: var(--space-5);
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.model-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.model-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-default);
}

.model-card.recommended {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--bg-surface) 100%);
}

.model-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-primary);
    word-break: break-word;
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.best-fit-badge {
    font-size: 0.6875rem;
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.model-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

.meta-icon {
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 600;
    color: var(--text-tertiary);
}


.meta-item.category-chat { background: rgba(99, 102, 241, 0.15); color: #818cf8; border-color: transparent; }
.meta-item.category-coding { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: transparent; }
.meta-item.category-reasoning { background: rgba(168, 85, 247, 0.15); color: #c084fc; border-color: transparent; }
.meta-item.category-vision { background: rgba(249, 115, 22, 0.15); color: #fb923c; border-color: transparent; }

.model-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.ram-needed {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.ram-needed.fits {
    color: var(--success);
}

.ram-needed.no-fit {
    color: var(--danger);
}

.rec-badge {
    font-size: 0.6875rem;
    background: var(--accent);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}


.fit-indicator {
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    overflow: hidden;
}

.fit-bar {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #c62828;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

.model-card .model-size {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.model-card .model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 0.6875rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tag.General, .tag.Chat { background: #e3f2fd; color: #1565c0; }
.tag.Coding { background: #ffebee; color: #c62828; }
.tag.Reasoning { background: #f3e5f5; color: #7b1fa2; }
.tag.Vision { background: #fff3e0; color: #e65100; }

footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    padding: 16px;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    body {
        padding: 16px 12px;
    }

    /* Header */
    .header-section h1,
    header h1 {
        font-size: 1.5rem;
        letter-spacing: -0.01em;
    }

    .header-section .subtitle {
        font-size: 0.9375rem;
    }

    .header-section .tagline {
        font-size: 0.8125rem;
    }

    /* Bento cards — reduce padding */
    .bento-card {
        padding: 16px;
    }

    /* Chip buttons — 3 per row on mobile */
    .chip-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .chip-btn {
        padding: 12px 8px;
        min-width: unset;
    }

    .chip-name {
        font-size: 0.875rem;
    }

    /* Specs grid — 3 per row on mobile */
    .specs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    /* RAM buttons — 3 per row on mobile */
    .ram-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .ram-btn {
        padding: 12px 8px;
        min-width: unset;
    }

    .ram-value {
        font-size: 1rem;
    }

    .ram-label {
        font-size: 0.75rem;
    }

    /* Filters — stack to single column */
    .filter-row.columns-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Search box — full width */
    .search-box {
        min-width: 0;
        max-width: none;
        flex: 1;
    }

    /* Quant select + Reset — full width */
    .quant-select {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .refresh-btn {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    /* Secondary controls */
    .secondary-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    /* Results section */
    .results-section {
        padding: 16px 12px;
    }

    .models-grid {
        grid-template-columns: 1fr;
    }

    /* Ad card — stack on mobile */
    .ad-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ad-cta {
        align-self: flex-start;
    }

    /* Footer — stack lines */
    .app-footer {
        font-size: 0.75rem;
        padding: 16px 12px;
    }

    .app-footer .credits {
        font-size: 0.6875rem;
        margin-top: 6px;
    }

    /* Upgrade nudge */
    .upgrade-nudge {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* Extra small screens (iPhone SE etc) */
@media (max-width: 390px) {
    .chip-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .ram-buttons {
        grid-template-columns: repeat(3, 1fr);
    }

    .header-section h1 {
        font-size: 1.25rem;
    }

    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* Show Quantizations Button */
.show-quants-btn {
    display: block;
    width: 100%;
    padding: 8px 16px;
    margin-top: 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.show-quants-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.loading, .error, .no-quants {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.error {
    color: #ef4444;
}


/* Ad Card */
.ad-card {
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ad-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.ad-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ad-image {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
}

.ad-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.ad-headline {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ad-description {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.ad-cta {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-hover);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.ad-cta:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Upgrade nudge — shown when 16GB or 24GB RAM is selected */
.upgrade-nudge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.upgrade-nudge-text {
    color: var(--text-tertiary);
}

.upgrade-nudge-link {
    color: var(--accent-hover);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.upgrade-nudge-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.app-footer {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 14px;
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
}


.app-footer .credits {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #9ca3af;
}

.footer-link {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.footer-cta {
    color: var(--accent-hover);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-cta:hover {
    color: var(--text-primary);
    text-decoration: underline;
}
