:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --green-bg: #dcfce7;
    --green-text: #166534;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.4rem; font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: -0.03em; }
.logo span { color: var(--primary); }
.nav-links a { text-decoration: none; color: var(--text); font-weight: 500; margin-left: 1.5rem; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }
.nav-links .muted-link { color: var(--muted); }

/* Hero & Page Header */
.hero, .page-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0;
    margin-bottom: 2rem;
}
.hero h1 { font-size: 2.4rem; line-height: 1.2; letter-spacing: -0.03em; margin-bottom: 0.75rem; }
.page-header h1 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.subtitle { color: var(--muted); font-size: 1.1rem; max-width: 600px; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.breadcrumb a { color: var(--primary); text-decoration: none; }

/* Portal Cards */
.section-title { font-size: 1.2rem; margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
}
.active-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); border-color: var(--primary); }
.coming-soon { opacity: 0.7; }
.card-badge {
    align-self: flex-start;
    background: #eff6ff;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 99px;
    margin-bottom: 1rem;
}
.card-badge.gray { background: #f1f5f9; color: var(--muted); }
.card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex: 1; }
.card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 1rem; }
.arrow { color: var(--primary); font-weight: 600; }

/* Controls Bar */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.search-input {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    min-width: 260px;
    flex: 1;
}
.filter-group, .price-toggle {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.25rem;
    gap: 0.25rem;
}
.filter-btn, .toggle-btn {
    border: none;
    background: transparent;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--muted);
}
.filter-btn.active, .toggle-btn.active {
    background: var(--text);
    color: #fff;
}

/* Database Table */
.table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 3rem;
}
.db-table { width: 100%; border-collapse: collapse; text-align: left; }
.db-table th {
    background: #f1f5f9;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.db-table td { padding: 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.db-table tr:last-child td { border-bottom: none; }
.db-table tr:hover { background: #f8fafc; }

.model-name { font-weight: 600; font-size: 1rem; }
.model-provider { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
.tag-free {
    background: var(--green-bg);
    color: var(--green-text);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-left: 0.35rem;
}
.badge {
    background: #f1f5f9;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}
.best-for { font-size: 0.9rem; max-width: 280px; }
.action-cell { text-align: right; }
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-primary:hover { background: var(--primary-hover); }
.no-results { padding: 2rem; text-align: center; color: var(--muted); }

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--muted);
}
.footer-inner { display: flex; flex-direction: column; gap: 0.75rem; }
.disclosure { font-size: 0.8rem; max-width: 750px; }

/* Mobile Responsive Cards */
@media (max-width: 768px) {
    .db-table thead { display: none; }
    .db-table, .db-table tbody, .db-table tr, .db-table td { display: block; width: 100%; }
    .db-table tr { padding: 1rem; border-bottom: 2px solid var(--border); }
    .db-table td { padding: 0.4rem 0; border: none; display: flex; justify-content: space-between; align-items: center; }
    .db-table td::before { content: attr(data-label); font-weight: 600; font-size: 0.8rem; color: var(--muted); }
    .db-table td:first-child { display: block; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; }
    .db-table td:first-child::before { display: none; }
    .action-cell { margin-top: 0.75rem; }
    .action-cell::before { display: none; }
    .btn-primary { width: 100%; text-align: center; }
}