:root {
    /* Oxide-inspired palette — green-tinted darks, green accent */
    --bg: #080f11;
    --surface: #101618;
    --surface-2: #181a1d;
    --surface-hover: #1f2124;
    --border: #0000000a;
    --border-hover: #0000001a;
    --border-strong: #00000029;

    --text: #e7e7e8;
    --text-dim: #7e8385;
    --text-faint: #5d5e61;

    --accent: #00d497;
    --accent-bright: #37e6a8;
    --accent-dark: #008a6c;
    --accent-glow: rgba(0, 212, 151, 0.10);

    --inductive: #8199fe;
    --inductive-bg: rgba(129, 153, 254, 0.08);
    --deductive: #c58cff;
    --deductive-bg: rgba(197, 140, 255, 0.08);
    --explicit: #7e8385;
    --explicit-bg: rgba(126, 131, 133, 0.08);

    --high: #00d497;
    --medium: #f3ba68;

    --radius: 4px;
    --radius-sm: 3px;
    --transition: 150ms ease;
}

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

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    background-image: radial-gradient(ellipse 60% 40% at 50% -10%, rgba(0, 212, 151, 0.025), transparent);
    -webkit-font-smoothing: antialiased;
}

/* ── Topbar ──────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    height: 56px;
    background: rgba(8, 15, 17, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-mark {
    color: var(--accent);
    font-size: 18px;
    text-shadow: 0 0 12px var(--accent-glow);
}

.brand-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--text);
}

.search-box {
    flex: 1;
    max-width: 460px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

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

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.topbar-right {
    width: 90px;
    text-align: right;
}

.badge-prototype {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    opacity: 0.6;
}

/* ── Layout ──────────────────────────── */

.layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    padding: 24px 20px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    max-height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
}

.content {
    flex: 1;
    padding: 32px 40px;
    max-width: 900px;
}

/* ── Sidebar ─────────────────────────── */

.sidebar-section { margin-bottom: 28px; }

.section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-bottom: 10px;
}

/* Peer tabs */
.peer-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    padding: 3px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.peer-tab {
    flex: 1;
    padding: 7px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.peer-tab:hover { color: var(--text); }

.peer-tab.active {
    background: var(--surface-hover);
    color: var(--accent-bright);
    box-shadow: 0 0 0 1px var(--border-hover);
}

/* Filter pills — sharper */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    padding: 5px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.pill:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #080f11;
    font-weight: 500;
}

.pill.pill-explicit.active { background: var(--explicit); border-color: var(--explicit); }
.pill.pill-inductive.active { background: var(--inductive); border-color: var(--inductive); }
.pill.pill-deductive.active { background: var(--deductive); border-color: var(--deductive); }

/* Stats grid */
.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.stat-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    margin-top: 2px;
}

/* Peer card */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 320px;
    overflow-y: auto;
}

.card-entry {
    padding: 6px 10px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--border-hover);
}

.card-cat {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    margin-right: 6px;
}

.card-text {
    font-size: 12px;
    color: var(--text-dim);
}

/* ── Content ─────────────────────────── */

.content-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.content-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.content-title h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.content-subtitle {
    font-size: 13px;
    color: var(--accent);
}

.content-count {
    font-size: 14px;
    color: var(--text-dim);
}

.content-count span {
    color: var(--text-faint);
    font-size: 12px;
}

/* Layer sections */
.layer-section { margin-bottom: 32px; }

.layer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.layer-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

.layer-explicit { background: var(--explicit-bg); color: var(--explicit); }
.layer-inductive { background: var(--inductive-bg); color: var(--inductive); }
.layer-deductive { background: var(--deductive-bg); color: var(--deductive); }

.layer-count {
    font-size: 12px;
    color: var(--text-faint);
}

/* Observation cards */
.obs-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 6px;
    transition: border-color var(--transition), background var(--transition);
}

.obs-card:hover {
    border-color: var(--border-hover);
    background: var(--surface-2);
}

.obs-card.layer-explicit { border-left: 3px solid var(--explicit); }
.obs-card.layer-inductive { border-left: 3px solid var(--inductive); }
.obs-card.layer-deductive { border-left: 3px solid var(--deductive); }

.obs-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.confidence {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.confidence-high { color: var(--high); background: rgba(0, 212, 151, 0.10); }
.confidence-medium { color: var(--medium); background: rgba(243, 186, 104, 0.10); }

.obs-category {
    font-size: 11px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.obs-time {
    font-size: 11px;
    color: var(--text-faint);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.obs-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

/* Sources / Premises */
details {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--text-dim);
    user-select: none;
    transition: color var(--transition);
    list-style: none;
}

summary::-webkit-details-marker { display: none; }
summary::before { content: '▸ '; font-size: 10px; }
details[open] summary::before { content: '▾ '; }

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

.source-line {
    font-size: 12px;
    color: var(--text-dim);
    padding: 5px 0 5px 14px;
    border-left: 2px solid var(--border);
    margin-top: 6px;
    line-height: 1.5;
}

/* Empty state */
.empty-state {
    text-align: center;
    color: var(--text-faint);
    padding: 80px 20px;
    font-size: 14px;
}

.empty-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

::selection {
    background: var(--accent-glow);
    color: var(--accent-bright);
}

/* HTMX loading state */
.htmx-request .content { opacity: 0.5; transition: opacity 200ms; }
