:root {
  --news-bg-top:  #070914;
  --news-bg-mid:  #161c29;
  --news-panel:   rgba(255, 255, 255, 0.06);
  --news-text:    #f6f7fb;
  --news-muted:   rgba(246, 247, 251, 0.72);
  --news-line:    rgba(255, 255, 255, 0.12);
  --news-red:     #d53d2f;
  --news-orange:  #df651a;
  --news-amber:   #c0a42d;
  --news-teal:    #1f8e90;
}

/* ── Screen-reader only ────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Shell ─────────────────────────────────────────────────────────────── */
.news-tab-container {
  width: 100%;
  max-width: 100%;
}

/* ── Live bar ──────────────────────────────────────────────────────────── */
.news-live-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--news-line);
  font-size: 13px;
  color: var(--news-muted);
}

.news-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--news-teal);
  flex-shrink: 0;
  animation: nd-pulse 2s ease-in-out infinite;
}

@keyframes nd-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(31, 142, 144, 0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(31, 142, 144, 0);   }
}

.news-live-status {
  flex: 1;
  color: var(--news-muted);
}

.news-refresh-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--news-line);
  border-radius: 999px;
  min-width: 36px;
  min-height: 36px;
  font-size: 16px;
  color: var(--news-text);
  cursor: pointer;
  transition: background 150ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.news-refresh-btn:hover { background: rgba(255, 255, 255, 0.13); }
.news-refresh-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

/* ── Controls bar ──────────────────────────────────────────────────────── */
.news-controls {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px 0;
  background: linear-gradient(to bottom, var(--news-bg-top) 80%, transparent);
}

.news-search-wrapper { position: relative; }

.news-search-input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--news-line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--news-text);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.news-search-input::placeholder { color: var(--news-muted); }

.news-search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.09);
}

.news-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.news-filter {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--news-line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--news-text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
}

.news-filter:hover { background: rgba(255, 255, 255, 0.11); }
.news-filter.active { background: white; color: black; border-color: white; }
.news-filter:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

/* ── Error ─────────────────────────────────────────────────────────────── */
.news-error {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(213, 61, 47, 0.14);
  border: 1px solid rgba(213, 61, 47, 0.28);
  color: #ff9999;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ── Hero card ─────────────────────────────────────────────────────────── */
.news-hero-card {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 28px 28px 22px;
  border-radius: 18px;
  background: var(--news-panel);
  border: 1px solid var(--news-line);
  backdrop-filter: blur(20px);
  box-sizing: border-box;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.news-hero-card:hover { background: rgba(255, 255, 255, 0.09); }
.news-hero-card:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

.news-hero-card[data-severity="critical"] {
  border-left: 4px solid var(--news-red);
  box-shadow: inset 6px 0 32px rgba(213, 61,  47, 0.1), 0 0 40px rgba(213, 61, 47, 0.06);
}
.news-hero-card[data-severity="high"] {
  border-left: 4px solid var(--news-orange);
  box-shadow: inset 6px 0 32px rgba(223, 101, 26, 0.1), 0 0 40px rgba(223, 101, 26, 0.06);
}
.news-hero-card[data-severity="elevated"] {
  border-left: 4px solid var(--news-amber);
  box-shadow: inset 6px 0 32px rgba(192, 164, 45, 0.1), 0 0 40px rgba(192, 164, 45, 0.06);
}
.news-hero-card[data-severity="moderate"] {
  border-left: 4px solid var(--news-teal);
  box-shadow: inset 6px 0 32px rgba(31,  142, 144, 0.1), 0 0 40px rgba(31,  142, 144, 0.06);
}

.news-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.news-hero-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(246, 247, 251, 0.45);
}

.news-hero-title {
  margin: 0 0 10px;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--news-text);
  line-height: 1.28;
}

.news-hero-summary {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--news-muted);
}

/* ── Headline feed ─────────────────────────────────────────────────────── */
.news-headline-feed {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.news-headline-card {
  display: block;
  width: 100%;
  padding: 18px 20px 14px;
  border-radius: 14px;
  background: var(--news-panel);
  border: 1px solid var(--news-line);
  backdrop-filter: blur(14px);
  box-sizing: border-box;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.news-headline-card:hover { background: rgba(255, 255, 255, 0.09); }
.news-headline-card:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

.news-headline-card[data-severity="critical"] { border-left: 3px solid var(--news-red);    box-shadow: inset 3px 0 18px rgba(213, 61,  47, 0.08); }
.news-headline-card[data-severity="high"]     { border-left: 3px solid var(--news-orange);  box-shadow: inset 3px 0 18px rgba(223, 101, 26, 0.08); }
.news-headline-card[data-severity="elevated"] { border-left: 3px solid var(--news-amber);   box-shadow: inset 3px 0 18px rgba(192, 164, 45, 0.08); }
.news-headline-card[data-severity="moderate"] { border-left: 3px solid var(--news-teal);    box-shadow: inset 3px 0 18px rgba(31,  142, 144, 0.08); }

.news-headline-title {
  margin: 8px 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--news-text);
  line-height: 1.35;
}

.news-headline-summary {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--news-muted);
}

/* ── Shared card pieces ────────────────────────────────────────────────── */
.news-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.news-severity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.news-severity-badge.severity-critical { background: rgba(213,  61,  47, 0.2); color: #ff9999; }
.news-severity-badge.severity-high     { background: rgba(223, 101,  26, 0.2); color: #ffb366; }
.news-severity-badge.severity-elevated { background: rgba(192, 164,  45, 0.2); color: #ffd966; }
.news-severity-badge.severity-moderate { background: rgba(31,  142, 144, 0.2); color: #66d9db; }

.news-card-location {
  margin: 0 0 8px;
  font-size: 12px;
  color: rgba(246, 247, 251, 0.5);
  letter-spacing: 0.04em;
}

.news-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(246, 247, 251, 0.5);
}

.news-card-time   { flex-shrink: 0; }
.news-card-source { flex-shrink: 0; }

.news-source-link {
  color: rgba(246, 247, 251, 0.55);
  text-decoration: none;
  transition: color 150ms ease;
}
.news-source-link:hover        { color: var(--news-text); }
.news-source-link:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; border-radius: 3px; }

/* ── Load more / meta ──────────────────────────────────────────────────── */
.news-load-more-btn {
  display: block;
  width: 100%;
  margin: 8px 0 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--news-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--news-text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 150ms ease;
}

.news-load-more-btn:hover { background: rgba(255, 255, 255, 0.09); }
.news-load-more-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

.news-meta {
  text-align: center;
  font-size: 12px;
  color: rgba(246, 247, 251, 0.35);
  margin: 0 0 24px;
}

.news-empty {
  text-align: center;
  padding: 48px 16px;
  font-size: 14px;
  color: var(--news-muted);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .news-hero-card    { padding: 20px 16px 16px; }
  .news-headline-card { padding: 14px 14px 12px; }
  .news-controls { position: relative; }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .news-live-dot { animation: none; }
}
