:root {
    --bg:          #0d1117;
    --surface:     #161b22;
    --surface-2:   #1c2128;
    --border:      #30363d;
    --text:        #e6edf3;
    --text-muted:  #8b949e;
    --accent:      #58a6ff;
    --green:       #3fb950;
    --green-dim:   rgba(63, 185, 80, 0.12);
    --yellow:      #d29922;
    --yellow-dim:  rgba(210, 153, 34, 0.12);
    --red:         #f85149;
    --red-dim:     rgba(248, 81, 73, 0.12);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

/* ── Controls ───────────────────────────────────────────── */

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.control-group label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

select,
input[type="search"] {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    min-width: 140px;
    outline: none;
    transition: border-color 0.15s;
}

select:focus,
input[type="search"]:focus { border-color: var(--accent); }

input[type="search"]::placeholder { color: var(--text-muted); }

.check-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.35rem 0;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.check-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.row-count {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Table ──────────────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface-2);
}

th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

th:hover { color: var(--text); }

th.sortable::after    { content: " ⇅"; opacity: 0.35; }
th[data-sorted="asc"]::after  { content: " ▲"; color: var(--accent); opacity: 1; }
th[data-sorted="desc"]::after { content: " ▼"; color: var(--accent); opacity: 1; }

td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface); }

/* ── Cell types ─────────────────────────────────────────── */

.col-name {
    font-family: ui-monospace, "Cascadia Code", monospace;
    font-size: 0.78rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-mono {
    font-family: ui-monospace, "Cascadia Code", monospace;
}

.col-muted { color: var(--text-muted); }

.badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: ui-monospace, monospace;
}

.badge-arch {
    background: rgba(88, 166, 255, 0.12);
    color: var(--accent);
}

.badge-moe {
    background: rgba(210, 153, 34, 0.15);
    color: var(--yellow);
    margin-left: 0.35rem;
}

/* ── GPU fit cells ──────────────────────────────────────── */

.fit-cell {
    text-align: center;
    font-size: 1rem;
    width: 60px;
}

.fit-good  { color: var(--green);  background: var(--green-dim); }
.fit-tight { color: var(--yellow); background: var(--yellow-dim); }
.fit-none  { color: var(--red);    background: var(--red-dim); }

/* ── Empty state ────────────────────────────────────────── */

.no-results {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
    font-style: italic;
}
