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

:root {
    --color-bg: #ffffff;
    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-border: #d2d2d7;
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-card-bg: #f5f5f7;
    --color-success: #34c759;
    --color-warning: #ff9500;
    --color-error: #ff3b30;
    --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: var(--font-system);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

header {
    padding: 48px 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

header h1 {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 21px;
    color: var(--color-text-secondary);
}

main {
    padding: 48px 24px;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
    padding: 24px;
    background: var(--color-card-bg);
    border-radius: var(--radius);
}

.filter-group label:first-child {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
}

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

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-system);
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

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

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.model-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.model-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.model-card.selected {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-accent);
}

.model-card-header {
    margin-bottom: 16px;
}

.model-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.model-provider {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.stat {
    display: flex;
    flex-direction: column;
}

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

.stat-value {
    font-size: 18px;
    font-weight: 600;
}

.model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag {
    padding: 4px 12px;
    background: var(--color-card-bg);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.tag.free { background: #e8f5e9; color: #2e7d32; }
.tag.budget { background: #e3f2fd; color: #1565c0; }
.tag.fast { background: #fff3e0; color: #e65100; }
.tag.quality { background: #f3e5f5; color: #6a1b9a; }

.benchmarks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.benchmark {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.benchmark-name {
    color: var(--color-text-secondary);
}

.benchmark-value {
    font-weight: 600;
}

.comparison-section {
    margin-bottom: 48px;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.comparison-header h2 {
    font-size: 32px;
    font-weight: 600;
}

button {
    padding: 12px 24px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font-system);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

button:hover {
    background: var(--color-accent-hover);
}

.comparison-table {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.comparison-table th {
    background: var(--color-card-bg);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}

.comparison-table td {
    font-size: 15px;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.best-value {
    color: var(--color-success);
    font-weight: 600;
}

.worst-value {
    color: var(--color-error);
}

.cost-calculator {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 48px;
}

.cost-calculator h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
}

.cost-calculator .description {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

.calculator-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-system);
    font-size: 15px;
    background: white;
}

.agent-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--color-text-secondary);
    padding: 12px 0;
}

.calculator-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.cost-result {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.cost-result-model {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.cost-result-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text);
}

.cost-result-value span {
    font-size: 16px;
    font-weight: 400;
    color: var(--color-text-secondary);
}

footer {
    border-top: 1px solid var(--color-border);
    padding: 48px 0;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 14px;
}

footer p {
    margin: 8px 0;
}

footer a {
    color: var(--color-accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 40px;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .model-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-table {
        font-size: 13px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 12px 8px;
    }
}
