:root {
  --bg: #0e1113;
  --panel: #14191d;
  --panel-2: #1b2228;
  --text: #edf2f7;
  --muted: #95a3ae;
  --border: rgba(255,255,255,0.08);
  --accent: #d97706;
  --accent-2: #378167;
  --danger: #dc2626;
  --warning: #d97706;
  --neutral: #64748b;
  --legacy: #7c3aed;
  --ok: #16a34a;
  --shadow: 0 10px 28px rgba(0,0,0,0.28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(180deg, #0e1113 0%, #10161a 100%);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}
.subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted);
  max-width: 900px;
}

.layout {
  padding: 1.5rem 2rem 2rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.metric-card, .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.metric-card {
  padding: 1rem 1.1rem;
}
.metric-card.wide { min-width: 0; }
.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}
.metric-card strong {
  font-size: 1.8rem;
  font-weight: 800;
}
.metric-card small {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
input, select, .btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font: inherit;
}
input[type="search"] {
  min-width: 280px;
}
.btn {
  cursor: pointer;
}
.btn.primary {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(217, 119, 6, 0.12);
}
.btn.primary:hover { background: rgba(217, 119, 6, 0.18); }
.toolbar-meta { color: var(--muted); }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.95fr);
  gap: 1rem;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0;
}
.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.muted { color: var(--muted); font-size: 0.85rem; }
.skills-grid {
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.skill-card {
  width: 100%;
  text-align: left;
  background: var(--panel-2);
  color: inherit;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 1rem;
  cursor: pointer;
  transition: 0.18s ease;
}
.skill-card:hover,
.skill-card.selected {
  transform: translateY(-1px);
  border-color: rgba(217,119,6,0.35);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}
.skill-card-top {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}
.skill-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.skill-meta-line,
.skill-description,
.skill-evidence {
  color: var(--muted);
}
.skill-description {
  margin: 0.85rem 0;
  line-height: 1.45;
  min-height: 3.2em;
}
.skill-tags {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.tag,
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid transparent;
}
.tag {
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  border-color: rgba(255,255,255,0.05);
}
.tag.strong { color: #fbbf24; border-color: rgba(251,191,36,0.25); }
.skill-evidence { margin-top: 0.8rem; font-size: 0.82rem; }

.status-active { background: rgba(22,163,74,0.12); color: #86efac; border-color: rgba(22,163,74,0.28); }
.status-installed-inactive { background: rgba(59,130,246,0.12); color: #93c5fd; border-color: rgba(59,130,246,0.25); }
.status-disabled { background: rgba(220,38,38,0.12); color: #fca5a5; border-color: rgba(220,38,38,0.24); }
.status-legacy { background: rgba(124,58,237,0.12); color: #c4b5fd; border-color: rgba(124,58,237,0.24); }
.status-unknown { background: rgba(100,116,139,0.12); color: #cbd5e1; border-color: rgba(100,116,139,0.24); }

.sticky-panel {
  position: sticky;
  top: 1rem;
}
.detail-card {
  padding: 1rem 1.1rem 1.2rem;
}
.detail-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.detail-title-row h3 {
  margin: 0;
  font-size: 1.2rem;
}
.detail-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
}
.detail-section {
  border-top: 1px solid var(--border);
  padding-top: 0.95rem;
  margin-top: 0.95rem;
}
.detail-section h4 {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  color: #f8fafc;
}
.detail-section p,
.detail-section li,
.detail-section ul {
  color: #dbe4ea;
}
.detail-section ul {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.5;
}
.detail-section.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
code {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 0.08rem 0.35rem;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  word-break: break-all;
}
.empty-state {
  color: var(--muted);
  padding: 2rem;
  text-align: center;
}

/* ─── Evidence badges (V2) ─── */
.skill-evidence-line {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.evidence-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.69rem;
  padding: 0.2rem 0.55rem;
  cursor: default;
}
.evidence-badge.has-evidence {
  background: rgba(59,130,246,0.1);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,0.2);
}
.evidence-badge.memory-evidence {
  background: rgba(168,85,247,0.1);
  color: #c4b5fd;
  border: 1px solid rgba(168,85,247,0.2);
}
.evidence-badge.cron-evidence {
  background: rgba(245,158,11,0.1);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,0.2);
}

/* ─── Runtime source note (V2) ─── */
.runtime-note {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-top: 0.35rem;
}
.runtime-note.config-source {
  background: rgba(22,163,74,0.08);
  color: #86efac;
  border: 1px solid rgba(22,163,74,0.2);
}
.runtime-note.disabled-source {
  background: rgba(220,38,38,0.08);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,0.2);
}

/* ─── Mention grid (V2) ─── */
.mention-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.mention-day {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

/* ─── ClawHub feed panel (V2) ─── */
.clawhub-panel {
  margin-top: 1rem;
}
.clawhub-entries {
  padding: 0 1.1rem 0.5rem;
}
.clawhub-entry {
  background: var(--panel-2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.clawhub-entry:last-child { margin-bottom: 0; }
.clawhub-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.clawhub-entry-head strong {
  font-size: 0.95rem;
}
.clawhub-score {
  font-size: 0.75rem;
}
.clawhub-entry-desc {
  color: var(--muted);
  margin: 0.5rem 0;
  line-height: 1.4;
}
.clawhub-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}
.clawhub-link:hover { text-decoration: underline; }
.clawhub-reason {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: #dbe4ea;
  background: rgba(217,119,6,0.06);
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
}
.clawhub-summary {
  padding: 0 1.1rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
}

@media (max-width: 780px) {
  .topbar, .layout { padding-left: 1rem; padding-right: 1rem; }
  .topbar { flex-direction: column; }
  .hero-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .detail-section.two-col { grid-template-columns: 1fr; }
  input[type="search"] { min-width: 0; width: 100%; }
  .filters { width: 100%; }
  .filters > * { flex: 1 1 220px; }
}
