:root {
  --bg: #0A0C10;
  --surface: #12151C;
  --surface-raised: #171B24;
  --border: #232833;
  --text: #E6E9EF;
  --text-muted: #7A8699;
  --text-dim: #4B5566;

  --accent-brand: #00D9A3;
  --critical: #FF4757;
  --high: #FFA34D;
  --medium: #4DA6FF;
  --low: #5C6577;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  height: 100%;
}

:focus-visible {
  outline: 2px solid var(--accent-brand);
  outline-offset: 2px;
}

/* ---------- Status bar ---------- */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.statusbar__left { display: flex; align-items: center; gap: 0.6rem; }

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-brand);
  box-shadow: 0 0 0 0 rgba(0, 217, 163, 0.6);
  animation: pulse 2s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 217, 163, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 217, 163, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 217, 163, 0); }
}

.statusbar__brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  color: var(--text);
}

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

.statusbar__right { display: flex; align-items: center; gap: 0.6rem; color: var(--text-muted); }
.statusbar__divider { color: var(--text-dim); }
.statusbar__clock { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 49px);
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ---------- Sidebar ---------- */

.sidebar {
  border-right: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar__title {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 0 0 0.6rem 0;
}

.filter-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-group--col { flex-direction: column; align-items: flex-start; }

.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

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

.chip--critical.active { background: rgba(255,71,87,0.12); border-color: var(--critical); color: var(--critical); }
.chip--high.active { background: rgba(255,163,77,0.12); border-color: var(--high); color: var(--high); }
.chip--medium.active { background: rgba(77,166,255,0.12); border-color: var(--medium); color: var(--medium); }
.chip--low.active { background: rgba(92,101,119,0.2); border-color: var(--low); color: var(--text); }

.source-chip {
  width: 100%;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.4rem 0.5rem;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.source-chip:hover { color: var(--text); background: var(--surface-raised); }
.source-chip.active { color: var(--accent-brand); background: rgba(0,217,163,0.08); border-color: rgba(0,217,163,0.3); }

.search-input {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

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

.sidebar__counts {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.count-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  color: var(--text-muted);
}

.count-row span:first-child { flex: 1; }
.count-row span:last-child { color: var(--text); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot--critical { background: var(--critical); }
.dot--high { background: var(--high); }

/* ---------- Feed ---------- */

.feed { padding: 1.5rem 2rem 3rem; }

.feed__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.feed__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

.refresh-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}

.refresh-btn:hover { color: var(--text); border-color: var(--text-dim); }

.feed__list { display: flex; flex-direction: column; gap: 1px; }

.article {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border-left: 3px solid var(--low);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}

.article:hover { background: var(--surface-raised); }
.article + .article { margin-top: 2px; }

.article--critical { border-left-color: var(--critical); }
.article--high { border-left-color: var(--high); }
.article--medium { border-left-color: var(--medium); }
.article--low { border-left-color: var(--low); }

.article__meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

.article__body { min-width: 0; }

.article__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.3rem 0;
  color: var(--text);
}

.article__summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  height: fit-content;
  white-space: nowrap;
}

.article__tag--critical { background: rgba(255,71,87,0.14); color: var(--critical); }
.article__tag--high { background: rgba(255,163,77,0.14); color: var(--high); }
.article__tag--medium { background: rgba(77,166,255,0.14); color: var(--medium); }
.article__tag--low { background: rgba(92,101,119,0.2); color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.empty-state__hint { color: var(--text-dim); font-size: 0.75rem; margin-top: 0.4rem; }

@media (max-width: 640px) {
  .article { grid-template-columns: 1fr; }
  .article__tag { justify-self: start; }
}
