:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --border: #1e1e2e;
    --text: #e0e0e8;
    --text-dim: #6e6e82;
    --accent: #7c8aff;
    --hot: #ff6b6b;
    --warm: #ffa94d;
    --cool: #4ecdc4;
    --cold: #45556e;
    --green: #51cf66;
    --red: #ff6b6b;
    --radius: 6px;
    --font: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#status-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 12px;
    color: var(--text-dim);
}

.badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.full { background: #1a3a1a; color: var(--green); }
.badge.reduced { background: #3a3a1a; color: var(--warm); }
.badge.stopped { background: #3a1a1a; color: var(--red); }
.badge.conservation { background: #1a2a3a; color: var(--cool); }

nav {
    display: flex;
    gap: 0;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}

.tab {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 10px 20px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

main { padding: 20px; }

.view { display: none; }
.view.active { display: block; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.card h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

/* Mesh node card */
.node-card { position: relative; }

.node-card .node-id {
    font-size: 11px;
    color: var(--text-dim);
    word-break: break-all;
}

.node-card .node-model {
    color: var(--accent);
    font-weight: 500;
}

.node-card .node-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-dim);
}

.node-card .node-stats span { color: var(--text); font-weight: 500; }

.node-card .last-seen {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
}

/* Status indicator */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.online { background: var(--green); }
.status-dot.offline { background: var(--red); }
.status-dot.stale { background: var(--warm); }

/* Family cards */
.family-card { cursor: pointer; transition: border-color 0.15s; }
.family-card:hover { border-color: var(--accent); }

.family-card .maturity-label {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    background: var(--border);
    color: var(--text-dim);
}

.family-card .stats-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-dim);
}

.family-card .stats-row span { color: var(--text); }

/* Claims panel */
.claims-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
}

.claim-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.claim-item:last-child { border-bottom: none; }

.claim-item .confidence {
    display: inline-block;
    min-width: 36px;
    text-align: right;
    margin-right: 8px;
    font-weight: 600;
}

/* Ontology */
#ontology-controls {
    margin-bottom: 12px;
    display: flex;
    gap: 4px;
}

#ontology-controls button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 4px 12px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 11px;
    border-radius: var(--radius);
}

#ontology-controls button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

#ontology-viz {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 500px;
    overflow: hidden;
    position: relative;
}

#ontology-viz svg { width: 100%; height: 100%; }

/* Tree view */
.tree-node {
    font-size: 11px;
    cursor: pointer;
}

.tree-node circle { stroke-width: 1.5px; }
.tree-node text { fill: var(--text); }

.tree-link {
    fill: none;
    stroke: var(--border);
    stroke-width: 1px;
}

/* Graph view */
.graph-node circle { stroke: var(--bg); stroke-width: 1.5px; }
.graph-node text { font-size: 10px; fill: var(--text-dim); }
.graph-link { stroke: var(--border); stroke-opacity: 0.6; }
.graph-link.cross-domain { stroke: var(--accent); stroke-dasharray: 4 2; }

/* Sources table */
.source-table {
    width: 100%;
    border-collapse: collapse;
}

.source-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.source-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

/* Proposals */
.proposal-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.proposal-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

/* Heat colors */
.heat-hot { color: var(--hot); }
.heat-warm { color: var(--warm); }
.heat-cool { color: var(--cool); }
.heat-cold { color: var(--cold); }

/* Cost breakdown */
.cost-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.cost-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

/* Section titles */
.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 12px;
    margin-top: 20px;
}

.section-title:first-child { margin-top: 0; }

/* Responsive */
@media (max-width: 768px) {
    .card-grid { grid-template-columns: 1fr; }
    header { flex-direction: column; gap: 8px; }
}
