:root {
  --bg: #07121f;
  --bg-soft: rgba(13, 27, 44, 0.76);
  --panel: rgba(9, 23, 39, 0.88);
  --panel-border: rgba(146, 182, 224, 0.12);
  --text: #eef6ff;
  --text-soft: #9ab4cf;
  --headline: #ffffff;
  --primary: #58d6c9;
  --primary-strong: #1da59b;
  --secondary: #ff7b54;
  --accent: #ffd166;
  --success: #5dd39e;
  --danger: #ff7272;
  --neutral: #91a7c0;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-soft: rgba(255, 255, 255, 0.8);
  --panel: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(15, 38, 60, 0.08);
  --text: #182637;
  --text-soft: #64748b;
  --headline: #081321;
  --primary: #137f7b;
  --primary-strong: #0f6764;
  --secondary: #de5d33;
  --accent: #c38b15;
  --success: #0f9d68;
  --danger: #c93d4a;
  --neutral: #62748d;
  --shadow: 0 24px 70px rgba(17, 35, 61, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  direction: rtl;
  text-align: right;
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(88, 214, 201, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(255, 123, 84, 0.16), transparent 28%),
    var(--bg);
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  position: relative;
  overflow: hidden;
}

.page-glow {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(72px);
  pointer-events: none;
  opacity: 0.35;
  z-index: 0;
}

.page-glow-one {
  top: -8rem;
  right: -8rem;
  background: rgba(88, 214, 201, 0.32);
}

.page-glow-two {
  bottom: -12rem;
  left: -8rem;
  background: rgba(255, 123, 84, 0.2);
}

.app-main,
.footer-shell {
  position: relative;
  z-index: 1;
}

.topbar {
  position: relative;
  z-index: 50;
  padding: 1.25rem 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--bg-soft);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brandmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brandmark-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.brandmark-title {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--headline);
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topnav-dropdown {
  position: relative;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-weight: 700;
  transition: 0.2s ease;
}

.topnav-trigger::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-inline-end: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.topnav-link:hover,
.topnav-link:focus-visible,
.topnav-dropdown:focus-within .topnav-trigger,
.topnav-dropdown:hover .topnav-trigger,
.topnav-link.is-active {
  color: var(--headline);
  background: rgba(88, 214, 201, 0.14);
}

.topnav-menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  z-index: 500;
  min-width: 13rem;
  padding: 0.55rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--panel) 92%, var(--bg) 8%);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.35rem);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.topnav-dropdown:focus-within .topnav-menu,
.topnav-dropdown:hover .topnav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.topnav-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.topnav-menu-link:hover,
.topnav-menu-link:focus-visible {
  background: rgba(88, 214, 201, 0.12);
  color: var(--headline);
}

.theme-toggle {
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--headline);
  font-weight: 700;
}

.app-main {
  padding: 1rem 0 3rem;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 1.5rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.compact-hero {
  grid-template-columns: minmax(0, 1fr) auto;
}

.hero-copy h1,
.section-heading h2,
.detail-title,
.error-panel h1 {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  color: var(--headline);
}

.hero-copy h1 {
    font-size: clamp(1.2rem, 2vw, 2.2rem);
    line-height: 1.4;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

.hero-copy p,
.muted-copy,
.metric-detail,
.article-summary,
.detail-summary,
.detail-story p,
.footer-copy {
  color: var(--text-soft);
}

.panel-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary);
  font-weight: 800;
}

.hero-filters,
.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
}

.glass-control {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  min-height: 3.2rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--headline);
}

.glass-control:focus {
  border-color: rgba(88, 214, 201, 0.6);
  box-shadow: 0 0 0 0.25rem rgba(88, 214, 201, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--headline);
}

html[data-theme="light"] .glass-control {
  background: rgba(15, 35, 61, 0.03);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-neo {
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #06121f;
  font-weight: 800;
}

.btn-soft {
  border-radius: 999px;
  border-color: var(--panel-border);
  color: var(--headline);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.75fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.home-hero-wide {
  grid-template-columns: minmax(0, 1fr);
}

.home-hero-wide .home-hero-panel {
  display: none;
}

.home-hero-slider {
  position: relative;
  min-height: 27rem;
  overflow: hidden;
}

.home-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  min-height: 27rem;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-1.25rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.home-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.home-slide-empty {
  position: relative;
  background:
    linear-gradient(135deg, rgba(88, 214, 201, 0.2), rgba(255, 123, 84, 0.14)),
    var(--panel);
}

.home-slide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-slide.is-missing .home-slide-image {
  display: none;
}

.home-slide.is-missing {
  background:
    linear-gradient(135deg, rgba(88, 214, 201, 0.2), rgba(255, 123, 84, 0.14)),
    var(--panel);
}

.home-slide-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 18, 31, 0.2), rgba(7, 18, 31, 0.74) 55%, rgba(7, 18, 31, 0.92)),
    linear-gradient(0deg, rgba(7, 18, 31, 0.88), rgba(7, 18, 31, 0.12) 70%);
}

.home-slide-content {
  position: relative;
  z-index: 1;
  max-width: 58rem;
}

.home-slide-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: rgba(238, 246, 255, 0.8);
  font-weight: 700;
}

.home-slide h1 {
  margin: 0 0 1rem;
  color: var(--headline);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 2.15rem;
  line-height: 1.45;
}

.home-slide p {
  max-width: 40rem;
  margin: 0 0 1.35rem;
  color: rgba(238, 246, 255, 0.82);
  font-size: 1.04rem;
  line-height: 1.9;
}

.home-slider-controls {
  position: absolute;
  right: 1.25rem;
  left: 1.25rem;
  bottom: 1.15rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.home-slider-button,
.home-slider-dot {
  pointer-events: auto;
}

.home-slider-button {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(238, 246, 255, 0.22);
  border-radius: 999px;
  background: rgba(7, 18, 31, 0.64);
  color: var(--headline);
  font-size: 1.8rem;
  line-height: 1;
}

.home-slider-button:hover,
.home-slider-button:focus-visible {
  border-color: rgba(88, 214, 201, 0.56);
  background: rgba(88, 214, 201, 0.18);
}

.home-slider-dots {
  display: flex;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(238, 246, 255, 0.12);
  border-radius: 999px;
  background: rgba(7, 18, 31, 0.58);
}

.home-slider-dot {
  width: 0.65rem;
  height: 0.65rem;
  border: 0;
  border-radius: 999px;
  background: rgba(238, 246, 255, 0.45);
}

.home-slider-dot.is-active {
  width: 1.75rem;
  background: var(--primary);
}

.home-hero-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.5rem;
}

.home-hero-panel h2 {
  margin: 0;
  color: var(--headline);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 1.55rem;
  line-height: 1.5;
}

.home-hero-panel .filter-grid {
  grid-template-columns: 1fr;
}

.home-quick-links {
  display: grid;
  gap: 0.6rem;
  margin-top: auto;
}

.home-quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-weight: 800;
}

.home-quick-link:hover,
.home-quick-link:focus-visible {
  border-color: rgba(88, 214, 201, 0.35);
  background: rgba(88, 214, 201, 0.12);
  color: var(--headline);
}

.home-quick-link strong {
  color: var(--primary);
}

.homepage-intel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.homepage-intel-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 13rem;
  padding: 1.2rem;
}

.homepage-intel-card h3 {
  margin: 0;
  color: var(--headline);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 1.1rem;
  line-height: 1.5;
}

.homepage-intel-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.8;
}

.homepage-digest-card {
  grid-column: span 2;
}

.homepage-alert-card {
  background: linear-gradient(180deg, rgba(255, 123, 84, 0.13), transparent), var(--panel);
}

.digest-bullet-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-inline-start: 1.2rem;
  color: var(--text-soft);
  line-height: 1.65;
}

.mini-line-chart,
.analytics-line-chart {
  width: 100%;
  overflow: visible;
}

.mini-line-chart {
  height: 4.6rem;
}

.mini-line-chart line,
.analytics-line-chart line {
  stroke: rgba(238, 246, 255, 0.13);
  stroke-width: 1;
}

.mini-line-chart polyline,
.analytics-line-chart polyline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 12px rgba(88, 214, 201, 0.36));
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  padding: 1.45rem;
}

.metric-card.accent-ai {
  background: linear-gradient(180deg, rgba(88, 214, 201, 0.15), transparent), var(--panel);
}

.metric-card.accent-robotics {
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.15), transparent), var(--panel);
}

.metric-card.accent-politics {
  background: linear-gradient(180deg, rgba(255, 123, 84, 0.14), transparent), var(--panel);
}

.metric-card.accent-all {
  background: linear-gradient(180deg, rgba(145, 167, 192, 0.12), transparent), var(--panel);
}

.metric-label {
  color: var(--text-soft);
  font-weight: 700;
}

.metric-value {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--headline);
}

.content-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 320px;
  gap: 1.5rem;
}

.content-grid-simple {
  grid-template-columns: 250px minmax(0, 1fr);
}

.section-panel,
.rail-panel,
.sidebar-panel,
.detail-panel {
  padding: 1.5rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-caption,
.filter-stat,
.article-source,
.table-link,
.detail-source,
.detail-date {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.sidebar-list,
.topic-stack,
.sentiment-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sidebar-link,
.topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  transition: 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: rgba(88, 214, 201, 0.14);
  color: var(--headline);
}

.sidebar-count {
  font-weight: 800;
}

.category-strip {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  overflow-x: auto;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  scrollbar-width: thin;
}

.category-strip-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.category-strip-link:hover,
.category-strip-link:focus-visible,
.category-strip-link.is-active {
  color: var(--headline);
  border-color: rgba(88, 214, 201, 0.28);
  background: rgba(88, 214, 201, 0.14);
}

.category-strip-count {
  min-width: 1.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--headline);
  font-size: 0.82rem;
}

.search-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
}

.search-summary h2 {
  margin: 0.2rem 0 0.35rem;
  color: var(--headline);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 1.35rem;
}

.search-summary p {
  margin: 0;
}

.search-summary-tools,
.search-term-list,
.search-suggestion-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.search-summary-tools {
  justify-content: flex-end;
}

.search-suggestion,
.search-clear-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--headline);
  font-weight: 800;
}

.search-suggestion {
  background: rgba(88, 214, 201, 0.1);
}

.search-clear-link {
  color: var(--text-soft);
}

.search-suggestion:hover,
.search-suggestion:focus-visible,
.search-clear-link:hover,
.search-clear-link:focus-visible {
  border-color: rgba(88, 214, 201, 0.38);
  background: rgba(88, 214, 201, 0.16);
  color: var(--headline);
}

.news-list-shell .article-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spotlight-grid,
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(88, 214, 201, 0.35);
}

.article-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(88, 214, 201, 0.12), rgba(255, 123, 84, 0.1));
}

.article-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.25rem;
}

.article-meta,
.detail-meta,
.keyword-row,
.sentiment-row,
.sentiment-row-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.category-badge,
.sentiment-badge,
.keyword-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.category-badge {
  color: #08121e;
}

.category-ai { background: #58d6c9; }
.category-robotics { background: #ffd166; }
.category-politics { background: #ff7b54; }
.category-technology { background: #8db4ff; }
.category-business { background: #97d65d; }
.category-science { background: #bfa6ff; }
.category-world { background: #ff9b9b; }
.category-health { background: #4dd9b0; }
.category-sports { background: #78c9ff; }
.category-entertainment { background: #ff9ad2; }

.sentiment-positive,
.status-success {
  background: rgba(93, 211, 158, 0.14);
  color: var(--success);
}

.sentiment-neutral {
  background: rgba(145, 167, 192, 0.15);
  color: var(--neutral);
}

.sentiment-negative,
.status-failed {
  background: rgba(255, 114, 114, 0.14);
  color: var(--danger);
}

.sentiment-pending,
.status-skipped {
  background: rgba(255, 209, 102, 0.12);
  color: var(--accent);
}

.status-partial {
  background: rgba(255, 123, 84, 0.16);
  color: var(--secondary);
}

.article-title {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: 1.2rem;
}

.article-title a:hover {
  color: var(--primary);
}

.keyword-pill {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
}

.article-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}

.importance-meter {
  display: flex;
  flex-direction: column;
  align-items: end;
}

.importance-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
}

.importance-score,
.impact-number {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  color: var(--headline);
}

.topic-row,
.sentiment-row {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.sentiment-orb {
  width: 170px;
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 1rem auto;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  color: var(--headline);
  background: var(--sentiment-background, conic-gradient(var(--success) 0 33%, var(--neutral) 33% 66%, var(--danger) 66% 100%));
  position: relative;
}

.sentiment-orb::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--panel);
}

.sentiment-orb span {
  position: relative;
  z-index: 1;
}

.sentiment-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
}

.detail-shell {
  display: grid;
  gap: 1.5rem;
}

.detail-summary {
  font-size: 1.1rem;
  margin-top: 0.75rem;
}

.detail-image-wrap {
  position: relative;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(88, 214, 201, 0.12), rgba(255, 123, 84, 0.1));
}

.detail-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-card-media.is-missing,
.detail-image-wrap.is-missing {
  display: grid;
  place-items: center;
  border: 1px dashed var(--panel-border);
}

.detail-image-wrap.is-missing {
  min-height: 16rem;
}

.article-card-media.is-missing img,
.detail-image-wrap.is-missing img {
  display: none;
}

.article-card-media.is-missing::after,
.detail-image-wrap.is-missing::after {
  content: attr(data-image-fallback);
  padding: 1rem;
  color: var(--text-soft);
  font-weight: 800;
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 280px;
  gap: 1.25rem;
  margin-top: 1rem;
}

.detail-rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-rail-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.04);
}

.admin-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 360px;
  gap: 1.5rem;
}

.impact-number {
  font-size: 2.4rem;
}

.impact-number span {
  font-size: 1rem;
  color: var(--text-soft);
}

.table-shell {
  overflow-x: auto;
}

.app-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--panel-border);
  margin-bottom: 0;
}

.message-cell {
  max-width: 340px;
  color: var(--text-soft);
}

.source-name {
  font-weight: 800;
  color: var(--headline);
}

.editor-form,
.form-stack,
.stack-actions {
  display: flex;
  flex-direction: column;
}

.form-stack {
  gap: 1rem;
}

.textarea-control {
  min-height: 8rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 700;
}

.stack-actions {
  gap: 0.75rem;
  margin-top: 1rem;
}

.action-stack-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

/* AI Providers admin console */
.ai-provider-admin {
  --ai-bg: #0f1117;
  --ai-card: #161b27;
  --ai-card-soft: #121722;
  --ai-border: #2a2f3d;
  --ai-border-soft: rgba(42, 47, 61, 0.72);
  --ai-primary: #3b82f6;
  --ai-label: #6b7280;
  --ai-text: #e5e7eb;
  --ai-muted: #9ca3af;
  --ai-danger: #ef4444;
  --ai-success: #22c55e;
  margin: -0.25rem 0 2rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid rgba(42, 47, 61, 0.8);
  border-radius: 18px;
  background:
    radial-gradient(circle at 84% 4%, rgba(59, 130, 246, 0.14), transparent 28rem),
    linear-gradient(180deg, rgba(22, 27, 39, 0.96), rgba(15, 17, 23, 0.98)),
    var(--ai-bg);
  color: var(--ai-text);
  font-family: "DM Sans", "IBM Plex Sans Arabic", "Cairo", sans-serif;
  text-align: right;
}

.ai-provider-admin a {
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.ai-provider-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  color: var(--ai-label);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-breadcrumb a:hover {
  color: var(--ai-primary);
}

.ai-provider-header h1 {
  margin: 0.12rem 0 0.55rem;
  color: #f9fafb;
  font-size: clamp(2rem, 4vw, 3.3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.ai-provider-header p {
  max-width: 44rem;
  margin: 0;
  color: var(--ai-muted);
  line-height: 1.75;
}

.ai-admin-back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: rgba(22, 27, 39, 0.72);
  color: var(--ai-text);
  font-weight: 800;
}

.ai-admin-back:hover {
  border-color: rgba(59, 130, 246, 0.65);
  color: #fff;
  background: rgba(59, 130, 246, 0.12);
}

.ai-provider-shell {
  display: grid;
  grid-template-columns: minmax(18rem, 21rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.ai-provider-sidebar,
.ai-provider-main,
.ai-provider-form {
  display: grid;
  gap: 1.5rem;
}

.ai-sidebar-card,
.ai-code-card,
.ai-priority-card,
.ai-test-result,
.ai-form-section {
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: rgba(22, 27, 39, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.ai-sidebar-card,
.ai-code-card,
.ai-priority-card,
.ai-test-result {
  padding: 1rem;
}

.ai-sidebar-heading,
.ai-card-title,
.ai-code-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ai-sidebar-heading span,
.ai-card-title span,
.ai-code-card-header span,
.ai-test-result span,
.ai-provider-admin .panel-eyebrow,
.ai-provider-admin .field-label {
  color: var(--ai-label);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-sidebar-heading strong,
.ai-code-card-header strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--ai-text);
  font-size: 0.9rem;
}

.ai-sidebar-heading a {
  color: var(--ai-primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.ai-provider-nav {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.ai-provider-nav-item {
  padding: 0.75rem;
  border: 1px solid var(--ai-border-soft);
  border-radius: 8px;
  background: rgba(18, 23, 34, 0.76);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.ai-provider-nav-item:hover,
.ai-provider-nav-item.is-active {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.58);
  background: rgba(59, 130, 246, 0.08);
}

.ai-provider-nav-item > a {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.ai-provider-avatar {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(99, 102, 241, 0.16)),
    rgba(255, 255, 255, 0.04);
  color: #dbeafe;
  font: 800 0.86rem "JetBrains Mono", monospace;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.14);
}

.ai-provider-nav-item strong,
.ai-priority-row strong {
  display: block;
  color: #f9fafb;
  font-size: 0.96rem;
  line-height: 1.35;
}

.ai-provider-nav-item small,
.ai-provider-nav-meta,
.ai-priority-row small,
.ai-card-title small,
.ai-form-section-head p,
.ai-form-actions p {
  color: var(--ai-muted);
  font-size: 0.8rem;
}

.ai-provider-nav-item em,
.ai-priority-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.8rem;
  border: 1px solid var(--ai-border);
  border-radius: 999px;
  color: #bfdbfe;
  font: 800 0.78rem "JetBrains Mono", monospace;
  font-style: normal;
}

.ai-provider-nav-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.ai-provider-nav-item form {
  margin: 0.75rem 0 0;
}

.ai-provider-nav-item form button {
  width: 100%;
  min-height: 2.2rem;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: transparent;
  color: var(--ai-muted);
  font-weight: 800;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.ai-provider-nav-item form button:hover {
  border-color: rgba(59, 130, 246, 0.58);
  color: var(--ai-text);
  background: rgba(59, 130, 246, 0.09);
}

.ai-code-card pre {
  margin: 1rem 0 0;
  padding: 0.95rem;
  overflow-x: auto;
  border: 1px solid rgba(42, 47, 61, 0.9);
  border-radius: 8px;
  background: #0b0e14;
  color: #c7d2fe;
  font: 500 0.78rem/1.7 "JetBrains Mono", monospace;
}

.ai-card-title h2,
.ai-form-section-head h2 {
  margin: 0.22rem 0 0;
  color: #f9fafb;
  font-size: 1.1rem;
  font-weight: 800;
}

.ai-card-title small {
  max-width: 24rem;
  line-height: 1.65;
}

.ai-priority-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.ai-priority-row {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1.35fr) minmax(8rem, 0.72fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(18, 23, 34, 0.72);
}

.ai-priority-row:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.08);
}

.ai-priority-name,
.ai-priority-model {
  min-width: 0;
}

.ai-priority-name small,
.ai-priority-model {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ai-priority-model {
  color: var(--ai-text);
  font: 700 0.82rem "JetBrains Mono", monospace;
}

.ai-priority-api {
  color: var(--ai-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.ai-test-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.ai-test-result.is-success {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.ai-test-result.is-error {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.08);
}

.ai-test-result strong,
.ai-test-result small {
  display: block;
  margin-top: 0.2rem;
}

.ai-test-result code,
.ai-provider-admin code,
.ai-provider-admin .is-code {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.ai-form-section {
  padding: 1.25rem;
}

.ai-form-section-head {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.ai-form-section-head > span {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(59, 130, 246, 0.42);
  border-radius: 8px;
  color: #bfdbfe;
  font: 800 0.76rem "JetBrains Mono", monospace;
  background: rgba(59, 130, 246, 0.11);
}

.ai-form-section-head p {
  max-width: 46rem;
  margin: 0.35rem 0 0;
  line-height: 1.7;
}

.ai-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.ai-field {
  min-width: 0;
}

.ai-field-wide-md {
  grid-column: span 2;
}

.ai-field-full {
  grid-column: 1 / -1;
}

.ai-provider-admin .field-label {
  display: block;
  margin-bottom: 0.55rem;
}

.ai-provider-admin .form-control,
.ai-provider-admin .form-select {
  min-height: 3rem;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background-color: #111827;
  color: var(--ai-text);
  font-size: 0.98rem;
  font-weight: 650;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ai-provider-admin .form-control::placeholder {
  color: rgba(156, 163, 175, 0.58);
}

.ai-provider-admin .form-control:focus,
.ai-provider-admin .form-select:focus,
.ai-provider-admin .form-check-input:focus {
  border-color: var(--ai-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.78);
  background-color: #111827;
  color: var(--ai-text);
}

.ai-provider-admin .textarea-control {
  min-height: 8.5rem;
  resize: vertical;
}

.ai-provider-admin .code-editor-control {
  min-height: 13rem;
  padding: 1rem;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 50%, transparent 50%) 0 0 / 100% 3.2rem,
    #0b0e14;
  color: #dbeafe;
  font: 500 0.9rem/1.8 "JetBrains Mono", Consolas, monospace;
}

.priority-stepper {
  max-width: 8rem;
  text-align: center;
}

.ai-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.ai-provider-admin .checkbox-row {
  min-height: 3rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: rgba(18, 23, 34, 0.72);
  color: var(--ai-text);
}

.ai-provider-admin .form-check-input {
  float: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border-color: var(--ai-border);
  background-color: #111827;
}

.ai-provider-admin .form-check-input:checked {
  background-color: var(--ai-primary);
  border-color: var(--ai-primary);
}

.ai-form-actions {
  display: grid;
  gap: 0.85rem;
}

.ai-save-button {
  width: 100%;
  min-height: 3.25rem;
  border: 0;
  border-radius: 8px;
  background: #3b82f6;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 0 0 rgba(59, 130, 246, 0);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ai-save-button:hover,
.ai-save-button:focus-visible {
  transform: translateY(-1px);
  background: #4f8ff7;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.32);
}

.ai-save-button svg {
  width: 1.12rem;
  height: 1.12rem;
  margin-inline-end: 0.5rem;
}

.ai-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.ai-form-actions p {
  margin: 0;
  text-align: center;
}

.ai-empty-card {
  padding: 1rem;
  border: 1px dashed var(--ai-border);
  border-radius: 8px;
  color: var(--ai-muted);
  text-align: center;
}

.ai-provider-admin .text-danger {
  display: block;
  margin-top: 0.45rem;
  color: #fca5a5 !important;
  font-size: 0.82rem;
}

.ai-provider-admin .muted-copy {
  color: var(--ai-muted);
}

@media (max-width: 1199px) {
  .ai-provider-shell {
    grid-template-columns: 1fr;
  }

  .ai-provider-sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.45fr);
  }
}

@media (max-width: 991px) {
  .ai-provider-header {
    flex-direction: column;
  }

  .ai-admin-back {
    width: 100%;
  }

  .ai-provider-sidebar,
  .ai-field-grid {
    grid-template-columns: 1fr;
  }

  .ai-field-wide-md,
  .ai-field-full {
    grid-column: auto;
  }

  .ai-priority-row {
    grid-template-columns: 2.35rem minmax(0, 1fr) auto;
  }

  .ai-priority-model,
  .ai-priority-api {
    display: none;
  }
}

@media (max-width: 640px) {
  .ai-provider-admin {
    padding: 0.8rem;
    border-radius: 12px;
  }

  .ai-sidebar-heading,
  .ai-card-title,
  .ai-test-result,
  .ai-toggle-grid,
  .ai-secondary-actions {
    grid-template-columns: 1fr;
  }

  .ai-sidebar-heading,
  .ai-card-title,
  .ai-test-result {
    display: grid;
  }

  .ai-form-section {
    padding: 1rem;
  }
}

/* Premium admin operations dashboard */
body[data-page="Admin-Index"] {
  --ops-bg: #080c14;
  --ops-card: #0f1520;
  --ops-card-alt: #161b27;
  --ops-card-alt-2: #1a2030;
  --ops-border: #1e2738;
  --ops-blue: #3b82f6;
  --ops-violet: #8b5cf6;
  --ops-green: #10b981;
  --ops-red: #ef4444;
  --ops-yellow: #f59e0b;
  --ops-text: #f1f5f9;
  --ops-muted: #64748b;
  background:
    radial-gradient(circle at 74% 0%, rgba(59, 130, 246, 0.12), transparent 34rem),
    radial-gradient(circle at 12% 12%, rgba(139, 92, 246, 0.1), transparent 30rem),
    var(--ops-bg);
  color: var(--ops-text);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}

body[data-page="Admin-Index"] .page-shell {
  padding-inline-end: 0;
}

body[data-page="Admin-Index"] .topbar {
  padding: 0.35rem 0;
}

body[data-page="Admin-Index"] .topbar-inner {
  min-height: 48px;
  height: 48px;
  border: 1px solid var(--ops-border);
  border-radius: 0;
  background: rgba(8, 12, 20, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}

body[data-page="Admin-Index"] .topnav,
body[data-page="Admin-Index"] .mobile-nav-toggle {
  display: none !important;
}

body[data-page="Admin-Index"] .brandmark-signal {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
}

body[data-page="Admin-Index"] .brandmark-title {
  font-size: 0.9rem;
}

body[data-page="Admin-Index"] .brandmark-kicker {
  font-size: 0.62rem;
}

body[data-page="Admin-Index"] .command-button,
body[data-page="Admin-Index"] .account-chip,
body[data-page="Admin-Index"] .logout-form .theme-toggle {
  min-height: 2rem;
  border-radius: 8px;
  border-color: var(--ops-border);
  background: rgba(15, 21, 32, 0.78);
  font-size: 0.78rem;
}

body[data-page="Admin-Index"] .account-chip {
  padding: 0.35rem 0.7rem;
}

body[data-page="Admin-Index"] .app-main {
  padding-top: 0.85rem;
  padding-bottom: 100px;
}

.ops-bottom-dock {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 9999;
  width: auto;
  max-width: 480px;
  height: 64px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 20px;
  direction: rtl;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(15, 21, 32, 0.85);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px) saturate(180%);
  transform: translateX(-50%);
  animation: opsDockEnter 400ms cubic-bezier(0.16, 1, 0.3, 1) 300ms both;
  pointer-events: auto;
}

.ops-bottom-dock a {
  position: relative;
  width: 64px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #64748b;
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  pointer-events: auto;
  touch-action: manipulation;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ops-dock-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease;
}

.ops-dock-label {
  max-width: 60px;
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-bottom-dock a::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1e2738;
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0);
  transition: opacity 150ms ease, transform 150ms ease;
}

.ops-bottom-dock a:hover,
.ops-bottom-dock a:focus-visible {
  color: #f1f5f9;
  transform: translateY(-2px);
}

.ops-bottom-dock a:hover::before,
.ops-bottom-dock a:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, -4px);
}

.ops-bottom-dock a:hover .ops-dock-icon,
.ops-bottom-dock a:focus-visible .ops-dock-icon {
  background: rgba(255, 255, 255, 0.06);
}

.ops-bottom-dock a.is-active {
  color: #ffffff;
}

.ops-bottom-dock a.is-active .ops-dock-icon {
  background: rgba(59, 130, 246, 0.15);
}

.ops-bottom-dock a.is-active::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-top: 2px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
}

@keyframes opsDockEnter {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.admin-ops-dashboard {
  display: grid;
  gap: 1rem;
  color: var(--ops-text);
  text-align: right;
}

.admin-ops-dashboard .panel-eyebrow,
.ops-stat-label {
  color: var(--ops-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 40px;
}

.ops-hero-banner {
  min-height: 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--ops-border);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(139, 92, 246, 0.1), transparent 46%),
    var(--ops-card);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

.ops-hero-copy h1 {
  margin: 0.15rem 0 0.35rem;
  color: var(--ops-text);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
}

.ops-hero-copy p {
  max-width: 60rem;
  margin: 0;
  color: #94a3b8;
  line-height: 1.7;
}

.ops-hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(10rem, 1fr));
  gap: 0.75rem;
}

.ops-hero-actions form {
  margin: 0;
}

.ops-cta-button {
  width: 100%;
  min-height: 2.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 10px;
  font-weight: 900;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ops-cta-button.is-primary {
  border: 0;
  background: var(--ops-blue);
  color: #fff;
  box-shadow: 0 0 22px rgba(59, 130, 246, 0.22);
  animation: opsBlueGlow 2.6s ease-in-out infinite;
}

.ops-cta-button.is-secondary {
  border: 1px solid rgba(59, 130, 246, 0.42);
  background: transparent;
  color: var(--ops-text);
}

.ops-cta-button:hover,
.ops-cta-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28), 0 0 24px rgba(59, 130, 246, 0.26);
}

.ops-run-note {
  margin: -0.35rem 0 0;
  color: var(--ops-muted);
}

.ops-metric-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.ops-stat-tile {
  position: relative;
  min-height: 10.5rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--ops-border);
  border-radius: 14px;
  background:
    radial-gradient(circle at 16% 22%, rgba(255, 255, 255, 0.05), transparent 38%),
    var(--ops-card);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ops-stat-tile::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--tile-accent, var(--ops-blue));
}

.ops-stat-tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tile-accent, var(--ops-blue)) 54%, var(--ops-border));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.ops-stat-tile.is-active {
  --tile-accent: var(--ops-green);
}

.ops-stat-tile.is-pending {
  --tile-accent: var(--ops-yellow);
}

.ops-stat-tile.is-analyzed {
  --tile-accent: var(--ops-blue);
}

.ops-stat-tile.is-total {
  --tile-accent: var(--ops-violet);
}

.ops-stat-tile i {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: 1rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--tile-accent) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tile-accent) 42%, transparent);
}

.ops-stat-tile i::after {
  content: "";
  position: absolute;
  inset: 0.72rem;
  border-radius: 50%;
  background: var(--tile-accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tile-accent) 42%, transparent);
}

.ops-stat-value {
  display: block;
  margin: 1.3rem 0 0.55rem;
  color: #fff;
  font: 700 2.5rem/1 "JetBrains Mono", "IBM Plex Sans Arabic", sans-serif;
}

.ops-sparkline {
  display: flex;
  align-items: end;
  gap: 0.35rem;
  height: 2.2rem;
  margin-top: 1rem;
}

.ops-sparkline span {
  flex: 1;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tile-accent) 72%, #fff 8%), rgba(255, 255, 255, 0.08));
  opacity: 0.74;
}

.ops-sparkline span:nth-child(1) { height: 38%; }
.ops-sparkline span:nth-child(2) { height: 62%; }
.ops-sparkline span:nth-child(3) { height: 48%; }
.ops-sparkline span:nth-child(4) { height: 78%; }
.ops-sparkline span:nth-child(5) { height: 56%; }

.ops-bottom-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.72fr) minmax(0, 1.45fr);
  grid-template-areas: "services logs";
  gap: 1rem;
  align-items: start;
}

.ops-services-panel,
.ops-logs-panel {
  border: 1px solid var(--ops-border);
  border-radius: 14px;
  background: var(--ops-card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.ops-services-panel {
  grid-area: services;
  padding: 1rem;
}

.ops-logs-panel {
  grid-area: logs;
  overflow: hidden;
}

.admin-ops-dashboard .ops-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-ops-dashboard .ops-panel-heading h2 {
  margin: 0.18rem 0 0;
  color: var(--ops-text);
  font-size: 1.15rem;
  font-weight: 800;
}

.ops-live-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ops-live-title > span {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: var(--ops-green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.44);
  animation: opsPulse 1.8s ease-out infinite;
}

.ops-service-list {
  display: grid;
  gap: 0.75rem;
}

.ops-service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 4.8rem;
  padding: 0.9rem;
  border: 1px solid var(--ops-border);
  border-radius: 12px;
  background: rgba(22, 27, 39, 0.72);
}

.ops-service-row.is-empty {
  border-style: dashed;
  background: rgba(15, 21, 32, 0.52);
}

.ops-service-row strong {
  display: block;
  color: var(--ops-text);
  font-weight: 800;
}

.ops-service-row small {
  display: block;
  margin-top: 0.3rem;
  color: var(--ops-muted);
}

.ops-service-icon {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 11px;
  font-style: normal;
  font-weight: 900;
}

.ops-service-icon.is-fetch {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.15);
}

.ops-service-icon.is-analysis {
  color: #ddd6fe;
  background: rgba(139, 92, 246, 0.16);
}

.ops-action-group {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.ops-action-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--ops-border);
  border-radius: 10px;
  background: rgba(22, 27, 39, 0.58);
  color: var(--ops-text);
  font-weight: 850;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ops-action-link i {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  font-style: normal;
  font-weight: 900;
}

.ops-action-link.is-sources i {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.15);
}

.ops-action-link.is-ai i {
  color: #ddd6fe;
  background: rgba(139, 92, 246, 0.16);
}

.ops-action-link.is-users i {
  color: #cbd5e1;
  background: rgba(100, 116, 139, 0.18);
}

.ops-action-link:hover,
.ops-action-link:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--action-accent, var(--ops-blue)) 48%, var(--ops-border));
  background: color-mix(in srgb, var(--action-accent, var(--ops-blue)) 14%, transparent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.ops-action-link.is-sources { --action-accent: var(--ops-blue); }
.ops-action-link.is-ai { --action-accent: var(--ops-violet); }
.ops-action-link.is-users { --action-accent: #64748b; }

.ops-log-all-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--ops-border);
  border-radius: 10px;
  color: var(--ops-text);
  font-weight: 800;
}

.ops-log-all-link:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.1);
}

.ops-logs-panel .ops-panel-heading {
  padding: 1rem 1rem 0;
}

.ops-log-terminal {
  max-height: 340px;
  overflow: auto;
  margin: 0 1rem;
  border: 1px solid var(--ops-border);
  border-radius: 12px;
  background: #0a0f19;
  font-family: "JetBrains Mono", "IBM Plex Sans Arabic", monospace;
  scrollbar-width: thin;
  scrollbar-color: var(--ops-blue) #0a0f19;
}

.ops-log-terminal::-webkit-scrollbar {
  width: 9px;
}

.ops-log-terminal::-webkit-scrollbar-track {
  background: #0a0f19;
}

.ops-log-terminal::-webkit-scrollbar-thumb {
  border: 2px solid #0a0f19;
  border-radius: 999px;
  background: var(--ops-blue);
}

.ops-log-row {
  display: grid;
  grid-template-columns: minmax(7.4rem, auto) minmax(0, 1fr) auto minmax(13rem, auto);
  align-items: center;
  gap: 0.8rem;
  min-height: 3.35rem;
  padding: 0.78rem 0.85rem;
  animation: opsLogFade 0.42s ease both;
  animation-delay: calc(var(--row-index, 0) * 50ms);
}

.ops-log-row:nth-child(odd) {
  background: #161b27;
}

.ops-log-row:nth-child(even) {
  background: #1a2030;
}

.ops-log-row time,
.ops-log-counters {
  color: var(--ops-muted);
  font-size: 0.78rem;
}

.ops-log-row strong {
  overflow: hidden;
  color: var(--ops-text);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ops-status-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.ops-status-badge.is-success {
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.14);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.24);
  animation: opsSoftPulse 2.2s ease-in-out infinite;
}

.ops-status-badge.is-failed {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.24), 0 0 20px rgba(239, 68, 68, 0.08);
  animation: opsRedPulse 2.1s ease-in-out infinite;
}

.ops-status-badge.is-failed:hover {
  animation: opsBadgeShake 0.28s ease, opsRedPulse 2.1s ease-in-out infinite;
}

.ops-status-badge.is-warning {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.ops-status-badge.is-running {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.ops-status-badge.is-running i {
  width: 0.78rem;
  height: 0.78rem;
  border: 2px solid currentColor;
  border-block-start-color: transparent;
  border-radius: 50%;
  animation: opsSpin 0.85s linear infinite;
}

.ops-log-empty {
  padding: 2.4rem 1rem;
  color: var(--ops-muted);
  text-align: center;
}

.ops-log-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem 1rem;
}

.ops-log-pagination button {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--ops-border);
  border-radius: 10px;
  background: rgba(22, 27, 39, 0.78);
  color: var(--ops-text);
}

.ops-log-pagination button:disabled {
  opacity: 0.42;
}

.ops-log-pagination span {
  color: var(--ops-muted);
  font: 800 0.82rem "JetBrains Mono", monospace;
}

@keyframes opsBlueGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(59, 130, 246, 0.18); }
  50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.36); }
}

@keyframes opsPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.44); }
  70% { box-shadow: 0 0 0 0.55rem rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes opsSoftPulse {
  0%, 100% { filter: saturate(1); }
  50% { filter: saturate(1.25); }
}

@keyframes opsRedPulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.24), 0 0 12px rgba(239, 68, 68, 0.06); }
  50% { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.34), 0 0 24px rgba(239, 68, 68, 0.16); }
}

@keyframes opsBadgeShake {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-2px); }
  70% { transform: translateX(2px); }
}

@keyframes opsSpin {
  to { transform: rotate(360deg); }
}

@keyframes opsLogFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1199px) {
  .ops-hero-banner,
  .ops-bottom-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logs"
      "services";
  }

  .ops-hero-actions {
    grid-template-columns: 1fr;
  }

  .ops-metric-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  body[data-page="Admin-Index"] .page-shell {
    padding-inline-end: 0;
  }

  .ops-metric-band,
  .ops-log-row {
    grid-template-columns: 1fr;
  }

  .ops-stat-tile {
    min-height: 9.2rem;
  }

  .ops-service-row {
    grid-template-columns: 1fr;
  }

  .ops-service-icon {
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .ops-bottom-dock {
    inset-inline: 0;
    bottom: 0;
    left: auto;
    width: 100%;
    max-width: none;
    height: 64px;
    justify-content: space-around;
    padding: 8px 10px;
    border-radius: 20px 20px 0 0;
    transform: none;
    animation: opsDockEnterMobile 400ms cubic-bezier(0.16, 1, 0.3, 1) 300ms both;
  }

  .ops-bottom-dock a {
    width: 56px;
  }

  .ops-dock-label {
    max-width: 54px;
  }

  @keyframes opsDockEnterMobile {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.table-link {
  display: inline-block;
  margin-top: 0.3rem;
}

.status-banner {
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(93, 211, 158, 0.14);
  color: var(--headline);
}

.status-banner-danger {
  background: rgba(255, 114, 114, 0.12);
  border: 1px solid rgba(255, 114, 114, 0.24);
}

.status-banner-inline {
  margin-top: 1rem;
}

.startup-card {
  padding: 1.25rem;
}

.pagination-shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0.25rem;
}

.pagination-link {
  padding: 0.75rem 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--headline);
}

.pagination-link.is-disabled {
  pointer-events: none;
  opacity: 0.4;
}

.pagination-state {
  color: var(--text-soft);
}

.empty-state {
  padding: 2rem;
  border: 1px dashed var(--panel-border);
  border-radius: var(--radius-md);
  text-align: center;
}

.spotlight-grid .empty-state,
.article-grid .empty-state {
  grid-column: 1 / -1;
}

.footer-shell {
  padding: 0 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
}

.footer-title {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  color: var(--headline);
}

.analysis-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.analysis-badge-success {
  background: rgba(88, 214, 201, 0.16);
  color: var(--primary);
}

.analysis-badge-pending {
  background: rgba(255, 209, 102, 0.12);
  color: var(--accent);
}

.analysis-note,
.analysis-error {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.analysis-note {
  background: rgba(255, 209, 102, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.14);
  color: var(--text-soft);
}

.analysis-error {
  background: rgba(255, 114, 114, 0.09);
  border: 1px solid rgba(255, 114, 114, 0.16);
  color: #ffc1c1;
}

.analysis-status-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.table-link,
code {
  direction: ltr;
  unicode-bidi: isolate;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.logout-form,
.inline-form {
  margin: 0;
}

.account-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(88, 214, 201, 0.08);
}

.account-chip-name {
  color: var(--headline);
  font-weight: 800;
  line-height: 1.1;
}

.account-chip-role {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.identity-shell {
  padding-top: 1rem;
}

.identity-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 1.5rem;
}

.identity-grid-compact {
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 0.9fr);
}

.identity-aside,
.identity-card {
  padding: 1.75rem;
}

.identity-aside h1,
.identity-card h2 {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  color: var(--headline);
}

.identity-aside h1 {
  margin: 0.35rem 0 1rem;
  line-height: 1.5;
  font-size: clamp(1.3rem, 2vw, 2rem);
}

.identity-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.identity-tip,
.security-code-block,
.recovery-code {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.identity-tip {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  margin-top: 1rem;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-check .form-check-input {
  float: none;
  margin: 0;
}

.security-code-block {
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.security-secret,
.security-uri {
  margin-top: 0.45rem;
  color: var(--headline);
  word-break: break-word;
  line-height: 1.8;
}

.recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.recovery-code {
  padding: 0.9rem 1rem;
  text-align: center;
  font-weight: 800;
  color: var(--headline);
  direction: ltr;
}

.authenticator-setup-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.authenticator-qr-card {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.authenticator-qr-image {
  width: min(100%, 220px);
  aspect-ratio: 1;
  padding: 0.75rem;
  border-radius: 20px;
  background: #ffffff;
  object-fit: contain;
}

body[data-page="Security-Index"] {
  --security-bg: #080c14;
  --security-card: #0f1520;
  --security-input: #161b27;
  --security-border: #1e2738;
  --security-border-strong: #2a3347;
  --security-focus: #06b6d4;
  --security-sky: #0ea5e9;
  --security-violet: #8b5cf6;
  --security-success: #10b981;
  --security-text: #f1f5f9;
  --security-muted: #64748b;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, #0d1829 0%, #080c14 58%, #050810 100%);
  background-size: 40px 40px, 40px 40px, auto;
  color: var(--security-text);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}

body[data-page="Security-Index"] .app-main {
  display: grid;
  justify-items: center;
}

.security-setup-shell {
  position: relative;
  width: min(100%, 560px);
  display: grid;
  gap: 1rem;
  padding-block: 1rem 2.5rem;
  text-align: right;
}

.security-reset-corner {
  display: flex;
  justify-content: flex-start;
}

.security-text-action {
  border: 0;
  padding: 0.25rem 0;
  background: transparent;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 800;
  transition: color 0.15s ease, transform 0.15s ease;
}

.security-text-action:hover,
.security-text-action:focus-visible {
  color: var(--security-focus);
  transform: translateY(-1px);
}

.security-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--security-muted);
}

.security-stepper li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.security-stepper li + li::before {
  content: "←";
  margin-inline-end: 0.25rem;
  color: rgba(100, 116, 139, 0.72);
}

.security-stepper span {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 50%;
  background: rgba(22, 27, 39, 0.78);
  color: #94a3b8;
}

.security-stepper .is-active,
.security-stepper .is-complete {
  color: var(--security-text);
}

.security-stepper .is-active span,
.security-stepper .is-complete span {
  border-color: rgba(6, 182, 212, 0.42);
  background: rgba(6, 182, 212, 0.12);
  color: #a5f3fc;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.16);
}

.security-setup-header {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
}

.security-shield {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 0.25rem;
  border: 1px solid rgba(6, 182, 212, 0.24);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 35%, rgba(6, 182, 212, 0.28), transparent 58%),
    rgba(15, 21, 32, 0.88);
  font-size: 1.8rem;
  filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.75));
}

.security-setup-header h1 {
  margin: 0;
  color: var(--security-text);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.35;
}

.security-setup-header p {
  margin: 0;
  color: #94a3b8;
  direction: ltr;
  font-size: 0.9rem;
}

.security-status-banner {
  margin: 0;
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.1);
}

.security-qr-card,
.security-recovery-panel,
.security-tips-card {
  position: relative;
  overflow: hidden;
  padding: 32px;
  border: 1px solid var(--security-border);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.08), transparent 34%),
    var(--security-card);
  box-shadow:
    0 0 0 1px rgba(6, 182, 212, 0.1),
    0 20px 40px rgba(0, 0, 0, 0.4);
}

.security-card-heading {
  display: flex;
  justify-content: center;
  margin-bottom: 1.35rem;
  text-align: center;
}

.security-card-heading h2 {
  margin: 0.15rem 0 0;
  color: var(--security-text);
  font-size: 1.25rem;
  font-weight: 900;
}

.security-qr-shell {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
}

.security-qr-shell > span {
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 800;
}

.security-qr-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 204px;
  height: 204px;
  border-radius: 16px;
}

.security-qr-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #06b6d4, #0ea5e9, #8b5cf6, #06b6d4);
  animation: securityQrSpin 5s linear infinite;
}

.security-qr-frame::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 14px;
  background: var(--security-card);
}

.security-qr-frame .authenticator-qr-image {
  position: relative;
  z-index: 1;
  width: 180px;
  height: 180px;
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  object-fit: contain;
}

.security-app-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 1.5rem;
}

.security-app-pills span {
  padding: 0.38rem 0.62rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(22, 27, 39, 0.82);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.security-verification-form {
  display: grid;
  gap: 1rem;
}

.security-code-field {
  display: grid;
  gap: 0.7rem;
}

.security-field-label {
  color: var(--security-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.security-digit-grid {
  display: grid;
  grid-template-columns: repeat(6, 52px);
  justify-content: center;
  gap: 0.55rem;
}

.security-digit-input {
  width: 52px;
  height: 60px;
  border: 1.5px solid var(--security-border-strong);
  border-radius: 10px;
  background: var(--security-input);
  color: var(--security-text);
  font: 700 24px/1 "JetBrains Mono", monospace;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.security-digit-input:focus {
  outline: 0;
  border-color: var(--security-focus);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.security-verification-form.is-complete .security-digit-input {
  border-color: rgba(16, 185, 129, 0.7);
  animation: securityCodeReady 420ms ease;
}

.security-activate-button,
.security-secondary-button {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.security-activate-button {
  width: 100%;
  background: linear-gradient(135deg, var(--security-sky), var(--security-violet));
}

.security-activate-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.security-activate-button:not(:disabled):hover,
.security-activate-button:not(:disabled):focus-visible,
.security-secondary-button:hover,
.security-secondary-button:focus-visible {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
}

.security-activate-button.is-loading {
  opacity: 0.85;
}

.security-activate-button.is-loading::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-inline-end: 0.5rem;
  vertical-align: -0.16rem;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: securitySpin 0.7s linear infinite;
}

.security-enabled-card {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.security-enabled-card > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(22, 27, 39, 0.72);
}

.security-enabled-card span {
  color: #94a3b8;
}

.security-enabled-card strong {
  color: var(--security-success);
}

.security-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.security-secondary-button {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(22, 27, 39, 0.76);
}

.security-secondary-button.is-primary {
  border-color: rgba(14, 165, 233, 0.32);
  background: rgba(14, 165, 233, 0.18);
}

.security-tips-card {
  padding: 1.1rem;
  background: rgba(15, 21, 32, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.security-tips-card h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  color: var(--security-text);
  font-size: 0.96rem;
  font-weight: 900;
}

.security-tips-card h2 span {
  color: #f59e0b;
  filter: saturate(0.72);
}

.security-tip-list {
  display: grid;
}

.security-tip-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0;
}

.security-tip-row + .security-tip-row {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.security-tip-row span {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: #1e2738;
  color: #94a3b8;
  font: 700 0.78rem/1 "JetBrains Mono", monospace;
}

.security-tip-row p {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.7;
}

.security-recovery-panel {
  padding: 1.2rem;
}

.security-recovery-panel p {
  color: #94a3b8;
}

@keyframes securityQrSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes securitySpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes securityCodeReady {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
    background: rgba(16, 185, 129, 0.16);
  }
}

@media (max-width: 575px) {
  .security-setup-shell {
    width: 100%;
  }

  .security-qr-card,
  .security-recovery-panel,
  .security-tips-card {
    padding: 1rem;
  }

  .security-digit-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.38rem;
  }

  .security-digit-input {
    width: 100%;
    min-width: 0;
    height: 54px;
    font-size: 20px;
  }

  .security-action-row {
    grid-template-columns: 1fr;
  }
}

body[data-page="Admin-Users"] {
  --user-bg: #080c14;
  --user-card: #0f1520;
  --user-input: #161b27;
  --user-alt: #111827;
  --user-border: #1e2738;
  --user-border-strong: #2a3347;
  --user-blue: #3b82f6;
  --user-cyan: #06b6d4;
  --user-green: #10b981;
  --user-red: #ef4444;
  --user-yellow: #f59e0b;
  --user-text: #f1f5f9;
  --user-muted: #64748b;
  background:
    radial-gradient(circle at 72% 0%, rgba(59, 130, 246, 0.13), transparent 34rem),
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.08), transparent 26rem),
    var(--user-bg);
  color: var(--user-text);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}

body[data-page="Admin-Users"] .app-main {
  padding-bottom: 100px;
}

body[data-page="Admin-Users"] .footer-shell {
  padding: 0;
  border-top: 1px solid var(--user-border);
  background: transparent;
}

body[data-page="Admin-Users"] .footer-inner {
  min-height: 48px;
  padding-block: 0.7rem;
  color: var(--user-muted);
  font-size: 11px;
}

body[data-page="Admin-Users"] .footer-title {
  color: var(--user-text);
  font-size: 0.86rem;
}

.user-admin-page {
  display: grid;
  gap: 1rem;
}

.user-admin-header,
.user-form-card,
.user-table-card {
  border: 1px solid var(--user-border);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent 34%),
    var(--user-card);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.user-admin-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
}

.user-admin-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-admin-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(59, 130, 246, 0.32);
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.14);
  box-shadow: 0 0 22px rgba(59, 130, 246, 0.18);
}

.user-admin-breadcrumb {
  color: var(--user-muted);
  font-size: 12px;
  font-weight: 800;
}

.user-admin-heading h1 {
  margin: 0;
  color: var(--user-text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.user-admin-heading p {
  max-width: 28rem;
  margin: 0.1rem 0 0;
  overflow: hidden;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-admin-ghost,
.user-action-button,
.user-secondary-wide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(22, 27, 39, 0.56);
  color: #cbd5e1;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.user-admin-ghost {
  min-height: 32px;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.user-admin-ghost:hover,
.user-admin-ghost:focus-visible,
.user-action-button:hover,
.user-action-button:focus-visible,
.user-secondary-wide:hover,
.user-secondary-wide:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.16);
  color: #ffffff;
}

.user-admin-toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: min(92vw, 26rem);
  padding: 12px 20px;
  border-radius: 10px;
  background: #064e3b;
  border: 1px solid var(--user-green);
  color: #ecfdf5;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, 0);
  animation: userToastIn 260ms ease both;
}

.user-admin-toast.is-error {
  border-color: var(--user-red);
  background: #450a0a;
  color: #fee2e2;
}

.user-admin-toast.is-role {
  border-color: var(--user-blue);
  background: #1e3a5f;
  color: #dbeafe;
}

.user-admin-toast.is-hiding {
  animation: userToastOut 220ms ease both;
}

.user-form-card {
  overflow: hidden;
}

.user-form-toggle {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 0;
  padding: 0.95rem 1.1rem;
  background: transparent;
  color: var(--user-text);
  text-align: right;
}

.user-form-toggle small,
.user-selected-header small {
  display: block;
  color: var(--user-cyan);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.user-form-toggle strong,
.user-selected-header h2 {
  color: var(--user-text);
  font-size: 1.18rem;
  font-weight: 900;
}

.user-form-toggle i {
  min-width: 5.5rem;
  padding: 0.42rem 0.82rem;
  border: 1px solid rgba(59, 130, 246, 0.52);
  border-radius: 10px;
  color: #93c5fd;
  font-style: normal;
  text-align: center;
}

.user-form-card.is-open .user-form-toggle i {
  background: rgba(59, 130, 246, 0.16);
  color: #ffffff;
}

.user-form-body {
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  transition: max-height 0.24s ease, border-color 0.18s ease;
}

.user-form-card.is-open .user-form-body,
.user-form-body.is-visible {
  max-height: 64rem;
  border-top-color: var(--user-border);
}

.user-admin-form {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.1rem 1.1rem;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.user-field {
  display: grid;
  gap: 0.4rem;
}

.user-field .field-label {
  color: var(--user-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-field .glass-control,
.user-search input {
  min-height: 44px;
  border: 1.5px solid var(--user-border-strong);
  border-radius: 8px;
  background: var(--user-input);
  color: var(--user-text);
}

.user-field .glass-control:focus,
.user-search input:focus {
  border-color: var(--user-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.user-mono-input,
.user-email {
  direction: ltr;
  font-family: "JetBrains Mono", monospace;
  unicode-bidi: isolate;
}

.user-password-wrap,
.user-role-select,
.user-search {
  position: relative;
}

.user-password-wrap input {
  padding-inline-start: 2.55rem;
}

.user-password-wrap button {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0.35rem;
  display: grid;
  place-items: center;
  width: 2rem;
  border: 0;
  background: transparent;
  color: #94a3b8;
}

.user-password-wrap button.is-visible,
.user-password-wrap button:hover {
  color: var(--user-blue);
}

.user-password-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.28rem;
  margin-top: 0.1rem;
}

.user-password-strength span {
  height: 0.25rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.user-password-strength[data-score="1"] span:nth-child(1) {
  background: var(--user-red);
}

.user-password-strength[data-score="2"] span:nth-child(-n + 2) {
  background: #f97316;
}

.user-password-strength[data-score="3"] span:nth-child(-n + 3) {
  background: var(--user-yellow);
}

.user-password-strength[data-score="4"] span {
  background: var(--user-green);
}

.user-strength-label {
  color: #94a3b8;
  font-size: 0.75rem;
}

.user-role-select select {
  padding-inline-start: 2.4rem;
}

.user-role-select [data-role-dot] {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 0.9rem;
  z-index: 2;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #94a3b8;
  transform: translateY(-50%);
}

.user-role-select [data-role-dot].is-admin {
  background: var(--user-blue);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.5);
}

.user-form-actions {
  display: flex;
  justify-content: flex-end;
}

.user-primary-button {
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  border: 0;
  border-radius: 10px;
  background: var(--user-blue);
  color: #ffffff;
  font-weight: 900;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.user-primary-button:hover,
.user-primary-button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
}

.user-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 1rem;
}

.user-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.user-selected-header h2 {
  margin: 0.15rem 0 0;
}

.user-detail-strip {
  display: grid;
  gap: 0.5rem;
  padding: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(22, 27, 39, 0.55);
  color: #94a3b8;
  font-size: 0.82rem;
}

.user-secondary-wide {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
}

.user-table-card {
  overflow: hidden;
}

.user-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--user-border);
}

.user-table-title-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.user-table-title-row h2 {
  margin: 0;
  color: var(--user-text);
  font-size: 1.35rem;
  font-weight: 900;
}

.user-table-title-row span {
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  color: #bfdbfe;
  font-size: 0.72rem;
  font-weight: 900;
}

.user-table-header p {
  margin: 0.35rem 0 0;
  color: var(--user-muted);
  font-size: 12px;
  font-style: italic;
}

.user-search {
  min-width: min(100%, 19rem);
  display: flex;
  align-items: center;
}

.user-search span {
  position: absolute;
  inset-inline-end: 0.85rem;
  color: #94a3b8;
}

.user-search input {
  width: 100%;
  padding-inline: 2.25rem 0.9rem;
}

.user-table-shell {
  overflow-x: auto;
}

.user-admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--user-text);
}

.user-admin-table thead tr {
  height: 40px;
  background: var(--user-input);
}

.user-admin-table th {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--user-border);
  color: var(--user-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.user-admin-table tbody tr {
  height: 64px;
  background: var(--user-card);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

.user-admin-table tbody tr:nth-child(odd) {
  background: var(--user-alt);
}

.user-admin-table tbody tr:hover {
  background: var(--user-input);
}

.user-admin-table td {
  padding: 0.75rem 0.9rem;
  vertical-align: middle;
}

.user-person-cell {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.user-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--avatar-a), var(--avatar-b));
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.user-person-cell strong {
  display: block;
  color: var(--user-text);
  font-size: 0.92rem;
}

.user-person-cell small {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #94a3b8;
  font-size: 0.78rem;
}

.user-person-cell b {
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.14);
  color: #67e8f9;
  font-size: 0.68rem;
}

.user-email {
  color: #94a3b8;
  font-size: 13px;
}

.user-role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.18rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.user-role-pill.is-admin {
  border: 1px solid #2563eb;
  background: #1e3a5f;
  color: #60a5fa;
}

.user-role-pill.is-user {
  border: 1px solid #374151;
  background: #1e2738;
  color: #94a3b8;
}

.user-2fa,
.user-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 12px;
  font-weight: 900;
}

.user-2fa.is-enabled {
  color: var(--user-green);
}

.user-2fa.is-disabled {
  color: #64748b;
}

.user-state::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #64748b;
}

.user-state.is-active {
  color: var(--user-green);
}

.user-state.is-active::before {
  background: var(--user-green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.36);
  animation: userPulse 1.6s ease infinite;
}

.user-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.user-action-button {
  min-height: 30px;
  padding: 0.28rem 0.72rem;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.75rem;
}

.user-action-button.is-edit {
  border-color: rgba(59, 130, 246, 0.42);
  color: #93c5fd;
}

.user-action-button.is-edit:hover,
.user-action-button.is-edit:focus-visible {
  background: var(--user-blue);
}

.user-empty-row td {
  padding: 1.2rem;
  border: 1px dashed rgba(148, 163, 184, 0.26);
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

.user-empty-row:hover {
  background: transparent !important;
}

@keyframes userPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.36);
  }

  100% {
    box-shadow: 0 0 0 0.55rem rgba(16, 185, 129, 0);
  }
}

@keyframes userToastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 18px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes userToastOut {
  to {
    opacity: 0;
    transform: translate(-50%, 18px);
  }
}

@media (max-width: 991px) {
  .user-admin-header,
  .user-table-header,
  .user-selected-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-edit-grid,
  .user-form-grid {
    grid-template-columns: 1fr;
  }

  .user-search {
    width: 100%;
  }
}

@media (max-width: 575px) {
  .user-admin-page {
    gap: 0.75rem;
  }

  .user-admin-header,
  .user-form-toggle,
  .user-admin-form,
  .user-table-header {
    padding-inline: 0.85rem;
  }

  .user-form-toggle {
    align-items: flex-start;
    flex-direction: column;
  }
}

.authenticator-manual-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.intelligence-hero {
  align-items: center;
  margin-bottom: 1.5rem;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.analytics-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-card {
  padding: 1.5rem;
}

.analytics-card h2,
.narrative-card h2,
.digest-story-card h2,
.source-comparison-card h3 {
  margin: 0;
  color: var(--headline);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  line-height: 1.5;
}

.analytics-card-wide {
  min-height: 22rem;
}

.line-chart-shell {
  display: grid;
  gap: 0.7rem;
  min-height: 16rem;
  align-content: end;
}

.analytics-line-chart {
  height: 15rem;
  padding: 0.5rem 0;
}

.chart-label-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.7rem, 1fr));
  gap: 0.25rem;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.sentiment-pie {
  --negative: calc(100 - var(--positive) - var(--neutral));
  display: grid;
  place-items: center;
  width: 11rem;
  aspect-ratio: 1;
  margin: 1.25rem auto;
  border-radius: 50%;
  background: conic-gradient(
    var(--success) 0 calc(var(--positive) * 1%),
    var(--neutral) calc(var(--positive) * 1%) calc((var(--positive) + var(--neutral)) * 1%),
    var(--danger) calc((var(--positive) + var(--neutral)) * 1%) 100%
  );
  position: relative;
}

.sentiment-pie::after {
  content: "";
  position: absolute;
  inset: 1rem;
  border-radius: 50%;
  background: var(--panel);
}

.sentiment-pie span {
  position: relative;
  z-index: 1;
  color: var(--headline);
  font-weight: 900;
}

.analysis-stack,
.bar-stack,
.source-comparison-list,
.narrative-stack,
.digest-story-grid {
  display: grid;
  gap: 1rem;
}

.analysis-row,
.source-comparison-card,
.growth-card,
.why-card,
.narrative-source,
.narrative-insight-grid > div {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
}

.analysis-row {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
}

.analysis-row span,
.analysis-row small,
.source-comparison-card p,
.narrative-source p,
.narrative-insight-grid p,
.digest-story-card p,
.why-card span {
  color: var(--text-soft);
  line-height: 1.75;
}

.bar-row {
  display: grid;
  gap: 0.45rem;
}

.bar-row-label,
.source-split,
.narrative-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.bar-row-label small,
.source-split {
  color: var(--text-soft);
}

.tone-bar,
.stacked-sentiment-bar,
.growth-meter {
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.tone-bar {
  display: flex;
}

.tone-positive {
  background: var(--success);
}

.tone-negative {
  margin-inline-start: auto;
  background: var(--danger);
}

.source-comparison-card {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.2fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.stacked-sentiment-bar {
  background: linear-gradient(
    90deg,
    var(--success) 0 calc(var(--positive) * 1%),
    var(--neutral) calc(var(--positive) * 1%) calc((var(--positive) + var(--neutral)) * 1%),
    var(--danger) calc((var(--positive) + var(--neutral)) * 1%) 100%
  );
}

.source-split {
  flex-wrap: wrap;
  font-size: 0.84rem;
}

.heatmap-shell {
  display: grid;
  gap: 0.8rem;
}

.heatmap-row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

.heatmap-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(1.8rem, 1fr));
  gap: 0.45rem;
}

.heatmap-cell {
  min-height: 2.1rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(88, 214, 201, 0.16);
  background: color-mix(in srgb, var(--primary) calc(var(--intensity) * 1%), rgba(255, 255, 255, 0.04));
}

.category-growth-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.growth-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
}

.growth-card span,
.growth-card small {
  color: var(--text-soft);
}

.growth-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.intelligence-alert {
  display: grid;
  gap: 0.35rem;
}

.narrative-card {
  display: grid;
  gap: 1.2rem;
  padding: 1.5rem;
}

.confidence-pill {
  display: inline-grid;
  place-items: center;
  min-width: 4rem;
  min-height: 2.4rem;
  border-radius: 999px;
  background: rgba(88, 214, 201, 0.14);
  color: var(--primary);
  font-weight: 900;
}

.narrative-source-grid,
.narrative-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.narrative-insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.narrative-source,
.narrative-insight-grid > div {
  padding: 1rem;
}

.narrative-source span,
.narrative-source small,
.digest-meta-card span,
.digest-meta-card small {
  color: var(--text-soft);
}

.narrative-source h3 {
  margin: 0.4rem 0 0.65rem;
  font-size: 1.05rem;
  color: var(--headline);
}

.digest-meta-card {
  display: grid;
  gap: 0.25rem;
  min-width: 15rem;
  padding: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.digest-story-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.digest-story-card {
  display: grid;
  gap: 1rem;
  padding: 1.35rem;
}

.why-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
}

.digest-note {
  margin-bottom: 1.5rem;
}

@media (max-width: 1199px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-hero-panel .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-quick-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .news-list-shell .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .admin-config-grid {
    grid-template-columns: 1fr;
  }

  .content-rail {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .homepage-intel-grid,
  .category-growth-grid,
  .analytics-grid-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .source-comparison-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  .topbar-inner,
  .hero-panel,
  .compact-hero,
  .home-hero,
  .content-grid,
  .identity-grid,
  .detail-grid,
  .spotlight-grid,
  .article-grid,
    .footer-inner {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar-inner {
    border-radius: 28px;
  }

  .topnav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .topnav-menu {
    right: 50%;
    transform: translate(50%, -0.35rem);
  }

  .topnav-dropdown:focus-within .topnav-menu,
  .topnav-dropdown:hover .topnav-menu {
    transform: translate(50%, 0);
  }

  .metrics-grid,
  .content-rail,
  .homepage-intel-grid,
  .analytics-grid-three,
  .category-growth-grid,
  .narrative-source-grid,
  .narrative-insight-grid,
  .digest-story-grid {
    grid-template-columns: 1fr;
  }

  .homepage-digest-card {
    grid-column: auto;
  }

  .home-slide h1 {
    font-size: 1.7rem;
  }

  .home-quick-links,
  .home-hero-panel .filter-grid {
    grid-template-columns: 1fr;
  }

  .search-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-summary-tools {
    justify-content: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: center;
  }

  .account-chip {
    align-items: center;
  }

  .recovery-grid {
    grid-template-columns: 1fr;
  }

  .authenticator-setup-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .app-main {
    padding-top: 0.5rem;
  }

  .topbar {
    padding-top: 0.85rem;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .home-hero-slider,
  .home-slide {
    min-height: 23rem;
  }

  .home-slide {
    padding: 1.25rem;
  }

  .home-slide h1 {
    font-size: 1.35rem;
  }

  .home-slide p {
    font-size: 0.96rem;
    line-height: 1.75;
  }

  .home-slider-controls {
    right: 0.8rem;
    left: 0.8rem;
    bottom: 0.8rem;
  }

  .news-list-shell .article-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid,
  .hero-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .article-footer,
  .section-heading,
  .pagination-shell {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Premium AI SaaS redesign layer */
:root {
  color-scheme: dark;
  --bg: #020712;
  --bg-deep: #030915;
  --bg-soft: rgba(6, 14, 28, 0.72);
  --panel: rgba(9, 18, 34, 0.72);
  --panel-strong: rgba(11, 22, 41, 0.9);
  --panel-border: rgba(176, 211, 255, 0.16);
  --panel-border-strong: rgba(111, 231, 255, 0.26);
  --text: #edf7ff;
  --text-soft: #9cb1c9;
  --headline: #ffffff;
  --primary: #6ee7f9;
  --primary-strong: #38bdf8;
  --secondary: #a78bfa;
  --accent: #f9c74f;
  --success: #66e3a5;
  --warning: #f6bf5f;
  --danger: #ff6b8a;
  --neutral: #9fb2ca;
  --surface-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025));
  --brand-gradient: linear-gradient(135deg, #6ee7f9 0%, #60a5fa 42%, #a78bfa 74%, #f0abfc 100%);
  --heat-gradient: linear-gradient(135deg, #6ee7f9 0%, #66e3a5 45%, #f9c74f 100%);
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 38px rgba(0, 0, 0, 0.24);
  --shadow-glow: 0 0 0 1px rgba(110, 231, 249, 0.08), 0 22px 70px rgba(56, 189, 248, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --ease-premium: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7faff;
  --bg-deep: #edf4ff;
  --bg-soft: rgba(255, 255, 255, 0.78);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --panel-border: rgba(15, 30, 55, 0.1);
  --panel-border-strong: rgba(14, 116, 144, 0.22);
  --text: #122033;
  --text-soft: #627188;
  --headline: #07111f;
  --shadow: 0 22px 70px rgba(20, 38, 70, 0.12);
  --shadow-soft: 0 12px 34px rgba(20, 38, 70, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Cairo", "Inter", "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.08), transparent 26rem),
    radial-gradient(ellipse at 78% 0%, rgba(110, 231, 249, 0.18), transparent 34rem),
    radial-gradient(ellipse at 12% 8%, rgba(167, 139, 250, 0.12), transparent 30rem),
    linear-gradient(180deg, var(--bg-deep), var(--bg));
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 74%);
}

::selection {
  color: #02101c;
  background: var(--primary);
}

:focus-visible {
  outline: 3px solid rgba(110, 231, 249, 0.62);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  transform: translateY(-150%);
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: var(--headline);
  color: var(--bg);
  font-weight: 900;
  transition: transform 0.2s var(--ease-premium);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  min-height: 100vh;
}

.page-glow {
  display: none;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 42%, rgba(110, 231, 249, 0.045) 48%, transparent 54%),
    linear-gradient(20deg, transparent 0 58%, rgba(249, 199, 79, 0.035) 62%, transparent 70%);
  opacity: 0.9;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 1rem 0;
}

.topbar-inner {
  min-height: 4.8rem;
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(5, 12, 24, 0.74);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(1.25);
  transition: transform 0.25s var(--ease-premium), border-color 0.25s ease, background 0.25s ease;
}

html[data-theme="light"] .topbar-inner {
  background: rgba(255, 255, 255, 0.76);
}

body.is-scrolled .topbar-inner {
  border-color: var(--panel-border-strong);
  background:
    linear-gradient(135deg, rgba(110, 231, 249, 0.08), rgba(167, 139, 250, 0.04)),
    rgba(5, 12, 24, 0.86);
}

.brandmark {
  min-width: max-content;
  flex-direction: row;
  align-items: center;
  gap: 0.8rem;
}

.brandmark-signal {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.75rem;
  background:
    linear-gradient(135deg, rgba(110, 231, 249, 0.92), rgba(167, 139, 250, 0.78)),
    #091426;
  box-shadow: 0 0 34px rgba(110, 231, 249, 0.26);
  position: relative;
  overflow: hidden;
}

.brandmark-signal::before,
.brandmark-signal::after {
  content: "";
  position: absolute;
  background: rgba(2, 7, 18, 0.58);
}

.brandmark-signal::before {
  inset: 0.55rem;
  border-radius: 0.35rem;
}

.brandmark-signal::after {
  inset-inline: 0.62rem;
  bottom: 0.58rem;
  height: 0.24rem;
  border-radius: 999px;
  background: rgba(110, 231, 249, 0.82);
}

.brandmark-copy {
  display: grid;
  gap: 0.18rem;
}

.brandmark-kicker {
  font-family: "Space Grotesk", "Inter", sans-serif;
  color: var(--primary);
  letter-spacing: 0.16em;
}

.brandmark-title,
.hero-copy h1,
.section-heading h2,
.detail-title,
.analytics-card h2,
.narrative-card h2,
.digest-story-card h2,
.identity-aside h1,
.identity-card h2 {
  font-family: "Space Grotesk", "IBM Plex Sans Arabic", "Cairo", sans-serif;
  letter-spacing: 0;
}

.topnav {
  gap: 0.35rem;
}

.topnav-link,
.theme-toggle,
.command-button {
  min-height: 2.75rem;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease-premium), background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.topnav-link:hover,
.topnav-link:focus-visible,
.topnav-dropdown:focus-within .topnav-trigger,
.topnav-dropdown:hover .topnav-trigger,
.topnav-link.is-active {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 249, 0.18);
  background: rgba(110, 231, 249, 0.11);
}

.topnav-link.is-active {
  color: var(--headline);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 249, 0.08);
}

.topnav-menu {
  min-width: 15rem;
  padding: 0.7rem;
  border-color: var(--panel-border-strong);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(7, 16, 31, 0.94);
  backdrop-filter: blur(24px) saturate(1.25);
}

.topnav-menu-link {
  min-height: 2.75rem;
}

.topnav-menu-link::after {
  content: "↗";
  opacity: 0;
  transform: translateX(-0.4rem);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.topnav-menu-link:hover::after,
.topnav-menu-link:focus-visible::after {
  opacity: 0.7;
  transform: translateX(0);
}

.topbar-actions {
  flex-wrap: nowrap;
}

.command-button,
.theme-toggle,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--headline);
  font-weight: 800;
}

.command-button {
  padding: 0.7rem 0.75rem 0.7rem 1rem;
  border-color: rgba(110, 231, 249, 0.16);
}

.command-button kbd {
  min-width: 3.2rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font: 700 0.72rem "Inter", sans-serif;
}

.command-button:hover,
.theme-toggle:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 249, 0.24);
  background: rgba(110, 231, 249, 0.12);
}

.mobile-nav-toggle {
  display: none;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--headline);
}

.mobile-nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0.22rem auto;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s var(--ease-premium), opacity 0.2s ease;
}

body.nav-open .mobile-nav-toggle span:nth-child(1) {
  transform: translateY(0.44rem) rotate(45deg);
}

body.nav-open .mobile-nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .mobile-nav-toggle span:nth-child(3) {
  transform: translateY(-0.44rem) rotate(-45deg);
}

.account-chip {
  border-color: rgba(110, 231, 249, 0.16);
  background: rgba(110, 231, 249, 0.08);
}

.app-main {
  padding-top: 1.35rem;
}

.panel,
.article-card,
.source-comparison-card,
.growth-card,
.why-card,
.narrative-source,
.narrative-insight-grid > div,
.identity-tip,
.security-code-block,
.recovery-code {
  border-color: var(--panel-border);
  background:
    var(--surface-shine),
    var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(1.18);
}

.panel:hover,
.article-card:hover {
  border-color: rgba(110, 231, 249, 0.22);
}

.hero-panel,
.home-hero-slider,
.detail-panel,
.identity-aside {
  position: relative;
  overflow: hidden;
}

.hero-panel::before,
.home-hero-slider::before,
.detail-panel::before,
.identity-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(110, 231, 249, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(249, 199, 79, 0.08), transparent 38%);
  opacity: 0.8;
}

.hero-panel > *,
.home-hero-slider > *,
.detail-panel > *,
.identity-aside > * {
  position: relative;
}

.hero-copy h1 {
  max-width: 62rem;
  font-size: clamp(1.9rem, 4vw, 4rem);
  line-height: 1.12;
}

.hero-copy p {
  max-width: 48rem;
  font-size: 1.02rem;
  line-height: 1.9;
}

.panel-eyebrow {
  font-family: "Space Grotesk", "Cairo", sans-serif;
  color: var(--primary);
}

.btn-neo,
.btn-soft,
.pagination-link,
.search-suggestion,
.search-clear-link {
  min-height: 2.85rem;
  transition: transform 0.18s var(--ease-premium), box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn-neo {
  background: var(--brand-gradient);
  color: #020712;
  box-shadow: 0 14px 30px rgba(56, 189, 248, 0.18);
}

.btn-neo:hover,
.btn-soft:hover,
.pagination-link:hover,
.search-suggestion:hover,
.search-clear-link:hover {
  transform: translateY(-2px);
}

.btn-soft,
.pagination-link,
.search-clear-link {
  background: rgba(255, 255, 255, 0.04);
}

.glass-control,
.form-control,
.form-select {
  border-color: rgba(176, 211, 255, 0.16);
  background-color: rgba(255, 255, 255, 0.055);
  color: var(--headline);
}

.glass-control::placeholder,
.form-control::placeholder {
  color: color-mix(in srgb, var(--text-soft) 72%, transparent);
}

.glass-control:focus,
.form-control:focus,
.form-select:focus {
  border-color: rgba(110, 231, 249, 0.64);
  box-shadow: 0 0 0 0.25rem rgba(110, 231, 249, 0.13), var(--shadow-glow);
}

.home-hero-slider {
  min-height: clamp(31rem, 58vh, 43rem);
  border-radius: var(--radius-xl);
  isolation: isolate;
}

.home-slide {
  min-height: clamp(31rem, 58vh, 43rem);
  padding: clamp(1.35rem, 4vw, 4rem);
}

.home-slide-image {
  transform: scale(1.02);
  filter: saturate(1.08) contrast(1.02);
}

.home-slide-shade {
  background:
    linear-gradient(90deg, rgba(2, 7, 18, 0.12), rgba(2, 7, 18, 0.7) 52%, rgba(2, 7, 18, 0.96)),
    linear-gradient(0deg, rgba(2, 7, 18, 0.92), rgba(2, 7, 18, 0.08) 74%);
}

.home-slide-content {
  max-width: 66rem;
}

.home-slide h1 {
  max-width: 60rem;
  font-family: "Space Grotesk", "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: clamp(2.1rem, 4.8vw, 5.4rem);
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
}

.home-slide p {
  max-width: 46rem;
  font-size: clamp(1rem, 1.35vw, 1.22rem);
}

.home-slide-meta {
  color: rgba(237, 247, 255, 0.78);
}

.hero-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 9rem));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.hero-signal-card {
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(14px);
}

.hero-signal-card span {
  display: block;
  color: rgba(237, 247, 255, 0.68);
  font-size: 0.78rem;
}

.hero-signal-card strong {
  display: block;
  color: var(--headline);
  font: 800 1.35rem "Space Grotesk", "Cairo", sans-serif;
}

.home-slider-button {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.homepage-intel-grid,
.metrics-grid {
  gap: 1.1rem;
}

.homepage-intel-card,
.metric-card,
.analytics-card,
.rail-panel,
.section-panel,
.sidebar-panel {
  position: relative;
  overflow: hidden;
}

.homepage-intel-card::after,
.metric-card::after,
.analytics-card::after {
  content: "";
  position: absolute;
  inset-inline: 1.2rem;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 249, 0.58), transparent);
  opacity: 0.55;
}

.metric-card {
  min-height: 10rem;
  transition: transform 0.18s var(--ease-premium), border-color 0.18s ease;
}

.metric-card:hover,
.homepage-intel-card:hover,
.analytics-card:hover {
  transform: translateY(-3px);
}

.metric-value {
  font-family: "Space Grotesk", "IBM Plex Sans Arabic", "Cairo", sans-serif;
}

.content-grid,
.admin-config-grid,
.detail-grid,
.analytics-grid {
  align-items: start;
}

.content-sidebar {
  position: sticky;
  top: 6.4rem;
}

.sidebar-panel {
  padding: 0.8rem;
}

.sidebar-panel .panel-eyebrow {
  padding: 0.65rem 0.8rem 0.2rem;
}

.sidebar-link,
.topic-row,
.sentiment-row,
.category-strip-link,
.search-suggestion,
.search-clear-link {
  border: 1px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.is-active,
.category-strip-link:hover,
.category-strip-link:focus-visible,
.category-strip-link.is-active {
  border-color: rgba(110, 231, 249, 0.18);
  background: rgba(110, 231, 249, 0.1);
}

.category-strip {
  position: sticky;
  top: 6.2rem;
  z-index: 40;
  backdrop-filter: blur(18px);
}

.article-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: translateZ(0);
}

.article-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(110, 231, 249, 0.12), transparent 34%, rgba(249, 199, 79, 0.06));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.article-card:hover::before {
  opacity: 1;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.article-card-media {
  aspect-ratio: 16 / 10;
}

.article-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(2, 7, 18, 0.56));
  pointer-events: none;
}

.article-card-media img {
  transition: transform 0.45s var(--ease-premium), filter 0.45s ease;
}

.article-card:hover .article-card-media img {
  transform: scale(1.045);
  filter: saturate(1.12) contrast(1.04);
}

.article-card-body {
  position: relative;
  padding: 1.35rem;
}

.article-card-sheen {
  position: absolute;
  inset-inline: 1.2rem;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 249, 0.46), rgba(249, 199, 79, 0.26), transparent);
  opacity: 0.74;
}

.article-title {
  font-size: 1.22rem;
  line-height: 1.55;
  text-wrap: balance;
}

.article-summary {
  line-height: 1.85;
}

.category-badge,
.sentiment-badge,
.keyword-pill,
.status-pill,
.analysis-badge,
.source-badge {
  min-height: 1.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.analysis-badge-success {
  background: rgba(110, 231, 249, 0.12);
  color: var(--primary);
}

.importance-meter {
  min-width: 5.8rem;
  gap: 0.25rem;
}

.importance-track {
  display: block;
  width: 5.2rem;
  height: 0.42rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.importance-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--heat-gradient);
}

.table-shell {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.app-table {
  vertical-align: middle;
}

.app-table thead th {
  color: var(--text-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-table tbody tr {
  transition: background 0.16s ease;
}

.app-table tbody tr:hover {
  background: rgba(110, 231, 249, 0.055);
}

.empty-state {
  background:
    linear-gradient(135deg, rgba(110, 231, 249, 0.07), rgba(167, 139, 250, 0.045)),
    rgba(255, 255, 255, 0.025);
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding: 9vh 1rem 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.command-palette.is-open {
  opacity: 1;
  visibility: visible;
}

body.command-open {
  overflow: hidden;
}

.command-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 5, 12, 0.72);
  backdrop-filter: blur(14px);
}

.command-panel {
  position: relative;
  width: min(100%, 45rem);
  border: 1px solid var(--panel-border-strong);
  border-radius: var(--radius-xl);
  background:
    var(--surface-shine),
    rgba(8, 18, 35, 0.96);
  box-shadow: var(--shadow), var(--shadow-glow);
  padding: 1rem;
  transform: translateY(-0.8rem) scale(0.985);
  transition: transform 0.18s var(--ease-premium);
}

.command-palette.is-open .command-panel {
  transform: translateY(0) scale(1);
}

.command-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  padding: 0.5rem 0.5rem 1rem;
}

.command-panel-header h2 {
  margin: 0.2rem 0 0;
  color: var(--headline);
  font-family: "Space Grotesk", "IBM Plex Sans Arabic", "Cairo", sans-serif;
}

.icon-button {
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--panel-border);
  font-size: 1.4rem;
}

.command-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.command-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.command-links a {
  display: grid;
  place-items: center;
  min-height: 3rem;
  padding: 0.65rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-weight: 800;
  text-align: center;
}

.command-links a:hover,
.command-links a:focus-visible {
  border-color: rgba(110, 231, 249, 0.28);
  background: rgba(110, 231, 249, 0.1);
  color: var(--headline);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease-premium), transform 0.55s var(--ease-premium);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.skeleton-line {
  display: block;
  min-height: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.13), rgba(255,255,255,0.05));
  background-size: 220% 100%;
  animation: skeleton-wave 1.4s ease-in-out infinite;
}

@keyframes skeleton-wave {
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 1199px) {
  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .command-button span {
    display: none;
  }
}

@media (max-width: 991px) {
  .topbar-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    border-radius: var(--radius-xl);
  }

  .mobile-nav-toggle {
    display: inline-block;
    justify-self: end;
  }

  .topnav {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
    justify-content: stretch;
    padding-top: 0.6rem;
  }

  body.nav-open .topnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topnav-link,
  .topnav-trigger {
    justify-content: center;
    width: 100%;
  }

  .topnav-dropdown {
    position: static;
  }

  .topnav-menu {
    position: static;
    display: none;
    min-width: 0;
    margin-top: 0.45rem;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }

  .topnav-dropdown:focus-within .topnav-menu,
  .topnav-dropdown:hover .topnav-menu {
    display: block;
    transform: none;
  }

  .topbar-actions {
    justify-content: end;
    width: auto;
  }

  .account-chip,
  .logout-form {
    display: none;
  }

  .content-sidebar {
    position: static;
  }

  .category-strip {
    top: 5.8rem;
  }

  .command-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .app-main {
    padding-inline: 0.75rem;
  }

  .topbar {
    padding: 0.7rem 0;
  }

  .topbar-inner {
    padding: 0.8rem;
  }

  body.nav-open .topnav {
    grid-template-columns: 1fr;
  }

  .command-button kbd,
  .theme-toggle span {
    display: none;
  }

  .home-hero-slider,
  .home-slide {
    min-height: 31rem;
  }

  .hero-signal-grid {
    grid-template-columns: 1fr;
  }

  .home-slider-controls {
    display: none;
  }

  .command-search,
  .command-links {
    grid-template-columns: 1fr;
  }
}

/* Command-center hero refinement */
.home-command-center {
  grid-template-columns: minmax(0, 1.5fr) minmax(19rem, 0.62fr);
  align-items: stretch;
  gap: 1rem;
}

.home-command-center .home-hero-slider {
  min-height: clamp(25rem, 48vh, 35rem);
  max-height: 42rem;
  border-radius: calc(var(--radius-xl) + 0.35rem);
  background:
    linear-gradient(135deg, rgba(110, 231, 249, 0.08), rgba(167, 139, 250, 0.05)),
    rgba(10, 20, 37, 0.82);
}

.home-command-center .home-slide {
  min-height: inherit;
  padding: 0;
  overflow: hidden;
}

.home-command-center .home-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(110, 231, 249, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 249, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 70%);
}

.home-command-center .home-slide::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 18%;
  z-index: 2;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 249, 0.85), transparent);
  opacity: 0.55;
  animation: intelligence-scan 6.5s ease-in-out infinite;
}

.home-command-center .home-slide-image {
  transform: scale(1.08);
  filter: saturate(1.1) contrast(1.04) brightness(0.88);
}

.home-command-center .home-slide-shade {
  z-index: 1;
  background:
    radial-gradient(circle at 18% 30%, rgba(110, 231, 249, 0.16), transparent 32%),
    linear-gradient(90deg, rgba(2, 7, 18, 0.18), rgba(2, 7, 18, 0.7) 48%, rgba(2, 7, 18, 0.98)),
    linear-gradient(0deg, rgba(2, 7, 18, 0.94), rgba(2, 7, 18, 0.16) 64%, rgba(2, 7, 18, 0.66));
}

.home-slide-system {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline: 1rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  max-width: min(100% - 2rem, 42rem);
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(176, 211, 255, 0.16);
  border-radius: 999px;
  background: rgba(5, 13, 28, 0.58);
  color: rgba(237, 247, 255, 0.74);
  backdrop-filter: blur(18px) saturate(1.15);
  font-size: 0.78rem;
  font-weight: 800;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary);
  font-family: "Inter", "IBM Plex Sans Arabic", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-indicator span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 0 rgba(110, 231, 249, 0.42);
  animation: live-pulse 1.8s ease-out infinite;
}

.home-command-center .home-slide-content {
  align-self: end;
  width: min(100%, 58rem);
  max-width: none;
  padding: clamp(1.4rem, 4.2vw, 3.6rem);
}

.home-command-center .home-slide h1 {
  max-width: 48rem;
  font-size: clamp(2rem, 3.7vw, 4.4rem);
  line-height: 1.1;
}

.home-command-center .home-slide p {
  max-width: 42rem;
  margin-bottom: 1.1rem;
}

.home-command-center .hero-signal-grid {
  grid-template-columns: repeat(3, minmax(0, 8.2rem));
  margin-top: 1rem;
}

.command-briefing-panel {
  min-height: clamp(25rem, 48vh, 35rem);
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(110, 231, 249, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(167, 139, 250, 0.08), transparent 42%),
    rgba(8, 17, 32, 0.76);
}

.briefing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.briefing-header h2 {
  font-size: 1.25rem;
}

.briefing-radar {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 14rem);
  aspect-ratio: 1;
  margin: 0.25rem auto;
  border: 1px solid rgba(110, 231, 249, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(110, 231, 249, 0.16) 0 1px, transparent 2px),
    repeating-radial-gradient(circle, transparent 0 27%, rgba(110, 231, 249, 0.12) 28%, transparent 29%),
    conic-gradient(from 0deg, rgba(110, 231, 249, 0.28), transparent 18%, transparent 100%);
  overflow: hidden;
}

.briefing-radar::before,
.briefing-radar::after {
  content: "";
  position: absolute;
  background: rgba(110, 231, 249, 0.22);
}

.briefing-radar::before {
  width: 1px;
  height: 100%;
}

.briefing-radar::after {
  width: 100%;
  height: 1px;
}

.briefing-radar span {
  position: absolute;
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 18px rgba(110, 231, 249, 0.5);
}

.briefing-radar span:nth-child(1) {
  transform: translate(2.2rem, -1.8rem);
}

.briefing-radar span:nth-child(2) {
  transform: translate(-2.8rem, 1.3rem);
}

.briefing-radar span:nth-child(3) {
  transform: translate(0.4rem, 2.9rem);
  background: var(--secondary);
}

.briefing-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.briefing-metric,
.briefing-topic,
.briefing-sentiment,
.briefing-feed-item {
  border: 1px solid rgba(176, 211, 255, 0.13);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.045);
}

.briefing-metric {
  padding: 0.75rem;
}

.briefing-metric span,
.briefing-topic span,
.briefing-topic small,
.briefing-feed-title,
.briefing-feed-item span {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.briefing-metric strong {
  display: block;
  color: var(--headline);
  font: 800 1.35rem "Space Grotesk", "Cairo", sans-serif;
}

.briefing-topic {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
}

.briefing-topic strong {
  color: var(--headline);
  line-height: 1.45;
}

.briefing-sentiment {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
}

.briefing-sentiment-row {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.4rem 0.8rem;
  align-items: center;
}

.briefing-sentiment-row span,
.briefing-sentiment-row strong {
  font-size: 0.82rem;
}

.briefing-sentiment-row strong {
  justify-self: end;
  color: var(--headline);
}

.briefing-sentiment-row i {
  grid-column: 1 / -1;
  display: block;
  height: 0.28rem;
  border-radius: 999px;
  background: var(--brand-gradient);
}

.briefing-feed {
  display: grid;
  gap: 0.55rem;
}

.briefing-feed-item {
  display: grid;
  gap: 0.22rem;
  padding: 0.7rem 0.8rem;
  color: var(--headline);
}

.briefing-feed-item:hover,
.briefing-feed-item:focus-visible {
  border-color: rgba(110, 231, 249, 0.3);
  background: rgba(110, 231, 249, 0.08);
}

.briefing-feed-item strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.compact-sector-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@keyframes intelligence-scan {
  0%, 100% {
    transform: translateY(-2.4rem);
    opacity: 0.16;
  }

  45% {
    transform: translateY(12rem);
    opacity: 0.58;
  }
}

@keyframes live-pulse {
  70% {
    box-shadow: 0 0 0 0.55rem rgba(110, 231, 249, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(110, 231, 249, 0);
  }
}

@media (max-width: 1199px) {
  .home-command-center {
    grid-template-columns: 1fr;
  }

  .command-briefing-panel {
    min-height: auto;
  }

  .briefing-radar {
    width: min(100%, 11rem);
  }
}

@media (max-width: 767px) {
  .home-command-center .home-hero-slider,
  .home-command-center .home-slide {
    min-height: 28rem;
  }

  .home-slide-system {
    inset-inline: 0.85rem;
    max-width: calc(100% - 1.7rem);
    overflow: hidden;
  }

  .home-slide-system > span:not(.live-indicator) {
    display: none;
  }

  .home-command-center .home-slide-content {
    padding: 1.1rem;
  }

  .home-command-center .home-slide h1 {
    font-size: clamp(1.75rem, 9vw, 2.45rem);
  }

  .home-command-center .home-slide p {
    font-size: 0.92rem;
  }

  .home-command-center .hero-signal-grid,
  .briefing-metric-grid,
  .compact-sector-links {
    grid-template-columns: 1fr;
  }

  .briefing-radar {
    width: 9rem;
  }
}

/* Homepage stability and editorial density */
.home-command-center .home-hero-slider > .home-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.75rem);
  transition: opacity 0.32s ease, transform 0.32s var(--ease-premium);
}

.home-command-center .home-hero-slider > .home-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.home-command-center .home-slider-controls {
  position: absolute;
}

.home-command-center .home-slide-content {
  z-index: 5;
}

.home-command-center .home-slide.is-missing {
  background:
    radial-gradient(circle at 24% 34%, rgba(110, 231, 249, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(16, 34, 58, 0.98), rgba(24, 31, 50, 0.98));
}

.home-command-center .home-slide.is-missing .home-slide-content,
.home-slide-empty .home-slide-content {
  max-width: 47rem;
}

.home-command-center .home-slide.is-missing .home-slide-content::before,
.home-slide-empty .home-slide-content::before {
  content: "GLOBALNEWSAI LIVE BRIEF";
  display: inline-flex;
  margin-bottom: 0.8rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(110, 231, 249, 0.2);
  border-radius: 999px;
  background: rgba(110, 231, 249, 0.08);
  color: var(--primary);
  font: 800 0.72rem "Space Grotesk", "Inter", sans-serif;
  letter-spacing: 0.04em;
}

@media (min-width: 1200px) {
  .home-command-center .home-hero-slider,
  .home-command-center .home-slide {
    min-height: clamp(24rem, 46vh, 34rem);
  }

  .homepage-intel-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: stretch;
  }

  .homepage-intel-card {
    grid-column: span 3;
    min-height: 11rem;
  }

  .homepage-digest-card {
    grid-column: span 5;
  }

  .homepage-alert-card {
    grid-column: span 4;
  }

  .homepage-intel-card .mini-line-chart {
    min-height: 6rem;
  }
}

@media (max-width: 1199px) {
  .homepage-intel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .homepage-digest-card,
  .homepage-alert-card {
    grid-column: auto;
  }
}

@media (max-width: 767px) {
  .homepage-intel-grid {
    grid-template-columns: 1fr;
  }
}

/* Live intelligence homepage */
.live-command-hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.live-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(110, 231, 249, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(167, 139, 250, 0.07), transparent 42%),
    rgba(8, 17, 32, 0.74);
}

.live-hero-header h1 {
  margin: 0.15rem 0 0.25rem;
  color: var(--headline);
  font-family: "Space Grotesk", "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: clamp(1.7rem, 3vw, 3.2rem);
  line-height: 1.12;
}

.live-hero-header p {
  max-width: 48rem;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.8;
}

.live-hero-status {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
  min-width: max-content;
}

.live-hero-status small {
  color: var(--text-soft);
  font-weight: 800;
}

.ops-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.ops-metric-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 7.2rem;
  padding: 1rem;
  overflow: hidden;
}

.ops-metric-card span,
.ops-metric-card small {
  color: var(--text-soft);
  font-weight: 800;
}

.ops-metric-card strong {
  display: block;
  color: var(--headline);
  font: 900 clamp(1.7rem, 3vw, 2.35rem) "Space Grotesk", "Cairo", sans-serif;
}

.ops-metric-card i {
  width: 3.1rem;
  height: 3.1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(110, 231, 249, 0.22), rgba(167, 139, 250, 0.16)),
    rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 22px rgba(110, 231, 249, 0.12);
}

.ops-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 0.82fr) minmax(0, 1.58fr);
  gap: 1rem;
  align-items: start;
}

.ops-side-stack,
.ops-main-stack {
  display: grid;
  gap: 1rem;
}

.ops-panel {
  padding: 1rem;
}

.ops-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  color: var(--headline);
  font-weight: 900;
}

.ops-panel-heading small,
.ops-panel-heading a {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.ops-mini-chart {
  width: 100%;
  min-height: 7rem;
}

.ops-mini-chart line {
  stroke: rgba(176, 211, 255, 0.14);
  stroke-width: 1;
}

.ops-mini-chart polyline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 10px rgba(110, 231, 249, 0.32));
}

.ops-signal-bars {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.ops-signal-bars div {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.4rem 0.8rem;
  align-items: center;
}

.ops-signal-bars span {
  color: var(--text);
  font-weight: 800;
}

.ops-signal-bars strong {
  justify-self: end;
  color: var(--headline);
}

.ops-signal-bars i {
  grid-column: 1 / -1;
  height: 0.28rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.ops-topic-list,
.ops-live-list,
.global-live-list {
  display: grid;
  gap: 0.55rem;
}

.live-list-panel .ops-live-list {
  gap: 0.44rem;
}

.ops-topic-list a,
.ops-live-item,
.global-live-item {
  border: 1px solid rgba(176, 211, 255, 0.12);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.035);
  transition: transform 0.18s var(--ease-premium), border-color 0.18s ease, background 0.18s ease;
}

.ops-topic-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.68rem 0.75rem;
  color: var(--text);
  font-weight: 800;
}

.ops-topic-list strong {
  color: var(--primary);
}

.ops-live-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.15rem 0.65rem;
  padding: 0.7rem 0.75rem;
  color: var(--headline);
}

.live-list-panel .ops-live-item {
  min-height: 4.35rem;
  padding: 0.62rem 0.7rem;
}

.side-brief-panel {
  background:
    linear-gradient(135deg, rgba(110, 231, 249, 0.07), transparent 34%),
    rgba(255, 255, 255, 0.035);
}

.side-brief-list {
  gap: 0.48rem;
}

.side-brief-item {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 3.9rem;
  padding: 0.62rem 0.7rem;
}

.side-brief-item .category-badge {
  grid-row: span 2;
  align-self: start;
  min-width: 3.2rem;
  justify-content: center;
  padding-inline: 0.55rem;
}

.side-brief-item strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.ops-live-dot {
  grid-row: span 2;
  align-self: start;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0.34rem rgba(255, 107, 107, 0.12);
}

.ops-live-item strong,
.global-live-item strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.live-list-panel .ops-live-item strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.ops-live-item small,
.global-live-item small,
.ops-empty-line {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.ops-topic-list a:hover,
.ops-live-item:hover,
.global-live-item:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 249, 0.28);
  background: rgba(110, 231, 249, 0.075);
}

.featured-intel-card {
  position: relative;
  min-height: clamp(28rem, 56vh, 42rem);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 18%, rgba(110, 231, 249, 0.14), transparent 24%),
    linear-gradient(135deg, rgba(15, 30, 52, 0.96), rgba(7, 14, 27, 0.98));
}

.featured-intel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(110, 231, 249, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 249, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 62%);
}

.featured-intel-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.04) brightness(0.88);
}

.emergency-intel-slider {
  isolation: isolate;
}

.emergency-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  min-height: inherit;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.8rem);
  transition: opacity 0.34s ease, transform 0.34s var(--ease-premium);
}

.emergency-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.emergency-slide.is-missing {
  background:
    radial-gradient(circle at 52% 22%, rgba(110, 231, 249, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(10, 24, 45, 0.98), rgba(5, 11, 22, 0.99));
}

.emergency-slide.is-missing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(110, 231, 249, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 249, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.86), transparent 64%);
}

.featured-intel-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(2, 7, 18, 0.97), rgba(2, 7, 18, 0.34) 60%, rgba(2, 7, 18, 0.7)),
    linear-gradient(90deg, rgba(2, 7, 18, 0.15), rgba(2, 7, 18, 0.78));
}

.featured-intel-content,
.featured-empty {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: end;
  min-height: inherit;
  padding: clamp(1.35rem, 4vw, 3rem);
}

.featured-kicker,
.featured-tags,
.featured-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.featured-kicker {
  margin-bottom: 1rem;
}

.featured-intel-content h2,
.featured-empty h2 {
  max-width: 46rem;
  margin: 0 0 1rem;
  color: var(--headline);
  font-family: "Space Grotesk", "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-size: clamp(2rem, 4.2vw, 4.35rem);
  line-height: 1.12;
  text-wrap: balance;
}

.featured-intel-content p,
.featured-empty p {
  max-width: 42rem;
  color: rgba(237, 247, 255, 0.82);
  font-size: 1.02rem;
  line-height: 1.9;
}

.featured-tags {
  margin: 0.2rem 0 1.1rem;
}

.featured-tags span {
  padding: 0.28rem 0.65rem;
  border: 1px solid rgba(176, 211, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.featured-actions span {
  color: var(--text-soft);
  font-weight: 800;
}

.emergency-slider-controls {
  position: absolute;
  inset-inline: 1rem;
  bottom: 1rem;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.emergency-slider-controls .home-slider-button,
.emergency-slider-controls .home-slider-dot {
  pointer-events: auto;
}

.emergency-slider-controls .home-slider-button {
  width: 2.45rem;
  height: 2.45rem;
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(14px);
}

.emergency-slider-controls .home-slider-dots {
  margin-inline: auto;
}

.emergency-intel-slider .featured-intel-content {
  padding-bottom: clamp(5rem, 7vw, 6.25rem);
}

.emergency-intel-slider {
  min-height: clamp(27rem, 50vh, 36rem);
}

.emergency-intel-slider .emergency-slide {
  align-items: center;
}

.emergency-intel-slider .featured-intel-content {
  align-content: center;
  min-height: 100%;
  padding: clamp(2rem, 4vw, 3.25rem) clamp(1.35rem, 4vw, 3rem) clamp(5rem, 7vw, 6rem);
}

.emergency-intel-slider .featured-intel-content h2 {
  max-width: 54rem;
  font-size: clamp(2rem, 3.45vw, 3.65rem);
  line-height: 1.18;
  margin-bottom: 0.75rem;
}

.emergency-intel-slider .featured-intel-content p {
  max-width: 54rem;
  margin-bottom: 0.75rem;
  font-size: clamp(0.94rem, 1.16vw, 1.06rem);
  line-height: 1.72;
}

.emergency-intel-slider .featured-tags {
  margin: 0.15rem 0 0.8rem;
}

.emergency-intel-slider .featured-actions {
  margin-top: 0.1rem;
}

.global-live-panel {
  padding: 1rem;
}

.global-live-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0.2rem 0.75rem;
  align-items: center;
  padding: 0.78rem 0.85rem;
  color: var(--headline);
}

.global-live-item .category-badge {
  grid-row: span 2;
  align-self: start;
}

.homepage-editorial-grid {
  grid-template-columns: minmax(0, 1fr) 15rem;
}

.homepage-editorial-grid .content-main {
  min-width: 0;
}

.homepage-editorial-grid .content-sidebar {
  min-width: 0;
}

@media (max-width: 1199px) {
  .ops-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-dashboard-grid,
  .homepage-editorial-grid {
    grid-template-columns: 1fr;
  }

  .ops-side-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .live-hero-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .live-hero-status {
    justify-items: start;
  }

  .ops-side-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .ops-metric-grid {
    grid-template-columns: 1fr;
  }

  .ops-metric-card {
    min-height: auto;
  }

  .featured-intel-card {
    min-height: 30rem;
  }

  .featured-intel-content h2,
  .featured-empty h2 {
    font-size: clamp(1.7rem, 9vw, 2.6rem);
  }

  .global-live-item {
    grid-template-columns: 1fr;
  }

  .global-live-item .category-badge {
    grid-row: auto;
    width: fit-content;
  }
}

/* Compact homepage rhythm and colored intelligence icons */
.live-command-hero,
.ops-side-stack,
.ops-main-stack,
.global-live-list,
.ops-live-list,
.ops-topic-list {
  gap: 0.72rem;
}

.live-command-hero {
  margin-bottom: 0.9rem;
}

.ops-dashboard-grid {
  gap: 0.72rem;
}

.ops-metric-grid {
  gap: 0.62rem;
}

.ops-metric-card {
  min-height: 6.2rem;
  padding: 0.9rem;
}

.ops-metric-card i {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ops-metric-card i::before,
.ops-metric-card i::after {
  content: "";
  position: absolute;
  border-radius: 0.32rem;
}

.ops-metric-card i::before {
  width: 1.18rem;
  height: 1.18rem;
  border: 2px solid currentColor;
}

.ops-metric-card i::after {
  width: 0.44rem;
  height: 0.44rem;
  background: currentColor;
  box-shadow:
    0.72rem 0 currentColor,
    0 0.72rem currentColor,
    -0.72rem 0 currentColor,
    0 -0.72rem currentColor;
  opacity: 0.42;
}

.ops-metric-card.accent-ai i {
  color: #39e58f;
  background: linear-gradient(135deg, rgba(57, 229, 143, 0.22), rgba(57, 229, 143, 0.08));
}

.ops-metric-card.accent-politics i {
  color: #ff5757;
  background: linear-gradient(135deg, rgba(255, 87, 87, 0.24), rgba(255, 87, 87, 0.08));
}

.ops-metric-card.accent-robotics i {
  color: #a879ff;
  background: linear-gradient(135deg, rgba(168, 121, 255, 0.25), rgba(168, 121, 255, 0.08));
}

.ops-metric-card.accent-all i,
.ops-metric-card:not(.accent-ai):not(.accent-politics):not(.accent-robotics) i {
  color: #4da3ff;
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.25), rgba(77, 163, 255, 0.08));
}

.coverage-lanes {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  padding: 0.82rem 0.95rem;
}

.coverage-lanes-heading {
  display: grid;
  gap: 0.1rem;
}

.coverage-lanes-heading span {
  color: var(--headline);
  font-weight: 900;
}

.coverage-lanes-heading small {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.coverage-lane-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.coverage-lane {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.68rem;
  border: 1px solid rgba(176, 211, 255, 0.12);
  border-radius: 0.9rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.025);
  color: var(--headline);
  font-weight: 900;
}

.coverage-lane::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 16px rgba(110, 231, 249, 0.45);
}

.coverage-lane strong {
  margin-inline-start: auto;
  color: var(--primary);
  font-family: "Space Grotesk", "Cairo", sans-serif;
}

.coverage-lane.category-politics::before,
.coverage-lane.category-world::before {
  background: #ff5757;
  box-shadow: 0 0 16px rgba(255, 87, 87, 0.44);
}

.coverage-lane.category-business::before {
  background: #f6bd3b;
  box-shadow: 0 0 16px rgba(246, 189, 59, 0.42);
}

.coverage-lane.category-ai::before,
.coverage-lane.category-technology::before,
.coverage-lane.category-science::before {
  background: #6ee7f9;
}

.coverage-lane.category-health::before,
.coverage-lane.category-sports::before {
  background: #39e58f;
}

.coverage-lane:hover,
.coverage-lane:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 249, 0.28);
  background: rgba(110, 231, 249, 0.075);
}

.featured-intel-card {
  min-height: clamp(25rem, 49vh, 36rem);
}

.homepage-editorial-grid {
  grid-template-columns: 1fr;
}

.homepage-editorial-grid .section-panel {
  padding: 1.05rem;
}

.homepage-editorial-grid .article-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1199px) {
  .coverage-lanes {
    grid-template-columns: 1fr;
  }

  .coverage-lane-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 767px) {
  .coverage-lane-list,
  .homepage-editorial-grid .article-grid {
    grid-template-columns: 1fr;
  }
}

/* Unified command-center navigation and homepage */
body[data-page="Home-Index"] {
  --home-bg: #080c14;
  --home-card: #0f1520;
  --home-card-hover: #161b27;
  --home-border: #1e2738;
  --home-border-strong: #2a3347;
  --home-blue: #3b82f6;
  --home-red: #ef4444;
  --home-green: #10b981;
  --home-purple: #8b5cf6;
  --home-cyan: #06b6d4;
  --home-amber: #f59e0b;
  --home-text: #f1f5f9;
  --home-muted: #64748b;
  background:
    radial-gradient(circle at 86% 0%, rgba(59, 130, 246, 0.13), transparent 32rem),
    radial-gradient(circle at 10% 14%, rgba(139, 92, 246, 0.1), transparent 28rem),
    var(--home-bg);
  color: var(--home-text);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}

.topbar {
  top: 0;
  z-index: 1000;
  padding: 0;
  border-bottom: 1px solid #1e2738;
  background: rgba(8, 12, 20, 0.92);
  box-shadow: 0 1px 0 #1e2738, 0 4px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px) saturate(180%);
}

.topbar-inner {
  min-height: 60px;
  height: 60px;
  padding-block: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.is-scrolled .topbar-inner {
  background: transparent;
}

.brandmark {
  min-width: 13rem;
  gap: 0.65rem;
  padding-inline-end: 0.2rem;
}

.brandmark-signal {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.32);
}

.brandmark-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.05;
}

.brandmark-kicker {
  color: #60a5fa;
  font-size: 9px;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: #2a3347;
}

.topnav {
  flex: 1 1 auto;
  justify-content: center;
  gap: 0.18rem;
  min-width: 0;
}

.topnav-link,
.topnav-trigger {
  position: relative;
  min-height: 40px;
  padding: 0.52rem 0.86rem;
  border: 0;
  border-radius: 999px;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
  background: transparent;
}

.topnav-link::before,
.topnav-trigger::before {
  content: "";
  position: absolute;
  inset-inline: 0.85rem;
  bottom: 0.16rem;
  height: 2px;
  border-radius: 999px;
  background: var(--home-blue, #3b82f6);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.topnav-link:hover,
.topnav-link:focus-visible,
.topnav-dropdown:focus-within .topnav-trigger,
.topnav-dropdown:hover .topnav-trigger,
.topnav-link.is-active {
  transform: none;
  border-color: transparent;
  background: rgba(59, 130, 246, 0.13);
  color: #ffffff;
}

.topnav-link.is-active::before,
.topnav-dropdown:focus-within .topnav-trigger::before,
.topnav-dropdown:hover .topnav-trigger::before {
  opacity: 1;
  transform: scaleX(1);
}

.topnav-trigger::after {
  margin-inline-start: 0.2rem;
  transform: rotate(45deg) translateY(-2px);
}

.topnav-dropdown {
  position: relative;
}

.topnav-menu {
  inset-block-start: calc(100% + 8px);
  inset-inline-start: 50%;
  inset-inline-end: auto;
  width: min(27rem, calc(100vw - 2rem));
  min-width: 0;
  padding: 20px 24px;
  border: 1px solid #1e2738;
  border-radius: 0 0 12px 12px;
  background: rgba(15, 21, 32, 0.96);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -4px);
}

.topnav-dropdown:focus-within .topnav-menu,
.topnav-dropdown:hover .topnav-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.mega-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.topnav-menu-link {
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  color: #e2e8f0;
}

.topnav-menu-link > span {
  grid-row: 1 / -1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.14);
  font-size: 17px;
}

.topnav-menu-link strong {
  overflow: hidden;
  color: #f1f5f9;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav-menu-link small {
  overflow: hidden;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav-menu-link::after {
  content: none;
}

.topnav-menu-link:hover,
.topnav-menu-link:focus-visible {
  background: #161b27;
  color: #ffffff;
}

.topnav-status {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 28px;
  margin-inline-start: 0.45rem;
  padding: 0.18rem 0.62rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.topnav-status span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.42);
  animation: live-pulse 1.8s ease-out infinite;
}

.topbar-actions {
  gap: 0.45rem;
  flex: 0 0 auto;
}

.command-button {
  width: 160px;
  min-height: 40px;
  justify-content: space-between;
  padding: 0.34rem 0.58rem;
  border: 1px solid #2a3347;
  border-radius: 999px;
  background: #161b27;
  color: #e2e8f0;
  font-size: 0.82rem;
}

.command-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-button kbd {
  min-width: auto;
  padding: 0.12rem 0.42rem;
  font: 800 0.65rem "JetBrains Mono", "Inter", monospace;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 40px;
  padding: 0.22rem 0.44rem;
  border: 1px solid #2a3347;
  border-radius: 999px;
  background: rgba(22, 27, 39, 0.75);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #ffffff;
  font: 900 0.82rem "Inter", sans-serif;
  text-transform: uppercase;
}

.account-chip-name {
  max-width: 6rem;
  overflow: hidden;
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip-role {
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  font-size: 0.58rem;
  font-weight: 900;
}

.account-chevron {
  color: #64748b;
}

.topbar-icon-button,
.topbar-login-link {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #2a3347;
  border-radius: 999px;
  background: transparent;
  color: #cbd5e1;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.topbar-login-link {
  width: auto;
  padding-inline: 0.8rem;
  font-size: 0.76rem;
  font-weight: 900;
}

.topbar-icon-button:hover,
.topbar-icon-button:focus-visible,
.topbar-login-link:hover,
.topbar-login-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.14);
  color: #ffffff;
}

.topbar-logout:hover,
.topbar-logout:focus-visible {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

body[data-page="Home-Index"] .app-main {
  padding-top: 0;
}

.homepage-command-system {
  display: grid;
  gap: 16px;
  margin-inline: calc(50% - 50vw);
  padding-bottom: 1.5rem;
  background: #080c14;
}

.home-stats-ribbon,
.home-category-filter,
.home-editorial-grid {
  padding-inline: max(20px, calc((100vw - 1320px) / 2));
}

.home-stats-ribbon {
  height: 72px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #1e2738;
  background: #0a0f1a;
}

.home-stat-tile {
  position: relative;
  display: grid;
  align-content: center;
  gap: 0.05rem;
  min-width: 0;
  padding: 0.58rem 1rem;
  color: #f1f5f9;
  text-decoration: none;
}

.home-stat-tile + .home-stat-tile {
  border-inline-start: 1px solid rgba(30, 39, 56, 0.9);
}

.home-stat-tile::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--home-blue);
}

.home-stat-tile.is-politics::before { background: var(--home-red); }
.home-stat-tile.is-robotics::before { background: var(--home-amber); }
.home-stat-tile.is-ai::before { background: var(--home-purple); }

.home-stat-tile span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
}

.home-stat-tile strong {
  color: #ffffff;
  font: 900 1.7rem "Space Grotesk", "IBM Plex Sans Arabic", sans-serif;
  line-height: 1;
}

.home-stat-tile small {
  color: #10b981;
  font: 800 0.68rem "JetBrains Mono", "IBM Plex Sans Arabic", monospace;
}

.home-category-filter {
  position: sticky;
  top: 60px;
  z-index: 60;
  height: 48px;
  border-bottom: 1px solid #1e2738;
  background:
    linear-gradient(90deg, #080c14 0, rgba(8, 12, 20, 0) 7%, rgba(8, 12, 20, 0) 93%, #080c14 100%),
    #080c14;
}

.home-category-track {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.home-category-track::-webkit-scrollbar {
  display: none;
}

.home-category-pill {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 30px;
  padding: 0.22rem 0.72rem;
  border: 1px solid #1e2738;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 900;
  text-decoration: none;
}

.home-category-pill strong {
  color: inherit;
  font: 800 0.7rem "JetBrains Mono", monospace;
}

.home-category-pill:hover,
.home-category-pill:focus-visible,
.home-category-pill.is-active {
  border-color: rgba(59, 130, 246, 0.45);
  background: #3b82f6;
  color: #ffffff;
}

.home-category-pill::after {
  content: "";
  position: absolute;
  inset-inline: 0.85rem;
  bottom: -10px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
}

.home-category-pill.is-active::after {
  opacity: 1;
}

.home-editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(22rem, 0.85fr);
  grid-template-areas:
    "hero live"
    "topics iraq"
    "breaking breaking"
    "latest latest";
  gap: 16px;
  direction: ltr;
}

.home-editorial-grid > * {
  direction: rtl;
}

.home-hero-story {
  grid-area: hero;
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid #1e2738;
  border-radius: 16px;
  background: #0f1520;
}

.home-hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.home-hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.home-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.05) brightness(0.8);
}

.home-hero-slide.is-missing {
  background:
    radial-gradient(circle at 24% 30%, rgba(59, 130, 246, 0.18), transparent 30%),
    linear-gradient(135deg, #111827, #080c14);
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 20%, rgba(8, 12, 20, 0.7) 60%, #080c14 100%),
    linear-gradient(90deg, rgba(8, 12, 20, 0.25), rgba(8, 12, 20, 0.88));
}

.home-hero-badges {
  position: absolute;
  inset-block-start: 18px;
  inset-inline-end: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.home-breaking-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 26px;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  font-size: 0.76rem;
  font-weight: 900;
}

.home-breaking-badge i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.42);
  animation: live-pulse 1.5s ease-out infinite;
}

.home-hero-content,
.home-hero-empty {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.65rem;
  max-width: 48rem;
  height: auto;
  padding: 1.6rem;
  padding-block-end: 5.25rem;
}

.home-hero-source {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 900;
}

.source-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(139, 92, 246, 0.8));
  color: #ffffff;
  font: 900 0.72rem "Inter", sans-serif;
}

.home-hero-content h1,
.home-hero-empty h1 {
  display: block;
  max-width: 44rem;
  margin: 0;
  overflow: visible;
  color: #ffffff;
  font: 900 clamp(1.75rem, 3.1vw, 2.45rem) "Space Grotesk", "IBM Plex Sans Arabic", sans-serif;
  line-height: 1.32;
}

.home-hero-content p,
.home-hero-empty p {
  display: -webkit-box;
  max-width: 43rem;
  margin: 0;
  overflow: hidden;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.home-hero-footer {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.4rem;
}

.home-hero-footer small {
  color: #94a3b8;
  font: 800 0.74rem "JetBrains Mono", "IBM Plex Sans Arabic", monospace;
}

.home-hero-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(241, 245, 249, 0.36);
  border-radius: 9px;
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
}

.home-hero-footer a:hover,
.home-hero-footer a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.home-hero-controls {
  position: absolute;
  inset-inline: 16px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.home-hero-controls .home-slider-button,
.home-hero-controls .home-slider-dot {
  pointer-events: auto;
}

.home-hero-controls .home-slider-button {
  width: 40px;
  height: 40px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.home-live-feed {
  grid-area: live;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 1rem;
  border: 1px solid #1e2738;
  border-radius: 16px;
  background: #0f1520;
}

.home-panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.home-panel-header h2 {
  margin: 0.15rem 0 0;
  color: #f1f5f9;
  font-size: 1.08rem;
  font-weight: 900;
}

.home-panel-header a,
.home-panel-header small {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: none;
}

.home-panel-header a:hover {
  color: #93c5fd;
}

.home-live-feed-list {
  display: grid;
  gap: 0.48rem;
  max-height: 520px;
  overflow-y: auto;
  padding-inline-end: 4px;
  scrollbar-color: rgba(59, 130, 246, 0.7) rgba(15, 21, 32, 0.8);
  scrollbar-width: thin;
}

.home-feed-row {
  position: relative;
  min-height: 64px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.55rem;
  align-items: center;
  padding: 0.55rem 0.68rem;
  border: 1px solid rgba(30, 39, 56, 0.95);
  border-radius: 10px;
  background: rgba(22, 27, 39, 0.48);
  color: #f1f5f9;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.home-feed-row::before {
  content: "";
  position: absolute;
  inset-block: 9px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 999px;
  background: #3b82f6;
  opacity: 0;
}

.home-feed-row:hover,
.home-feed-row:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.38);
  background: #161b27;
}

.home-feed-row:hover::before,
.home-feed-row:focus-visible::before {
  opacity: 1;
}

.home-feed-row.is-flashing {
  animation: feed-flash 2s ease-out;
}

.home-feed-row .source-avatar {
  grid-row: 1 / -1;
}

.home-feed-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
}

.home-feed-row strong {
  grid-column: 2 / 3;
  display: -webkit-box;
  overflow: hidden;
  color: #f1f5f9;
  font-size: 0.83rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-feed-row small {
  grid-column: 3 / 4;
  grid-row: 1 / -1;
  color: #64748b;
  font: 800 0.68rem "JetBrains Mono", "IBM Plex Sans Arabic", monospace;
}

.home-topic-column {
  min-height: 244px;
  padding: 1rem;
  border: 1px solid #1e2738;
  border-radius: 16px;
  background: #0f1520;
}

.home-topic-column.is-topics {
  grid-area: topics;
}

.home-topic-column.is-iraq {
  grid-area: iraq;
}

.home-topic-column.is-breaking {
  grid-area: breaking;
  min-height: 180px;
}

.home-topic-column.is-topics .home-panel-header {
  border-block-start: 3px solid #f59e0b;
  padding-top: 0.55rem;
}

.home-topic-column.is-iraq .home-panel-header,
.home-topic-column.is-breaking .home-panel-header {
  border-block-start: 3px solid #ef4444;
  padding-top: 0.55rem;
}

.home-topic-list,
.home-compact-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 520px;
  overflow-y: auto;
  padding-left: .5rem;
  padding-right: .25rem;
}

.home-topic-list a {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.45rem 0.55rem;
  border-radius: 9px;
  color: #e2e8f0;
  text-decoration: none;
}

.home-topic-list a:hover,
.home-topic-list a:focus-visible,
.home-compact-item:hover,
.home-compact-item:focus-visible {
  background: #161b27;
  transform: translateX(-4px);

}

.home-topic-list span {
  color: #64748b;
  font: 900 1.35rem "Space Grotesk", sans-serif;
}

.home-topic-list a:nth-child(1) span { color: #f59e0b; }
.home-topic-list a:nth-child(2) span { color: #cbd5e1; }
.home-topic-list a:nth-child(3) span { color: #b45309; }

.home-topic-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-topic-list small {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  font-weight: 900;
}

.home-compact-list {
  max-height: 360px;
  overflow-y: auto;
  padding-inline-end: 4px;
  scrollbar-width: thin;
}

.home-compact-item {
  position: relative;
  display: grid;
  gap: 0.12rem;
  min-height: 54px;
  padding: 0.5rem 0.7rem;
  border-inline-start: 2px solid rgba(239, 68, 68, 0.85);
  border-radius: 9px;
  color: #f1f5f9;
  text-decoration: none;
}

.home-compact-item strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.84rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-compact-item small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
}

.home-breaking-list .home-compact-item {
  grid-template-columns: auto minmax(0, 1fr);
}

.home-breaking-list .home-compact-item .ops-live-dot {
  grid-row: 1 / -1;
}

.home-latest-strip {
  grid-area: latest;
  min-width: 0;
  padding: 1rem;
  border: 1px solid #1e2738;
  border-radius: 16px;
  background: #0f1520;
}

.home-scroll-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-scroll-actions button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #2a3347;
  border-radius: 999px;
  background: #161b27;
  color: #f1f5f9;
  font-size: 1.2rem;
}

.home-scroll-actions button:hover,
.home-scroll-actions button:focus-visible {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.14);
}

.home-latest-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 260px;
  gap: 0.85rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.4rem;
  scroll-padding-inline: 0.2rem;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
}

.home-latest-rail::-webkit-scrollbar {
  display: none;
}

.home-latest-card {
  scroll-snap-align: start;
  overflow: hidden;
  min-height: 262px;
  border: 1px solid #1e2738;
  border-radius: 12px;
  background: #0f1520;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-latest-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.36);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.home-latest-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #161b27;
}

.home-latest-card > div {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.72rem 0.72rem 0.35rem;
}

.home-latest-card .source-name {
  overflow: hidden;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-latest-card h3 {
  display: -webkit-box;
  min-height: 3rem;
  margin: 0;
  overflow: hidden;
  padding-inline: 0.72rem;
  color: #f1f5f9;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-latest-card h3 a {
  color: inherit;
  text-decoration: none;
}

.home-latest-card small {
  display: block;
  padding: 0.55rem 0.72rem 0.75rem;
  color: #64748b;
  font: 800 0.7rem "JetBrains Mono", "IBM Plex Sans Arabic", monospace;
}

.home-empty-state {
  display: grid;
  gap: 0.28rem;
  min-height: 8rem;
  align-content: center;
  padding: 1rem;
  border: 1px dashed rgba(100, 116, 139, 0.32);
  border-radius: 12px;
  color: #94a3b8;
  text-align: center;
}

.home-empty-state strong {
  color: #f1f5f9;
}

.compact-status-banner {
  margin-inline: max(20px, calc((100vw - 1320px) / 2));
}

@keyframes feed-flash {
  0% { background: #1e3a5f; }
  100% { background: rgba(22, 27, 39, 0.48); }
}

@media (max-width: 1199px) {
  .brandmark {
    min-width: auto;
  }

  .topnav-status {
    display: none;
  }

  .account-chip-name,
  .account-chevron {
    display: none;
  }

  .home-editorial-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "hero"
      "live"
      "topics"
      "iraq"
      "breaking"
      "latest";
  }

  .home-topic-column.is-breaking {
    grid-column: auto;
  }
}

@media (max-width: 991px) {
  .topbar-inner {
    height: auto;
    min-height: 60px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.6rem;
    padding-block: 0.48rem;
  }

  .topbar-divider {
    display: none;
  }

  .mobile-nav-toggle {
    display: inline-block;
    justify-self: center;
  }

  .topnav {
    grid-column: 1 / -1;
    display: none;
    padding: 0.6rem;
    border: 1px solid #1e2738;
    border-radius: 14px;
    background: #0f1520;
  }

  body.nav-open .topnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topnav-menu {
    position: static;
    display: none;
    width: 100%;
    transform: none;
    box-shadow: none;
    padding: 0.55rem;
  }

  .topnav-dropdown:focus-within .topnav-menu,
  .topnav-dropdown:hover .topnav-menu {
    display: grid;
    transform: none;
  }

  .topbar-actions {
    justify-content: end;
  }

  .command-button {
    width: 44px;
    justify-content: center;
  }

  .command-button span {
    display: none;
  }
}

@media (max-width: 767px) {
  .home-stats-ribbon {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-category-filter {
    top: 60px;
  }

  .home-editorial-grid,
  .home-stats-ribbon,
  .home-category-filter {
    padding-inline: 12px;
  }

  .home-hero-story,
  .home-live-feed {
    min-height: 540px;
  }

  .home-hero-content,
  .home-hero-empty {
    padding: 1rem;
    padding-block-end: 4.75rem;
  }

  .home-hero-content h1,
  .home-hero-empty h1 {
    font-size: clamp(1.6rem, 4vw, 3rem);
  }

  .home-feed-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .home-feed-row small {
    grid-column: 2 / 3;
    grid-row: auto;
  }

  .home-latest-rail {
    grid-auto-columns: min(78vw, 260px);
  }
}

body[data-authenticated="true"] .topbar-login-link {
  display: none !important;
}

.topnav-dropdown.is-open .topnav-trigger {
  transform: none;
  border-color: transparent;
  background: rgba(59, 130, 246, 0.13);
  color: #ffffff;
}

.topnav-dropdown.is-open .topnav-trigger::before {
  opacity: 1;
  transform: scaleX(1);
}

.topnav-dropdown.is-open .topnav-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.home-hero-slide {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.home-hero-image {
  z-index: 0;
  object-position: center;
}

.home-hero-overlay {
  z-index: 1;
}

.home-hero-badges,
.home-hero-content,
.home-hero-empty {
  z-index: 2;
}

.home-hero-controls {
  z-index: 4;
}

.home-live-feed-list::-webkit-scrollbar {
  width: 4px;
}

.home-live-feed-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #1e2738;
}

.home-live-feed-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #3b82f6;
}

.home-category-track {
  flex-wrap: nowrap;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

.home-category-pill {
  white-space: nowrap;
}

.home-latest-card {
  display: flex;
  flex-direction: column;
  height: 220px;
  min-height: 220px;
}

.home-latest-card img {
  flex: 0 0 120px;
  height: 120px;
  object-fit: cover;
  object-position: center;
}

.home-latest-card > div {
  flex: 0 0 auto;
}

.home-latest-card h3 {
  flex: 1 1 auto;
  min-height: 0;
}

.home-latest-card small {
  flex: 0 0 auto;
}

.home-topic-column.is-iraq .home-panel-header {
  border-block-start: 4px solid #ef4444;
}

.home-section-icon {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-inline-end: 0.35rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.14);
  font-size: 0.95rem;
  vertical-align: middle;
}

.breaking-dot {
  grid-row: 1 / -1;
  align-self: start;
  width: 8px;
  height: 8px;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.5s ease infinite;
}

.home-breaking-list .home-compact-item small {
  grid-column: 2;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}

.home-stat-delta.is-positive {
  color: #10b981;
}

.home-stat-delta.is-negative {
  color: #ef4444;
}

.home-hero-controls .home-slider-dots {
  gap: 6px;
  max-width: calc(100% - 108px);
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.home-hero-controls .home-slider-dots::-webkit-scrollbar {
  display: none;
}

.home-hero-controls .home-slider-dot {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 42px;
  height: 26px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.home-hero-controls .home-slider-dot.is-active {
  width: auto;
  height: 26px;
  border-color: #ffffff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #080c14;
  font-weight: 900;
}

.home-hero-controls .home-slider-dot:hover,
.home-hero-controls .home-slider-dot:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.home-hero-controls .home-slider-dot.is-active:hover,
.home-hero-controls .home-slider-dot.is-active:focus-visible {
  background: #ffffff;
  color: #080c14;
}

.dot-breaking {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.admin-score-badge {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 6;
  max-width: min(70%, 34rem);
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.82);
  color: #86efac;
  font: 700 9px/1.5 "JetBrains Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Targeted news dashboard fixes: image shells, card rhythm, text direction, and scroll panels. */
.card-image,
.article-card-media.card-image {
  position: relative;
  flex: 0 0 140px;
  width: 100%;
  height: 140px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background:
    radial-gradient(circle at 22% 22%, rgba(59, 130, 246, 0.22), transparent 34%),
    linear-gradient(135deg, #161b27, #1e2738);
}

.card-image::after {
  content: attr(data-category-icon);
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: rgba(241, 245, 249, 0.82);
  font-size: 32px;
  font-weight: 900;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}

.card-image:has(img)::after {
  content: none;
}

.card-image img,
.article-card-media.card-image img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px 12px 0 0;
  background: #161b27;
}

.card-image.is-missing img,
.article-card-media.card-image.is-missing img,
.home-latest-card.is-missing img {
  display: none;
}

.card-image.is-missing::after,
.article-card-media.card-image.is-missing::after {
  content: attr(data-category-icon);
}

.article-card {
  position: relative;
  height: 320px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0f1520;
  border: 1px solid #1e2738;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: #2a3347;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.article-card .article-card-body {
  flex: 0 0 180px;
  height: 180px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}

.article-card .article-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.article-card .source-badge,
.source-name,
.home-feed-meta span[dir="ltr"],
.home-compact-item small span[dir="ltr"],
.home-hero-source span[dir="ltr"] {
  display: inline-block;
  max-width: 100%;
  direction: ltr;
  unicode-bidi: plaintext;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-card .article-title {
  flex: 0 0 auto;
  min-height: auto;
  margin: 0;
  padding: 0;
}

.article-card .card-title {
  display: -webkit-box;
  overflow: hidden;
  color: #f1f5f9;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article-card .article-title,
.home-latest-card h3,
.home-feed-row strong,
.home-compact-item strong {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.article-card .analysis-note,
.article-card .keyword-row,
.article-card .importance-meter {
  display: none;
}

.article-card .card-description {
  flex: 1 1 auto;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  text-align: right;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.article-card .article-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 0;
}

.article-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.article-card .card-meta-left,
.article-card .card-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #64748b;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.article-card .card-meta-right {
  max-width: 58%;
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  font-weight: 700;
}

.article-card .card-meta-right span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-read-more {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 3;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: #3b82f6;
  color: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  text-decoration: none;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.article-card:hover .card-read-more,
.article-card:focus-within .card-read-more {
  opacity: 1;
  transform: translateY(0);
}

.article-card .article-source,
.article-card .article-date,
.home-latest-card small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.is-latin-title {
  direction: ltr;
  text-align: left;
}

.is-arabic-title {
  direction: rtl;
  text-align: right;
}

.category-badge {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.category-politics {
  border-color: rgba(239, 68, 68, 0.52) !important;
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
}

.category-sports {
  border-color: rgba(96, 165, 250, 0.54) !important;
  background: rgba(96, 165, 250, 0.16) !important;
  color: #93c5fd !important;
}

.category-world {
  border-color: rgba(20, 184, 166, 0.54) !important;
  background: rgba(20, 184, 166, 0.16) !important;
  color: #5eead4 !important;
}

.category-science {
  border-color: rgba(168, 85, 247, 0.54) !important;
  background: rgba(168, 85, 247, 0.16) !important;
  color: #d8b4fe !important;
}

.category-ai {
  border-color: rgba(139, 92, 246, 0.58) !important;
  background: rgba(139, 92, 246, 0.18) !important;
  color: #c4b5fd !important;
}

.category-technology {
  border-color: rgba(34, 211, 238, 0.54) !important;
  background: rgba(34, 211, 238, 0.15) !important;
  color: #67e8f9 !important;
}

.category-business {
  border-color: rgba(245, 158, 11, 0.54) !important;
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fcd34d !important;
}

.category-robotics {
  border-color: rgba(16, 185, 129, 0.54) !important;
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6ee7b7 !important;
}

.article-card .sentiment-badge {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}

.article-card .sentiment-positive {
  border: 1px solid #10b981;
  background: #064e3b;
  color: #6ee7b7;
}

.article-card .sentiment-negative {
  border: 1px solid #ef4444;
  background: #450a0a;
  color: #fca5a5;
}

.article-card .sentiment-neutral {
  border: 1px solid #374151;
  background: #1e2738;
  color: #94a3b8;
}

.article-grid {
  gap: 16px;
}

.news-list-shell .article-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .news-list-shell .article-grid,
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .news-list-shell .article-grid,
  .article-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.home-hero-slide {
  position: absolute;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.home-hero-image {
  z-index: 0;
  object-fit: cover;
  object-position: center;
}

.home-hero-overlay {
  z-index: 1;
}

.home-hero-badges,
.home-hero-content,
.home-hero-empty {
  z-index: 2;
}

.home-live-feed {
  overflow: hidden;
}

.home-feed-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.home-feed-row strong {
    display: -webkit-box;
    margin-top: 0.25rem;
    line-height: 1.65;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-editorial-grid {
  align-items: stretch;
}

.home-topic-column {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.home-topic-list,
.home-compact-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 300px;
  overflow-y: auto;
}

.home-latest-rail {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.home-latest-rail::-webkit-scrollbar {
  display: none;
}

.home-latest-card {
  flex: 0 0 240px;
  width: 240px;
  height: 220px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.home-latest-card .card-image {
  flex: 0 0 120px;
  display: block;
  padding: 0;
  gap: 0;
  border-radius: 12px 12px 0 0;
}

.home-latest-card .home-latest-content {
  flex: 1 1 auto;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.home-latest-card .home-latest-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0;
}

.home-latest-card h3 {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0.38rem 0;
  padding: 0;
}

.home-latest-card small {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 0;
}

.home-live-feed-list,
.home-topic-list,
.home-compact-list {
  scrollbar-color: #2a3347 #0f1520;
  scrollbar-width: thin;
}

.home-live-feed-list::-webkit-scrollbar,
.home-topic-list::-webkit-scrollbar,
.home-compact-list::-webkit-scrollbar {
  width: 4px;
}

.home-live-feed-list::-webkit-scrollbar-track,
.home-topic-list::-webkit-scrollbar-track,
.home-compact-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #0f1520;
}

.home-live-feed-list::-webkit-scrollbar-thumb,
.home-topic-list::-webkit-scrollbar-thumb,
.home-compact-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #2a3347;
}

.home-live-feed-list::-webkit-scrollbar-thumb:hover,
.home-topic-list::-webkit-scrollbar-thumb:hover,
.home-compact-list::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

/* Focused panel spacing fixes: live feed, Iraq now, breaking items, and compact account chip. */
.home-live-feed-list,
.home-topic-column.is-iraq .home-compact-list,
.home-topic-column.is-breaking .home-compact-list {
  max-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #2a3347 #0f1520;
  scrollbar-width: thin;
}

.home-live-feed-list::-webkit-scrollbar,
.home-topic-column.is-iraq .home-compact-list::-webkit-scrollbar,
.home-topic-column.is-breaking .home-compact-list::-webkit-scrollbar {
  width: 4px;
}

.home-live-feed-list::-webkit-scrollbar-track,
.home-topic-column.is-iraq .home-compact-list::-webkit-scrollbar-track,
.home-topic-column.is-breaking .home-compact-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #0f1520;
}

.home-live-feed-list::-webkit-scrollbar-thumb,
.home-topic-column.is-iraq .home-compact-list::-webkit-scrollbar-thumb,
.home-topic-column.is-breaking .home-compact-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #2a3347;
}

.home-live-feed-list::-webkit-scrollbar-thumb:hover,
.home-topic-column.is-iraq .home-compact-list::-webkit-scrollbar-thumb:hover,
.home-topic-column.is-breaking .home-compact-list::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

.home-feed-row {
  min-height: 76px;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 6px 16px;
  padding: 0.68rem 0.78rem;
  direction: ltr;
}

.home-feed-row .source-avatar {
  grid-column: 3;
  grid-row: 1 / -1;
  justify-self: end;
}

.home-feed-meta {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  min-width: 0;
  margin-bottom: 10px;
  direction: rtl;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-feed-row strong {
  grid-column: 2;
  grid-row: 2;
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #f1f5f9;
  line-height: 1.6;
  word-break: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-feed-row small {
  grid-column: 1;
  grid-row: 1 / -1;
  justify-self: start;
  align-self: center;
  white-space: nowrap;
  direction: ltr;
}

.home-topic-column.is-iraq {
  border-top: 4px solid #ef4444;
}

.home-topic-column.is-iraq .home-panel-header {
  border-block-start: 0;
  padding-top: 0;
}

.home-topic-column.is-iraq .home-compact-list {
  gap: 0;
  padding-inline: 0.15rem 0.35rem;
}

.home-topic-column.is-iraq .home-compact-item {
  min-height: 0;
  display: block;
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
}

.home-topic-column.is-iraq .home-compact-item:last-child {
  border-bottom: 0;
}

.home-topic-column.is-iraq .home-compact-item:hover,
.home-topic-column.is-iraq .home-compact-item:focus-visible {
  transform: none;
  background: rgba(255, 255, 255, 0.035);
}

.home-topic-column.is-iraq .home-compact-item strong {
  display: -webkit-box;
  width: 100%;
  min-width: 0;
  min-height: 1.7em;
  margin-bottom: 0.35rem;
  overflow: hidden;
  color: var(--text-primary, #fff);
  font-size: 0.92rem;
  line-height: 1.7;
  opacity: 1;
  visibility: visible;
  word-break: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-topic-column.is-iraq .home-compact-item small {
  display: block;
  width: 100%;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.5;
}

.home-topic-column.is-breaking .home-compact-list {
  gap: 0;
  padding-inline: 0.15rem 0.35rem;
}

.home-topic-column.is-breaking .home-compact-item {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.18rem 0.58rem;
  padding: 0.88rem 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
}

.home-topic-column.is-breaking .home-compact-item:last-child {
  border-bottom: 0;
}

.home-topic-column.is-breaking .home-compact-item:hover,
.home-topic-column.is-breaking .home-compact-item:focus-visible {
  transform: none;
  background: rgba(239, 68, 68, 0.045);
}

.home-topic-column.is-breaking .home-compact-item strong,
.home-topic-column.is-breaking .home-compact-item small {
  grid-column: 2;
  width: 100%;
  min-width: 0;
}

.home-topic-column.is-breaking .home-compact-item strong {
  line-height: 1.65;
}

.home-topic-column.is-breaking .home-compact-item small {
  color: #64748b;
}

.breaking-dot {
  flex-shrink: 0;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 8px;
  height: 8px;
  margin-top: 0.58rem;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.5s ease infinite;
}

.topbar-actions {
  align-items: center;
  flex-wrap: nowrap;
}

.account-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0.16rem 0.38rem;
  border-radius: 999px;
}

.account-avatar {
  width: 26px;
  height: 26px;
  font-size: 0.72rem;
}

.account-chip-name {
  max-width: 5.4rem;
  font-size: 0.72rem;
  line-height: 1;
}

.account-chip-role {
  padding: 0.05rem 0.32rem;
  font-size: 0.52rem;
  line-height: 1.35;
}

.account-chevron {
  line-height: 1;
  font-size: 0.8rem;
}

.logout-form {
  display: inline-flex;
  align-items: center;
}

.topbar-icon-button,
.topbar-login-link {
  width: 34px;
  height: 34px;
}

.topbar-login-link {
  width: auto;
  padding-inline: 0.72rem;
}

body[data-authenticated="true"] .topbar-login-link,
body[data-authenticated="false"] .account-chip,
body[data-authenticated="false"] .logout-form {
  display: none !important;
}

/* Category listing refinements: compact header, tighter cards, featured lead, pagination, skeletons. */
.compact-hero {
  min-height: 100px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.compact-hero .hero-copy {
  min-width: 0;
}

.compact-hero .list-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
  letter-spacing: 0;
  text-transform: none;
}

.compact-hero .list-breadcrumb a {
  color: #64748b;
  text-decoration: none;
}

.compact-hero .list-breadcrumb a:hover,
.compact-hero .list-breadcrumb a:focus-visible {
  color: #93c5fd;
}

.compact-hero .hero-copy h1 {
  margin: 0 0 0.25rem;
  color: #f1f5f9;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.list-header-meta {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.compact-hero .hero-filters {
  display: flex;
  flex-direction: row;
  align-items: end;
  gap: 0.55rem;
}

.compact-hero .hero-filters > .field-label,
.compact-hero .filter-grid .field-label {
  display: none;
}

.compact-hero .filter-grid {
  display: block;
}

.compact-hero #news-q {
  width: 220px;
}

.compact-hero #news-date {
  width: 140px;
}

.compact-hero .glass-control {
  min-height: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 12px;
}

.compact-hero .hero-actions {
  flex-wrap: nowrap;
}

.compact-hero .btn-neo {
  min-height: 36px;
  height: 36px;
  padding: 0 0.85rem;
  font-size: 12px;
}

.news-list-shell .section-panel {
  padding: 0;
  overflow: hidden;
}

.news-list-shell .article-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 20px;
}

.article-card {
  --card-category-accent: #3b82f6;
}

.article-category-politics { --card-category-accent: #ef4444; }
.article-category-sports { --card-category-accent: #60a5fa; }
.article-category-world { --card-category-accent: #14b8a6; }
.article-category-science { --card-category-accent: #a855f7; }
.article-category-ai { --card-category-accent: #8b5cf6; }
.article-category-technology { --card-category-accent: #22d3ee; }
.article-category-business { --card-category-accent: #f59e0b; }
.article-category-robotics { --card-category-accent: #10b981; }
.article-category-health { --card-category-accent: #4dd9b0; }
.article-category-entertainment { --card-category-accent: #ff9ad2; }

.news-list-shell .article-card {
  height: 280px;
  min-height: 280px;
  border-left: 3px solid #37415140;
}

.news-list-shell .article-card.sentiment-tone-positive {
  border-left-color: #10b98140;
}

.news-list-shell .article-card.sentiment-tone-negative {
  border-left-color: #ef444440;
}

.news-list-shell .article-card.sentiment-tone-neutral {
  border-left-color: #37415140;
}

.news-list-shell .article-card .card-image,
.news-list-shell .article-card .article-card-media.card-image {
  flex: 0 0 150px;
  height: 150px;
}

.news-list-shell .article-card .card-image img,
.news-list-shell .article-card .article-card-media.card-image img {
  height: 150px;
  transition: transform 0.25s ease;
}

.news-list-shell .article-card:hover .card-image img {
  transform: scale(1.04);
}

.card-image-category {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.75);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.news-list-shell .article-card .card-content {
  flex: 1 1 130px;
  height: 130px;
  padding: 8px 14px 12px;
  gap: 5px;
}

.news-list-shell .article-card .article-meta {
  min-height: 22px;
  margin: 0;
}

.news-list-shell .article-card .article-meta-empty {
  display: none;
}

.news-list-shell .article-card .card-title {
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  transition: color 0.25s ease;
}

.news-list-shell .article-card:hover .card-title {
  color: #ffffff;
}

.news-list-shell .article-card .card-description {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
}

.news-list-shell .article-card .card-meta {
  flex-wrap: nowrap;
  gap: 8px;
  direction: ltr;
}

.news-list-shell .article-card .card-meta-left,
.news-list-shell .article-card .card-meta-right {
  min-width: 0;
  white-space: nowrap;
}

.news-list-shell .article-card .card-meta-right {
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
}

.news-list-shell .article-card .card-read-more {
  bottom: 12px;
  left: 14px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.news-list-shell .article-grid > .article-card:first-of-type {
  grid-column: 1 / -1;
  height: 220px;
  min-height: 220px;
  flex-direction: row;
  direction: ltr;
  border-left: 4px solid var(--card-category-accent);
  background: #131a28;
}

.news-list-shell .article-grid > .article-card:first-of-type .card-image {
  flex: 0 0 40%;
  width: 40%;
  height: 100%;
  border-radius: 12px 0 0 12px;
}

.news-list-shell .article-grid > .article-card:first-of-type .card-image img {
  height: 100%;
  border-radius: 12px 0 0 12px;
}

.news-list-shell .article-grid > .article-card:first-of-type .card-content {
  width: 60%;
  height: 100%;
  justify-content: center;
  padding: 20px 24px;
  direction: rtl;
}

.news-list-shell .article-grid > .article-card:first-of-type .card-title {
  font-size: 20px;
  font-weight: 900;
}

.news-list-shell .article-grid > .article-card:first-of-type .card-description {
  -webkit-line-clamp: 3;
}

.home-latest-card .card-image {
  height: 120px;
}

.home-latest-card .card-image img {
  height: 120px;
}

.news-pagination {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 1rem 0.25rem 1.25rem;
}

.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  direction: ltr;
}

.pagination-link {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font: 800 12px "JetBrains Mono", "IBM Plex Sans Arabic", monospace;
  text-decoration: none;
}

.pagination-link:hover,
.pagination-link:focus-visible {
  background: #161b27;
  color: #f1f5f9;
}

.pagination-page.is-current {
  border-color: rgba(59, 130, 246, 0.55);
  background: #3b82f6;
  color: #ffffff;
}

.pagination-icon {
  font-size: 18px;
}

.pagination-ellipsis {
  min-width: 18px;
  color: #64748b;
  text-align: center;
}

.pagination-state {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.skeleton {
  border-radius: 4px;
  background: linear-gradient(90deg, #0f1520 25%, #161b27 50%, #0f1520 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-card {
  height: 280px;
  overflow: hidden;
  border: 1px solid #1e2738;
  border-radius: 12px;
  background: #0f1520;
}

.skeleton-card:first-child {
  grid-column: 1 / -1;
  height: 220px;
}

.skeleton-image {
  height: 150px;
  border-radius: 0;
}

.skeleton-body {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.skeleton-line {
  height: 12px;
}

.skeleton-line.is-title {
  width: 82%;
  height: 18px;
}

.skeleton-line.is-short {
  width: 45%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 900px) {
  .news-list-shell .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-list-shell .article-grid > .article-card:first-of-type {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .compact-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .compact-hero .hero-filters {
    flex-wrap: wrap;
  }

  .compact-hero #news-q,
  .compact-hero #news-date {
    width: min(100%, 220px);
  }
}

@media (max-width: 560px) {
  .news-list-shell .article-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .news-list-shell .article-grid > .article-card:first-of-type {
    height: 320px;
    min-height: 320px;
    flex-direction: column;
    direction: rtl;
  }

  .news-list-shell .article-grid > .article-card:first-of-type .card-image,
  .news-list-shell .article-grid > .article-card:first-of-type .card-image img {
    width: 100%;
    height: 150px;
    border-radius: 12px 12px 0 0;
  }

  .news-list-shell .article-grid > .article-card:first-of-type .card-content {
    width: 100%;
    height: 170px;
    padding: 12px 14px;
  }
}

/* Official intelligence briefing surfaces for PM-office analysis pages. */
.gov-intel-page {
  display: grid;
  gap: 1rem;
  font-family: "Noto Naskh Arabic", "IBM Plex Sans Arabic", "Cairo", serif;
}

.gov-intel-page h1,
.gov-intel-page h2,
.gov-intel-page h3,
.gov-intel-page .panel-eyebrow,
.gov-intel-page .metric-value,
.gov-intel-page strong,
.gov-intel-page small,
.gov-intel-page button,
.gov-intel-page a {
  font-family: "IBM Plex Sans Arabic", "Noto Naskh Arabic", sans-serif;
}

.classification-bar {
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 0.25rem 0.8rem;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 8px;
  background: #1a0a0a;
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 900;
}

.official-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 800;
}

.official-print-button {
  min-height: 32px;
  padding: 0.25rem 0.75rem;
  border: 1px solid #2a3347;
  border-radius: 999px;
  background: #0f1520;
  color: #f1f5f9;
  font-weight: 900;
}

.official-print-button:hover,
.official-print-button:focus-visible {
  border-color: rgba(59, 130, 246, 0.55);
  background: #161b27;
}

.official-intel-hero {
  border-color: rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.06), transparent 34%),
    #0f1520;
}

.daily-brief-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-left: 4px solid #ef4444;
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.12), transparent 40%),
    #0f1520;
}

.brief-live {
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.daily-brief-header h1 {
  margin: 0.2rem 0;
  color: #f8fafc;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
}

.daily-brief-header p,
.daily-brief-header small {
  display: block;
  margin: 0;
  color: #cbd5e1;
}

.brief-export-actions {
  flex: 0 0 auto;
}

.urgency-strip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  color: #f1f5f9;
  font-weight: 900;
}

.intelligence-brief-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.official-priority-card {
  position: relative;
  padding: 1.15rem;
  border-left: 4px solid #374151;
  background: #0f1520;
}

.official-priority-card.priority-critical { border-left-color: #ef4444; }
.official-priority-card.priority-important { border-left-color: #f59e0b; }
.official-priority-card.priority-follow { border-left-color: #3b82f6; }
.official-priority-card.priority-normal { border-left-color: #374151; }

.priority-ribbon {
  margin-bottom: 0.65rem;
  color: #f8fafc;
  font-weight: 900;
}

.official-priority-card h2 {
  color: #f8fafc;
  font-size: 20px;
  line-height: 1.55;
}

.official-priority-card p {
  display: -webkit-box;
  overflow: hidden;
  color: #cbd5e1;
  line-height: 1.75;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.official-context-card,
.official-recommendation,
.official-position-card,
.official-interpretation {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.official-context-card strong,
.official-recommendation strong,
.official-position-card strong,
.official-interpretation strong {
  color: #f8fafc;
}

.official-context-card span,
.official-recommendation span,
.official-position-card p,
.official-interpretation span {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.75;
}

.official-card-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.official-card-actions button,
.official-card-actions a {
  min-height: 32px;
  padding: 0.25rem 0.7rem;
  border: 1px solid #2a3347;
  border-radius: 999px;
  background: #111827;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.official-confidence-note {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 21, 32, 0.85);
}

.official-chart-card .line-chart-shell {
  position: relative;
}

.official-line-chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
}

.analytics-line-chart .zone-positive {
  fill: rgba(16, 185, 129, 0.09);
}

.analytics-line-chart .zone-neutral {
  fill: rgba(100, 116, 139, 0.08);
}

.analytics-line-chart .zone-negative {
  fill: rgba(239, 68, 68, 0.08);
}

.axis-labels-ar {
  display: grid;
  align-content: space-between;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 800;
}

.chart-annotation {
  grid-column: 1 / -1;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.08);
  color: #bfdbfe;
  font-size: 0.8rem;
  font-weight: 800;
}

.sentiment-context-card .sentiment-pie {
  margin-inline: auto;
}

.official-sentiment-list .sentiment-row {
  justify-content: space-between;
}

.official-week-stack {
  gap: 0.75rem;
}

.official-week-row {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.official-week-row strong {
  color: #f8fafc;
}

.official-week-row span,
.official-week-row small,
.official-week-row em {
  color: #94a3b8;
  font-style: normal;
}

.source-verdict-stack {
  display: grid;
  gap: 0.75rem;
}

.source-verdict-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.source-verdict-card header,
.source-tone-line {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 2.4rem;
  align-items: center;
  gap: 0.45rem;
}

.source-verdict-card header {
  grid-template-columns: minmax(0, 1fr) auto;
}

.source-verdict-card header strong {
  color: #f8fafc;
}

.source-verdict-card header span,
.source-verdict-card small,
.source-tone-line span,
.source-tone-line b {
  color: #94a3b8;
  font-size: 0.78rem;
}

.source-tone-line div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #1e2738;
}

.source-tone-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.source-tone-line .tone-positive { background: #10b981; }
.source-tone-line .tone-negative { background: #ef4444; }
.source-tone-line .tone-neutral { background: #64748b; }

.official-narrative-card {
  display: grid;
  gap: 1rem;
}

.narrative-score-box {
  width: 82px;
  min-height: 72px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #111827;
}

.narrative-score-box strong {
  color: #f8fafc;
  font-size: 1.55rem;
}

.narrative-score-box small {
  color: #94a3b8;
}

.official-narrative-card.score-high .narrative-score-box {
  border-color: rgba(16, 185, 129, 0.48);
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.16);
}

.official-narrative-card.score-medium .narrative-score-box {
  border-color: rgba(245, 158, 11, 0.48);
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.14);
}

.official-narrative-card.score-low .narrative-score-box {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.16);
}

.narrative-conflict-alert {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}

.official-position-card {
  border-color: rgba(59, 130, 246, 0.24);
  background: rgba(59, 130, 246, 0.08);
}

.official-heatmap-card .heatmap-cell {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.heatmap-cell.heat-level-1 { background: #0f1520; }
.heatmap-cell.heat-level-2 { background: #1e3a5f; }
.heatmap-cell.heat-level-3 { background: #1e40af; }
.heatmap-cell.heat-level-4 { background: #3b82f6; }
.heatmap-cell.heat-level-5 {
  background: #60a5fa;
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.38);
}

.topic-filter-card {
  position: relative;
}

.topic-filter-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}

.topic-filter-controls input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.topic-filter-controls label {
  cursor: pointer;
  padding: 0.25rem 0.65rem;
  border: 1px solid #2a3347;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 900;
}

.topic-filter-controls input:checked + label {
  border-color: rgba(59, 130, 246, 0.58);
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

.filtered-topic-stack .is-non-gov-topic {
  display: none;
}

.topic-filter-card:has(#topic-filter-all:checked) .filtered-topic-stack .topic-row {
  display: flex;
}

.topic-filter-card:has(#topic-filter-economy:checked) .filtered-topic-stack .topic-row,
.topic-filter-card:has(#topic-filter-security:checked) .filtered-topic-stack .topic-row,
.topic-filter-card:has(#topic-filter-politics:checked) .filtered-topic-stack .is-non-gov-topic {
  display: none;
}

.topic-filter-card:has(#topic-filter-economy:checked) .filtered-topic-stack .is-economy-topic,
.topic-filter-card:has(#topic-filter-security:checked) .filtered-topic-stack .is-security-topic,
.topic-filter-card:has(#topic-filter-politics:checked) .filtered-topic-stack .is-gov-topic {
  display: flex;
}

.filtered-topic-stack .topic-row {
  flex-wrap: wrap;
}

.filtered-topic-stack .topic-row small {
  flex-basis: 100%;
  color: #64748b;
  font-size: 0.72rem;
}

.official-growth-grid .growth-card {
  display: grid;
  gap: 0.45rem;
}

.official-growth-grid .growth-card em {
  color: #cbd5e1;
  font-style: normal;
  font-weight: 900;
}

.official-growth-grid .growth-exceptional .growth-meter span,
.official-growth-grid .growth-positive .growth-meter span {
  background: #10b981;
}

.official-growth-grid .growth-severe .growth-meter span,
.official-growth-grid .growth-decline .growth-meter span {
  background: #ef4444;
}

@media (max-width: 991px) {
  .intelligence-brief-grid,
  .analytics-grid,
  .analytics-grid-three {
    grid-template-columns: 1fr;
  }

  .daily-brief-header,
  .official-session-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: #ffffff !important;
    color: #111827 !important;
  }

  .topbar,
  .footer-shell,
  .page-glow,
  .ambient-grid,
  .official-print-button,
  .official-card-actions,
  .btn,
  .command-palette {
    display: none !important;
  }

  .app-main,
  .gov-intel-page {
    padding: 0 !important;
    margin: 0 !important;
    color: #111827 !important;
  }

  .panel,
  .classification-bar,
  .official-session-row,
  .daily-brief-header,
  .official-priority-card,
  .analytics-card,
  .narrative-card {
    break-inside: avoid;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #cbd5e1 !important;
  }

  .classification-bar {
    color: #7f1d1d !important;
  }
}

/* Latest news horizontal rail fix: robust image fallback, title/description layout, and scroll controls. */
.latest-news-wrapper {
  position: relative;
}

.latest-news-wrapper::before,
.latest-news-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 40px;
  pointer-events: none;
}

.latest-news-wrapper::before {
  right: 0;
  background: linear-gradient(to left, #080c14, transparent);
}

.latest-news-wrapper::after {
  left: 0;
  background: linear-gradient(to right, #080c14, transparent);
}

.home-latest-rail.latest-news-scroll {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 4px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-latest-rail.latest-news-scroll::-webkit-scrollbar {
  display: none;
}

.home-latest-card.latest-card {
  width: 220px;
  flex: 0 0 220px;
  min-height: 0;
  height: auto;
  overflow: hidden;
  border: 1px solid #1e2738;
  border-radius: 12px;
  background: #0f1520;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.home-latest-card.latest-card:hover {
  transform: translateY(-4px);
  border-color: #2a3347;
  box-shadow: none;
}

.home-latest-card.latest-card > div.latest-card-image {
  position: relative;
  height: 120px;
  display: block;
  overflow: hidden;
  padding: 0;
  gap: 0;
  background: #161b27;
}

.latest-card-image img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.latest-card-image.is-missing img,
.home-latest-card.latest-card.is-missing .latest-card-image img {
  display: none;
}

.latest-card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.fallback-emoji {
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.36));
}

.img-category-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.8);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.home-latest-card.latest-card > div.latest-card-content,
.latest-card-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 10px 12px;
}

.latest-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.card-source {
  max-width: 100px;
  overflow: hidden;
  color: #64748b;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-score {
  flex: 0 0 auto;
  color: #64748b;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  white-space: nowrap;
}

.home-latest-card.latest-card .latest-card-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  padding: 0;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.latest-card-title a {
  color: inherit;
  text-decoration: none;
}

.latest-card-desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-latest-card.latest-card .latest-card-time {
  display: block;
  margin-top: auto;
  padding: 0;
  color: #475569;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}

.scroll-btn {
  width: 32px;
  height: 32px;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a3347;
  border-radius: 50%;
  background: #161b27;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scroll-btn:hover,
.scroll-btn:focus-visible {
  transform: scale(1.05);
  border-color: #3b82f6;
  background: #3b82f6;
}

.scroll-btn:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

body[data-page="Admin-Sources"] {
  --rss-bg: #080c14;
  --rss-card: #0f1520;
  --rss-row: #111827;
  --rss-hover: #161b27;
  --rss-input: #161b27;
  --rss-border: #1e2738;
  --rss-border-strong: #2a3347;
  --rss-blue: #3b82f6;
  --rss-cyan: #06b6d4;
  --rss-green: #10b981;
  --rss-purple: #8b5cf6;
  --rss-red: #ef4444;
  --rss-yellow: #f59e0b;
  --rss-text: #f1f5f9;
  --rss-muted: #64748b;
  background:
    radial-gradient(circle at 78% 0%, rgba(59, 130, 246, 0.12), transparent 34rem),
    radial-gradient(circle at 12% 16%, rgba(6, 182, 212, 0.08), transparent 28rem),
    var(--rss-bg);
  color: var(--rss-text);
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}

body[data-page="Admin-Sources"] .app-main {
  padding-bottom: 100px;
}

.rss-admin-page {
  display: grid;
  gap: 20px;
}

.rss-admin-header,
.rss-form-panel,
.rss-list-panel {
  border: 1px solid var(--rss-border);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent 34%),
    var(--rss-card);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.rss-admin-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
}

.rss-admin-heading,
.rss-panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rss-admin-icon,
.rss-panel-title > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: 14px;
  background: rgba(6, 182, 212, 0.12);
  color: var(--rss-cyan);
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.16);
}

.rss-admin-breadcrumb {
  color: var(--rss-muted);
  font-size: 12px;
  font-weight: 800;
}

.rss-admin-heading h1 {
  margin: 0;
  color: var(--rss-text);
  font-size: 20px;
  font-weight: 900;
}

.rss-admin-heading p {
  max-width: 34rem;
  margin: 0.1rem 0 0;
  overflow: hidden;
  color: #94a3b8;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rss-admin-ghost,
.rss-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(22, 27, 39, 0.56);
  color: #cbd5e1;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.rss-admin-ghost {
  min-height: 32px;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.rss-admin-ghost:hover,
.rss-admin-ghost:focus-visible,
.rss-secondary-button:hover,
.rss-secondary-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.16);
  color: #ffffff;
}

.rss-toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: min(92vw, 26rem);
  padding: 12px 20px;
  border: 1px solid var(--rss-green);
  border-radius: 10px;
  background: #064e3b;
  color: #ecfdf5;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, 0);
  animation: rssToastIn 260ms ease both;
}

.rss-toast.is-hiding {
  animation: rssToastOut 220ms ease both;
}

.rss-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.3fr) minmax(0, 0.7fr);
  gap: 20px;
  align-items: stretch;
}

.rss-form-panel,
.rss-list-panel {
  min-height: 620px;
  padding: 24px;
}

.rss-panel-title {
  align-items: flex-start;
  margin-bottom: 1rem;
}

.rss-panel-title h2 {
  margin: 0;
  color: var(--rss-text);
  font-size: 16px;
  font-weight: 900;
}

.rss-panel-title p {
  max-width: 18rem;
  margin: 0.25rem 0 0;
  color: var(--rss-muted);
  font-size: 12px;
  line-height: 1.7;
}

.rss-source-form {
  display: grid;
  gap: 0.86rem;
}

.rss-field {
  display: grid;
  gap: 0.38rem;
}

.rss-field .field-label,
.rss-label-row .field-label {
  color: var(--rss-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rss-field .field-label.is-required::after,
.rss-label-row .field-label.is-required::after {
  content: " *";
  color: var(--rss-red);
}

.rss-field .field-label span {
  color: var(--rss-muted);
  font-size: 0.72rem;
  letter-spacing: 0;
}

.rss-label-row {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}

.rss-label-row span {
  padding: 0.08rem 0.38rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #94a3b8;
  font-size: 0.62rem;
  font-weight: 900;
}

.rss-field .glass-control,
.rss-filter-select,
.rss-search input {
  min-height: 44px;
  border: 1.5px solid var(--rss-border-strong);
  border-radius: 8px;
  background: var(--rss-input);
  color: var(--rss-text);
}

.rss-field .glass-control:focus,
.rss-filter-select:focus,
.rss-search input:focus {
  border-color: var(--rss-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.rss-input-wrap,
.rss-select-wrap,
.rss-search {
  position: relative;
}

.rss-input-wrap input {
  padding-inline-start: 2.4rem;
}

.rss-input-wrap button {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0.35rem;
  display: grid;
  place-items: center;
  width: 2rem;
  border: 0;
  background: transparent;
  color: #94a3b8;
}

.rss-input-wrap button:hover,
.rss-input-wrap button:focus-visible {
  color: var(--rss-cyan);
}

.rss-input-wrap:has(.is-url-valid)::after {
  content: "✓";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 0.75rem;
  color: var(--rss-green);
  font-weight: 900;
  transform: translateY(-50%);
}

.rss-field .is-url-invalid {
  border-color: var(--rss-red);
}

.rss-url-hint {
  display: none;
  color: var(--rss-red);
  font-size: 11px;
}

.rss-url-hint.is-visible {
  display: block;
}

.rss-select-wrap select {
  padding-inline-start: 2.4rem;
}

.rss-select-wrap [data-rss-category-dot] {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 0.9rem;
  z-index: 2;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: #94a3b8;
  transform: translateY(-50%);
}

.rss-select-wrap [data-rss-category-dot][data-category="ai"] {
  background: var(--rss-purple);
}

.rss-select-wrap [data-rss-category-dot][data-category="technology"],
.rss-select-wrap [data-rss-category-dot][data-category="robotics"] {
  background: var(--rss-blue);
}

.rss-select-wrap [data-rss-category-dot][data-category="business"] {
  background: var(--rss-green);
}

.rss-select-wrap [data-rss-category-dot][data-category="science"] {
  background: var(--rss-yellow);
}

.rss-priority-control {
  display: grid;
  grid-template-columns: 0 36px 48px 36px minmax(70px, 1fr);
  align-items: center;
  gap: 0.4rem;
}

.rss-priority-native {
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.rss-priority-control button,
.rss-priority-number {
  height: 36px;
  border: 1px solid var(--rss-border-strong);
  border-radius: 8px;
  background: var(--rss-input);
  color: var(--rss-text);
  text-align: center;
}

.rss-priority-control button {
  font-weight: 900;
}

.rss-priority-control button:hover {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.14);
}

.rss-priority-control [data-rss-priority-label] {
  width: fit-content;
  padding: 0.24rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 900;
}

.rss-field textarea {
  min-height: 80px;
  resize: vertical;
}

.rss-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 800;
}

.rss-checkbox-row input {
  float: none;
  width: 1rem;
  height: 1rem;
  margin: 0;
  border-color: var(--rss-border-strong);
  background-color: var(--rss-input);
}

.rss-form-actions {
  display: grid;
  gap: 8px;
  margin-top: 0.2rem;
}

.rss-primary-button,
.rss-secondary-button {
  width: 100%;
  border-radius: 8px;
  font-weight: 900;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.rss-primary-button {
  min-height: 44px;
  border: 0;
  background: var(--rss-blue);
  color: #ffffff;
}

.rss-secondary-button {
  min-height: 36px;
}

.rss-primary-button:hover,
.rss-primary-button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
}

.rss-list-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 190px);
  min-width: 0;
  overflow: hidden;
}

.rss-list-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rss-border);
}

.rss-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.rss-title-row h2 {
  margin: 0;
  color: var(--rss-text);
  font-size: 1.35rem;
  font-weight: 900;
}

.rss-title-row span {
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  color: #bfdbfe;
  font-size: 0.72rem;
  font-weight: 900;
}

.rss-list-header p {
  margin: 0.35rem 0 0;
  color: var(--rss-muted);
  font-size: 12px;
  font-style: italic;
}

.rss-list-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rss-search {
  display: flex;
  align-items: center;
  min-width: min(100%, 18rem);
}

.rss-search span {
  position: absolute;
  inset-inline-end: 0.85rem;
  color: #94a3b8;
}

.rss-search input {
  width: 100%;
  padding-inline: 2.2rem 0.9rem;
}

.rss-filter-select {
  min-width: 9rem;
  padding-inline: 0.8rem;
}

.rss-category-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.9rem 0 0.75rem;
  scrollbar-width: thin;
}

.rss-category-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(22, 27, 39, 0.58);
  color: #94a3b8;
  padding: 0.32rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 900;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rss-category-tabs button:hover,
.rss-category-tabs button.is-active {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.22);
  color: #ffffff;
}

.rss-source-list {
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-inline-end: 6px;
  scrollbar-color: rgba(59, 130, 246, 0.62) rgba(15, 21, 32, 0.72);
  scrollbar-width: thin;
}

.rss-source-list::-webkit-scrollbar {
  width: 8px;
}

.rss-source-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(15, 21, 32, 0.72);
}

.rss-source-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(15, 21, 32, 0.72);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.72);
}

.rss-source-list::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.78);
}

.rss-source-card {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 0.78rem;
  align-items: start;
  padding: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: var(--rss-row);
  animation: rssCardIn 260ms ease both;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.rss-source-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.28);
  background: var(--rss-hover);
}

.rss-source-icon {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rss-blue), var(--rss-purple));
  color: #ffffff;
  font-weight: 900;
}

.rss-source-card.is-ai .rss-source-icon {
  background: linear-gradient(135deg, var(--rss-purple), #c084fc);
}

.rss-source-card.is-tech .rss-source-icon {
  background: linear-gradient(135deg, var(--rss-blue), var(--rss-cyan));
}

.rss-source-card.is-business .rss-source-icon {
  background: linear-gradient(135deg, var(--rss-green), #22c55e);
}

.rss-source-card.is-science .rss-source-icon {
  background: linear-gradient(135deg, var(--rss-yellow), #fb923c);
}

.rss-source-icon img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: #ffffff;
  object-fit: cover;
}

.rss-source-content {
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}

.rss-source-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.rss-source-top h3 {
  margin: 0;
  color: var(--rss-text);
  font-family: "JetBrains Mono", "IBM Plex Sans Arabic", monospace;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.rss-source-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.rss-category-badge,
.rss-status-badge,
.rss-priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.rss-category-badge {
  border: 1px solid rgba(139, 92, 246, 0.34);
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd;
}

.rss-category-badge.is-tech {
  border-color: rgba(59, 130, 246, 0.34);
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

.rss-category-badge.is-business {
  border-color: rgba(16, 185, 129, 0.34);
  background: rgba(16, 185, 129, 0.14);
  color: #86efac;
}

.rss-category-badge.is-science {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
}

.rss-status-badge.is-active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--rss-green);
}

.rss-status-badge.is-paused,
.rss-priority-badge {
  background: rgba(100, 116, 139, 0.14);
  color: #94a3b8;
}

.rss-source-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.65;
}

.rss-source-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: #64748b;
  font-size: 11px;
  flex-wrap: wrap;
}

.rss-source-meta a {
  max-width: min(100%, 26rem);
  overflow: hidden;
  color: #64748b;
  font-family: "JetBrains Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rss-source-meta a:hover,
.rss-source-meta a:focus-visible {
  color: var(--rss-cyan);
}

.rss-card-actions {
  position: relative;
}

.rss-menu-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(22, 27, 39, 0.72);
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.rss-source-card:hover .rss-menu-button,
.rss-menu-button:focus-visible,
.rss-action-menu.is-open + .rss-menu-button {
  opacity: 1;
}

.rss-menu-button:hover,
.rss-menu-button:focus-visible {
  background: rgba(59, 130, 246, 0.16);
  color: #ffffff;
}

.rss-action-menu {
  position: absolute;
  inset-block-start: calc(100% + 0.4rem);
  inset-inline-start: 0;
  z-index: 20;
  min-width: 9rem;
  display: none;
  padding: 0.35rem;
  border: 1px solid var(--rss-border);
  border-radius: 10px;
  background: #0b1220;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
}

.rss-action-menu.is-open {
  display: grid;
  gap: 0.25rem;
}

.rss-action-menu a,
.rss-action-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.rss-action-menu a:hover,
.rss-action-menu button:hover {
  background: rgba(59, 130, 246, 0.14);
  color: #ffffff;
}

.rss-empty-state {
  display: none;
  justify-items: center;
  gap: 0.35rem;
  min-height: 18rem;
  padding: 3rem 1rem;
  color: #94a3b8;
  text-align: center;
}

.rss-empty-state.is-visible {
  display: grid;
}

.rss-empty-state span {
  font-size: 2.4rem;
  opacity: 0.55;
}

.rss-empty-state strong {
  color: var(--rss-text);
}

.rss-empty-state p {
  margin: 0;
  color: var(--rss-muted);
  font-size: 0.86rem;
}

@keyframes rssCardIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rssToastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 18px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes rssToastOut {
  to {
    opacity: 0;
    transform: translate(-50%, 18px);
  }
}

@media (max-width: 1199px) {
  .rss-admin-grid {
    grid-template-columns: 1fr;
  }

  .rss-form-panel,
  .rss-list-panel {
    min-height: auto;
  }
}

@media (max-width: 767px) {
  .rss-admin-header,
  .rss-list-header,
  .rss-source-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .rss-list-tools,
  .rss-search,
  .rss-filter-select {
    width: 100%;
  }

  .rss-form-panel,
  .rss-list-panel {
    padding: 1rem;
  }

  .rss-source-card {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .rss-card-actions {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .rss-menu-button {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Responsive stability layer: preserves the existing visual system while
   protecting shared layouts from narrow viewports and long RTL content. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

.page-shell,
.app-main,
.topbar-inner,
.footer-inner,
.panel,
.section-panel,
.article-card,
.analytics-card,
.identity-card,
.identity-aside,
.rss-form-panel,
.rss-list-panel,
.ai-provider-sidebar,
.ai-provider-main,
.ai-form-section,
.pipeline-monitor,
.pipeline-card {
  min-width: 0;
}

.table-shell,
.user-table-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-shell table,
.user-table-shell table {
  margin-bottom: 0;
}

.line-chart-shell,
.analytics-line-chart,
.official-line-chart {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.analytics-card canvas,
.analytics-card svg {
  display: block;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 1441px) {
  .container-xxl {
    width: min(100% - 3rem, 1480px);
    max-width: 1480px;
  }

  .home-stats-ribbon,
  .home-category-filter,
  .home-editorial-grid {
    padding-inline: max(24px, calc((100vw - 1480px) / 2));
  }
}

@media (max-width: 1200px) {
  .metrics-grid,
  .homepage-intel-grid,
  .category-growth-grid,
  .analytics-grid-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-config-grid,
  .detail-grid,
  .analytics-grid,
  .ai-provider-shell,
  .rss-admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-inner {
    display: grid;
    grid-template-columns: auto minmax(44px, 1fr) auto;
    min-height: 60px;
    gap: 0.6rem;
  }

  .topbar-divider {
    display: none;
  }

  .mobile-nav-toggle {
    display: inline-block;
    justify-self: center;
  }

  .topnav {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #1e2738;
    border-radius: 14px;
    background: #0f1520;
  }

  body.nav-open .topnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topnav-dropdown {
    position: static;
  }

  .topnav-menu {
    position: static;
    display: none;
    width: 100%;
    min-width: 0;
    margin-top: 0.45rem;
    padding: 0.55rem;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }

  .topnav-dropdown.is-open .topnav-menu {
    display: grid;
    transform: none;
  }

  .home-hero-story {
    min-height: clamp(32rem, 65svh, 40rem);
  }
}

@media (max-width: 1399px) {
  .command-button {
    width: 44px;
    justify-content: center;
  }

  .command-button span {
    display: none;
  }
}

@media (max-width: 992px) {
  .topbar-inner {
    grid-template-columns: auto minmax(44px, 1fr) auto;
    width: calc(100% - 1.5rem);
    max-width: calc(100% - 1.5rem);
    min-width: 0;
  }

  .brandmark,
  .topbar-actions {
    min-width: 0;
  }

  .topbar-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  .account-chip {
    display: inline-flex;
  }

  .logout-form {
    display: block;
  }

  body.nav-open .topnav {
    max-height: calc(100dvh - 7rem);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .topnav-dropdown.is-open .topnav-menu {
    display: grid;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .topnav-link,
  .topnav-trigger,
  .topnav-menu-link {
    min-height: 44px;
  }

  .identity-grid,
  .identity-grid-compact,
  .user-edit-grid,
  .ai-provider-sidebar,
  .ai-field-grid,
  .pipeline-grid,
  .lower-grid,
  .workers-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-field-wide-md,
  .ai-field-full {
    grid-column: auto;
  }

  .source-comparison-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 1rem;
  }
}

@media (max-width: 768px) {
  .container-xxl,
  .app-main {
    width: 100%;
    max-width: 100%;
    padding-inline: 0.75rem;
  }

  .topbar {
    padding-inline: 0;
  }

  .topbar-inner {
    width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
    padding-inline: 0.65rem;
  }

  body.nav-open .topnav {
    grid-template-columns: minmax(0, 1fr);
  }

  .topnav-menu,
  .mega-menu {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-icon-button,
  .topbar-login-link,
  .mobile-nav-toggle,
  .command-button {
    min-width: 44px;
    min-height: 44px;
  }

  .hero-panel,
  .compact-hero,
  .admin-header,
  .rss-admin-header,
  .ai-provider-header,
  .daily-brief-header,
  .official-session-row,
  .section-heading,
  .search-summary {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
    flex-direction: column;
  }

  .hero-actions,
  .admin-actions,
  .pipeline-actions,
  .ai-secondary-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions > *,
  .admin-actions > *,
  .pipeline-actions > *,
  .ai-secondary-actions > * {
    width: 100%;
  }

  .hero-actions button,
  .hero-actions a,
  .admin-actions button,
  .pipeline-actions button,
  .ai-secondary-actions button,
  .ai-secondary-actions a {
    width: 100%;
    min-height: 44px;
  }

  .filter-grid,
  .user-form-grid,
  .ai-field-grid,
  .narrative-source-grid,
  .narrative-insight-grid,
  .digest-story-grid,
  .metrics-grid,
  .homepage-intel-grid,
  .category-growth-grid,
  .analytics-grid-three {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-control,
  .form-select,
  textarea,
  select,
  input:not([type="checkbox"]):not([type="radio"]) {
    max-width: 100%;
    min-height: 44px;
  }

  .compact-hero .hero-filters,
  .compact-hero .hero-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .compact-hero #news-q,
  .compact-hero #news-date,
  .compact-hero .glass-control,
  .compact-hero .btn-neo {
    width: 100%;
    height: 44px;
    min-height: 44px;
  }

  .home-stats-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-category-filter {
    height: 56px;
    overflow: hidden;
  }

  .home-category-track {
    flex-wrap: nowrap;
    white-space: nowrap;
    scroll-snap-type: inline proximity;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to left, transparent, #000 1rem, #000 calc(100% - 1rem), transparent);
  }

  .home-category-pill {
    min-height: 40px;
    scroll-snap-align: start;
  }

  .home-hero-story {
    min-height: clamp(35rem, 88svh, 44rem);
  }

  .home-hero-content,
  .home-hero-empty {
    width: 100%;
    max-width: none;
    padding: 1rem;
    padding-block-end: 5.25rem;
  }

  .home-hero-content h1,
  .home-hero-empty h1 {
    max-width: 100%;
    font-size: clamp(1.45rem, 6.5vw, 2.25rem);
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .home-hero-content p,
  .home-hero-empty p {
    max-width: 100%;
    font-size: clamp(0.82rem, 3.4vw, 0.95rem);
    line-height: 1.75;
  }

  .home-hero-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 0.6rem;
  }

  .home-hero-footer a {
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }

  .home-feed-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 6px 10px;
  }

  .home-panel-header {
    min-width: 0;
    flex-wrap: wrap;
  }

  .home-latest-rail {
    scroll-padding-inline: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .news-list-shell .article-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.75rem;
  }

  .news-list-shell .article-card,
  .news-list-shell .article-grid > .article-card:first-of-type {
    height: auto;
    min-height: 0;
  }

  .news-list-shell .article-card .card-content,
  .news-list-shell .article-grid > .article-card:first-of-type .card-content {
    width: 100%;
    height: auto;
    min-height: 10.5rem;
    padding: 0.75rem 0.875rem 1rem;
  }

  .news-list-shell .article-card .card-title {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    line-height: 1.6;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .news-list-shell .article-grid > .article-card:first-of-type .card-title {
    font-size: clamp(1rem, 5vw, 1.25rem);
    -webkit-line-clamp: 3;
  }

  .news-list-shell .article-card .card-meta {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .news-list-shell .article-card .card-meta-right {
    max-width: 100%;
  }

  .news-list-shell .article-card .card-read-more {
    min-width: 44px;
    min-height: 44px;
  }

  .news-pagination {
    width: 100%;
    overflow: hidden;
  }

  .pagination-pages {
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 0.25rem;
    scroll-padding-inline: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .pagination-link {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  .official-heatmap-card,
  .heatmap-shell {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .heatmap-row {
    min-width: 25rem;
  }

  .analytics-card,
  .narrative-card,
  .digest-story-card,
  .identity-aside,
  .identity-card {
    padding: 1rem;
  }

  .sentiment-pie {
    width: min(11rem, 70vw);
  }

  .command-palette {
    align-items: start;
    padding: 0.75rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    overflow-y: auto;
  }

  .command-panel {
    max-height: calc(100dvh - 1.5rem);
    overflow-y: auto;
  }

  .command-search,
  .command-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .command-search button,
  .command-links a {
    min-height: 44px;
  }

  .rss-list-panel {
    max-height: none;
    overflow: visible;
  }

  .rss-list-tools,
  .rss-search,
  .rss-filter-select,
  .priority-stepper {
    width: 100%;
    max-width: 100%;
  }

  .ai-toggle-grid,
  .ai-secondary-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-priority-row {
    grid-template-columns: 2.35rem minmax(0, 1fr) auto;
  }

  .ai-priority-model,
  .ai-priority-api {
    display: none;
  }

  .pipeline-header,
  .pipeline-card-heading,
  .pipeline-toolbar,
  .user-table-header,
  .user-selected-header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .topbar {
    padding-block: 0.45rem;
  }

  .topbar-inner {
    gap: 0.35rem;
    padding: 0.5rem;
    border-radius: 22px;
  }

  .command-button {
    display: none;
  }

  .account-chip-name,
  .account-chip-role,
  .account-chevron {
    display: none;
  }

  .account-chip {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0.25rem;
  }

  .account-avatar {
    width: 34px;
    height: 34px;
  }

  .topbar-actions {
    gap: 0.3rem;
  }

  .topbar-icon-button,
  .topbar-login-link {
    width: 44px;
    height: 44px;
  }

  .topbar-login-link {
    width: auto;
    max-width: 6.5rem;
    padding-inline: 0.65rem;
    line-height: 1.25;
    text-align: center;
  }

  .home-editorial-grid,
  .home-stats-ribbon,
  .home-category-filter {
    padding-inline: 0.75rem;
  }

  .home-live-feed,
  .home-topic-column,
  .home-latest-strip {
    padding: 0.75rem;
  }

  .home-feed-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    padding: 0.7rem;
    direction: rtl;
  }

  .home-feed-row .source-avatar {
    grid-column: 2;
    grid-row: 1;
  }

  .home-feed-meta,
  .home-feed-row strong,
  .home-feed-row small {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .home-feed-meta {
    grid-row: 1;
    padding-inline-end: 2.25rem;
  }

  .home-feed-row strong {
    grid-row: 2;
  }

  .home-feed-row small {
    grid-row: 3;
    text-align: start;
  }

  .home-latest-card {
    flex-basis: min(82vw, 240px);
    width: min(82vw, 240px);
  }

  .home-hero-controls .home-slider-dots {
    justify-content: center;
    max-width: calc(100% - 96px);
    padding: 0;
  }

  .home-hero-controls .home-slider-dot,
  .home-hero-controls .home-slider-dot.is-active {
    position: relative;
    width: 18px;
    min-width: 18px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: transparent;
  }

  .home-hero-controls .home-slider-dot.is-active {
    width: 36px;
    min-width: 36px;
  }

  .home-hero-controls .home-slider-dot::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    transition: width 0.2s ease, background-color 0.2s ease;
  }

  .home-hero-controls .home-slider-dot.is-active::after {
    width: 24px;
    background: #ffffff;
  }

  .home-hero-controls .dot-label,
  .home-hero-controls .dot-breaking {
    display: none;
  }

  .article-footer,
  .card-meta,
  .bar-row-label,
  .source-split,
  .narrative-card-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .user-form-actions,
  .user-row-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .user-form-actions > *,
  .user-row-actions > * {
    min-height: 44px;
  }

  .pipeline-monitor,
  .pipeline-card,
  .rss-form-panel,
  .rss-list-panel,
  .ai-form-section,
  .ai-sidebar-card,
  .ai-priority-card {
    padding: 0.875rem;
  }

  .ops-bottom-dock {
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .ops-bottom-dock::-webkit-scrollbar {
    display: none;
  }

  .ops-bottom-dock a {
    flex: 1 0 52px;
    width: auto;
    min-width: 52px;
  }

  .icon-button {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (min-width: 577px) and (max-width: 900px) {
  .news-list-shell .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 400px) {
  .brandmark-copy {
    display: none;
  }

  .brandmark {
    min-width: 44px;
    justify-content: center;
  }

  .topbar-inner {
    grid-template-columns: 44px minmax(44px, 1fr) auto;
  }

  .topbar-login-link {
    max-width: 5.25rem;
    padding-inline: 0.45rem;
    font-size: 0.68rem;
  }

  .home-stats-ribbon {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-stat-tile + .home-stat-tile {
    border-inline-start: 0;
    border-top: 1px solid rgba(30, 39, 56, 0.9);
  }

  .home-hero-story {
    min-height: 36rem;
  }

  .home-hero-badges {
    inset-block-start: 12px;
    inset-inline: 12px;
  }

  .home-hero-content h1,
  .home-hero-empty h1 {
    font-size: clamp(1.3rem, 7vw, 1.7rem);
  }

  .home-hero-content p,
  .home-hero-empty p {
    -webkit-line-clamp: 2;
  }

  .home-hero-controls {
    inset-inline: 10px;
  }

  .compact-hero,
  .panel,
  .section-panel {
    border-radius: 12px;
  }

  .analytics-card,
  .narrative-card,
  .digest-story-card,
  .identity-aside,
  .identity-card {
    padding: 0.8rem;
  }

  .heatmap-row {
    min-width: 23rem;
    grid-template-columns: 7.5rem minmax(0, 1fr);
  }

  .ops-dock-label {
    max-width: 48px;
    font-size: 9px;
  }
}

/* Complete light-theme coverage for late, page-specific dark design layers. */
html[data-theme="light"] body {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.06), transparent 25rem),
    radial-gradient(circle at 78% 0%, rgba(14, 165, 233, 0.1), transparent 34rem),
    radial-gradient(circle at 12% 10%, rgba(139, 92, 246, 0.07), transparent 30rem),
    var(--bg);
}

html[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(15, 30, 55, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 30, 55, 0.03) 1px, transparent 1px);
}

html[data-theme="light"] .ambient-grid {
  background:
    linear-gradient(110deg, transparent 0 42%, rgba(14, 116, 144, 0.04) 48%, transparent 54%),
    linear-gradient(20deg, transparent 0 58%, rgba(124, 58, 237, 0.035) 62%, transparent 70%);
}

html[data-theme="light"] .topbar {
  border-bottom-color: #d7e0ec;
  background: rgba(248, 251, 255, 0.9);
  box-shadow: 0 1px 0 #d7e0ec, 0 4px 24px rgba(30, 64, 175, 0.08);
}

html[data-theme="light"] .brandmark-title,
html[data-theme="light"] .topnav-menu-link strong,
html[data-theme="light"] .account-chip-name {
  color: #0f172a;
}

html[data-theme="light"] .topbar-divider {
  background: #d7e0ec;
}

html[data-theme="light"] .topnav-link,
html[data-theme="light"] .topnav-trigger,
html[data-theme="light"] .account-chevron {
  color: #526176;
}

html[data-theme="light"] .topnav-link:hover,
html[data-theme="light"] .topnav-link:focus-visible,
html[data-theme="light"] .topnav-dropdown:focus-within .topnav-trigger,
html[data-theme="light"] .topnav-dropdown:hover .topnav-trigger,
html[data-theme="light"] .topnav-link.is-active {
  background: rgba(59, 130, 246, 0.1);
  color: #0f172a;
}

html[data-theme="light"] .topnav-menu,
html[data-theme="light"] .command-panel {
  border-color: #d7e0ec;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 52px rgba(30, 64, 175, 0.14);
}

html[data-theme="light"] .topnav-menu-link {
  color: #334155;
}

html[data-theme="light"] .topnav-menu-link:hover,
html[data-theme="light"] .topnav-menu-link:focus-visible {
  background: #edf3fb;
  color: #0f172a;
}

html[data-theme="light"] .command-button,
html[data-theme="light"] .account-chip,
html[data-theme="light"] .topbar-icon-button,
html[data-theme="light"] .topbar-login-link {
  border-color: #cbd7e6;
  background: rgba(255, 255, 255, 0.82);
  color: #334155;
}

html[data-theme="light"] .command-button:hover,
html[data-theme="light"] .command-button:focus-visible,
html[data-theme="light"] .topbar-icon-button:hover,
html[data-theme="light"] .topbar-icon-button:focus-visible,
html[data-theme="light"] .topbar-login-link:hover,
html[data-theme="light"] .topbar-login-link:focus-visible {
  background: #e8f1ff;
  color: #0f172a;
}

html[data-theme="light"] .glass-control,
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select {
  border-color: #cbd7e6;
  background-color: #ffffff;
  color: #172033;
}

html[data-theme="light"] .glass-control:focus,
html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus {
  background-color: #ffffff;
  color: #172033;
}

html[data-theme="light"] .btn-soft,
html[data-theme="light"] .pagination-link,
html[data-theme="light"] .search-clear-link {
  border-color: #cbd7e6;
  color: #172033;
}

html[data-theme="light"] .table-shell,
html[data-theme="light"] .app-table,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .identity-tip,
html[data-theme="light"] .security-code-block,
html[data-theme="light"] .recovery-code {
  border-color: #d7e0ec;
  background: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] body[data-page="Home-Index"] {
  --home-bg: #f4f7fb;
  --home-card: #ffffff;
  --home-card-hover: #edf3fb;
  --home-border: #d7e0ec;
  --home-border-strong: #c0ccdc;
  --home-text: #172033;
  --home-muted: #65758b;
  background:
    radial-gradient(circle at 86% 0%, rgba(59, 130, 246, 0.09), transparent 32rem),
    radial-gradient(circle at 10% 14%, rgba(139, 92, 246, 0.06), transparent 28rem),
    var(--home-bg);
  color: var(--home-text);
}

html[data-theme="light"] .homepage-command-system {
  background: var(--home-bg);
}

html[data-theme="light"] .home-stats-ribbon {
  border-color: var(--home-border);
  background: #eef3f9;
}

html[data-theme="light"] .home-stat-tile {
  color: var(--home-text);
}

html[data-theme="light"] .home-stat-tile + .home-stat-tile {
  border-color: var(--home-border);
}

html[data-theme="light"] .home-stat-tile span,
html[data-theme="light"] .home-panel-header a,
html[data-theme="light"] .home-panel-header small,
html[data-theme="light"] .home-feed-meta,
html[data-theme="light"] .home-feed-row small,
html[data-theme="light"] .card-source,
html[data-theme="light"] .card-score,
html[data-theme="light"] .home-latest-card.latest-card .latest-card-time {
  color: var(--home-muted);
}

html[data-theme="light"] .home-stat-tile strong,
html[data-theme="light"] .home-panel-header h2,
html[data-theme="light"] .home-feed-row strong,
html[data-theme="light"] .home-topic-list,
html[data-theme="light"] .home-compact-item,
html[data-theme="light"] .home-latest-card.latest-card .latest-card-title {
  color: var(--home-text);
}

html[data-theme="light"] .home-category-filter {
  border-color: var(--home-border);
  background:
    linear-gradient(90deg, var(--home-bg) 0, transparent 7%, transparent 93%, var(--home-bg) 100%),
    var(--home-bg);
}

html[data-theme="light"] .home-category-pill {
  border-color: var(--home-border);
  color: #526176;
}

html[data-theme="light"] .home-live-feed,
html[data-theme="light"] .home-topic-column,
html[data-theme="light"] .home-latest-strip,
html[data-theme="light"] .home-latest-card.latest-card {
  border-color: var(--home-border);
  background: var(--home-card);
}

html[data-theme="light"] .home-feed-row {
  border-color: #dce5f0;
  background: #f7f9fc;
  color: var(--home-text);
}

html[data-theme="light"] .home-feed-row.category-politics,
html[data-theme="light"] .home-feed-row.category-sports,
html[data-theme="light"] .home-feed-row.category-world,
html[data-theme="light"] .home-feed-row.category-science,
html[data-theme="light"] .home-feed-row.category-ai,
html[data-theme="light"] .home-feed-row.category-technology,
html[data-theme="light"] .home-feed-row.category-business,
html[data-theme="light"] .home-feed-row.category-robotics,
html[data-theme="light"] .home-feed-row.category-health,
html[data-theme="light"] .home-feed-row.category-entertainment {
  background: #f7f9fc !important;
  color: var(--home-text) !important;
}

html[data-theme="light"] .home-feed-row:hover,
html[data-theme="light"] .home-feed-row:focus-visible,
html[data-theme="light"] .home-topic-list a:hover,
html[data-theme="light"] .home-topic-list a:focus-visible,
html[data-theme="light"] .home-compact-item:hover,
html[data-theme="light"] .home-compact-item:focus-visible {
  background: var(--home-card-hover);
}

html[data-theme="light"] .home-topic-list a {
  color: #334155;
}

html[data-theme="light"] .latest-card-desc {
  color: #65758b;
}

html[data-theme="light"] .latest-card-image,
html[data-theme="light"] .home-latest-card.latest-card > div.latest-card-image {
  background: #e8eef7;
}

html[data-theme="light"] .latest-news-wrapper::before {
  background: linear-gradient(to left, var(--home-bg), transparent);
}

html[data-theme="light"] .latest-news-wrapper::after {
  background: linear-gradient(to right, var(--home-bg), transparent);
}

html[data-theme="light"] .scroll-btn {
  border-color: var(--home-border-strong);
  background: #ffffff;
  color: #334155;
}

html[data-theme="light"] .article-card,
html[data-theme="light"] .news-list-shell .article-grid > .article-card:first-of-type,
html[data-theme="light"] .skeleton-card {
  border-color: #d7e0ec;
  background: #ffffff;
}

html[data-theme="light"] .news-list-shell .article-card .card-title,
html[data-theme="light"] .news-list-shell .article-card:hover .card-title,
html[data-theme="light"] .compact-hero .hero-copy h1 {
  color: #172033;
}

html[data-theme="light"] .news-list-shell .article-card .card-description,
html[data-theme="light"] .list-header-meta,
html[data-theme="light"] .compact-hero .list-breadcrumb a,
html[data-theme="light"] .pagination-state {
  color: #65758b;
}

html[data-theme="light"] .pagination-link:hover,
html[data-theme="light"] .pagination-link:focus-visible {
  background: #e8eef7;
  color: #172033;
}

html[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, #e8eef7 25%, #f7f9fc 50%, #e8eef7 75%);
  background-size: 200% 100%;
}

html[data-theme="light"] .classification-bar {
  background: #fff1f2;
  color: #b4233b;
}

html[data-theme="light"] .official-print-button,
html[data-theme="light"] .official-priority-card,
html[data-theme="light"] .official-card-actions button,
html[data-theme="light"] .official-card-actions a,
html[data-theme="light"] .narrative-score-box,
html[data-theme="light"] .heatmap-cell.heat-level-1 {
  border-color: #d7e0ec;
  background: #ffffff;
  color: #172033;
}

html[data-theme="light"] .official-intel-hero,
html[data-theme="light"] .daily-brief-header {
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.06), transparent 40%),
    #ffffff;
}

html[data-theme="light"] .daily-brief-header h1,
html[data-theme="light"] .priority-ribbon,
html[data-theme="light"] .official-priority-card h2,
html[data-theme="light"] .official-context-card strong,
html[data-theme="light"] .official-recommendation strong,
html[data-theme="light"] .official-position-card strong,
html[data-theme="light"] .official-interpretation strong,
html[data-theme="light"] .official-week-row strong,
html[data-theme="light"] .source-verdict-card header strong,
html[data-theme="light"] .narrative-score-box strong {
  color: #172033;
}

html[data-theme="light"] .daily-brief-header p,
html[data-theme="light"] .daily-brief-header small,
html[data-theme="light"] .official-priority-card p,
html[data-theme="light"] .official-context-card span,
html[data-theme="light"] .official-recommendation span,
html[data-theme="light"] .official-position-card p,
html[data-theme="light"] .official-interpretation span,
html[data-theme="light"] .official-week-row span,
html[data-theme="light"] .official-week-row small,
html[data-theme="light"] .official-week-row em {
  color: #526176;
}

html[data-theme="light"] .official-context-card,
html[data-theme="light"] .official-recommendation,
html[data-theme="light"] .official-position-card,
html[data-theme="light"] .official-interpretation,
html[data-theme="light"] .official-week-row,
html[data-theme="light"] .source-verdict-card,
html[data-theme="light"] .official-confidence-note {
  border-color: #d7e0ec;
  background: #f7f9fc;
}

html[data-theme="light"] body[data-page="Admin-Index"] {
  --ops-bg: #f4f7fb;
  --ops-card: #ffffff;
  --ops-card-alt: #f7f9fc;
  --ops-card-alt-2: #edf3fb;
  --ops-border: #d7e0ec;
  --ops-text: #172033;
  --ops-muted: #65758b;
  background:
    radial-gradient(circle at 74% 0%, rgba(59, 130, 246, 0.09), transparent 34rem),
    radial-gradient(circle at 12% 12%, rgba(139, 92, 246, 0.06), transparent 30rem),
    var(--ops-bg);
}

html[data-theme="light"] body[data-page="Admin-Index"] .topbar-inner {
  border-color: var(--ops-border);
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .ops-bottom-dock {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 32px rgba(30, 64, 175, 0.14);
}

html[data-theme="light"] .ops-bottom-dock a::before {
  border-color: #d7e0ec;
  background: #ffffff;
  color: #172033;
}

html[data-theme="light"] .ops-hero-copy p,
html[data-theme="light"] .ops-log-row time,
html[data-theme="light"] .ops-log-counters {
  color: var(--ops-muted);
}

html[data-theme="light"] .ops-service-row,
html[data-theme="light"] .ops-action-link,
html[data-theme="light"] .ops-log-pagination button {
  background: #f7f9fc;
}

html[data-theme="light"] .ops-service-row.is-empty {
  background: #fbfcfe;
}

html[data-theme="light"] .ops-log-terminal,
html[data-theme="light"] .ops-log-terminal::-webkit-scrollbar-track {
  background: #eef3f9;
  scrollbar-color: var(--ops-blue) #eef3f9;
}

html[data-theme="light"] .ops-log-terminal::-webkit-scrollbar-thumb {
  border-color: #eef3f9;
}

html[data-theme="light"] .ops-log-row:nth-child(odd) {
  background: var(--ops-card-alt);
}

html[data-theme="light"] .ops-log-row:nth-child(even) {
  background: var(--ops-card-alt-2);
}

html[data-theme="light"] body[data-page="Admin-Users"] {
  --user-bg: #f4f7fb;
  --user-card: #ffffff;
  --user-input: #f7f9fc;
  --user-alt: #fbfcfe;
  --user-border: #d7e0ec;
  --user-border-strong: #c0ccdc;
  --user-text: #172033;
  --user-muted: #65758b;
  background:
    radial-gradient(circle at 72% 0%, rgba(59, 130, 246, 0.09), transparent 34rem),
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.06), transparent 26rem),
    var(--user-bg);
}

html[data-theme="light"] body[data-page="Admin-Users"] .user-admin-heading p,
html[data-theme="light"] body[data-page="Admin-Users"] .user-detail-strip,
html[data-theme="light"] body[data-page="Admin-Users"] .user-person-cell small,
html[data-theme="light"] body[data-page="Admin-Users"] .user-email,
html[data-theme="light"] body[data-page="Admin-Users"] .user-strength-label {
  color: #65758b;
}

html[data-theme="light"] body[data-page="Admin-Users"] .user-admin-ghost,
html[data-theme="light"] body[data-page="Admin-Users"] .user-action-button,
html[data-theme="light"] body[data-page="Admin-Users"] .user-secondary-wide,
html[data-theme="light"] body[data-page="Admin-Users"] .user-detail-strip {
  border-color: var(--user-border);
  background: #f7f9fc;
  color: #334155;
}

html[data-theme="light"] body[data-page="Admin-Users"] .user-admin-table tbody tr {
  border-color: #e5ebf3;
}

html[data-theme="light"] body[data-page="Security-Index"] {
  --security-bg: #f4f7fb;
  --security-card: #ffffff;
  --security-input: #f7f9fc;
  --security-border: #d7e0ec;
  --security-border-strong: #c0ccdc;
  --security-text: #172033;
  --security-muted: #65758b;
  background:
    linear-gradient(rgba(15, 30, 55, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 30, 55, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, #ffffff 0%, #f4f7fb 58%, #edf3fb 100%);
}

html[data-theme="light"] body[data-page="Security-Index"] .security-stepper span,
html[data-theme="light"] body[data-page="Security-Index"] .security-shield,
html[data-theme="light"] body[data-page="Security-Index"] .security-app-pills span,
html[data-theme="light"] body[data-page="Security-Index"] .security-enabled-card > div,
html[data-theme="light"] body[data-page="Security-Index"] .security-secondary-button,
html[data-theme="light"] body[data-page="Security-Index"] .security-tips-card {
  border-color: var(--security-border);
  background: #f7f9fc;
}

html[data-theme="light"] body[data-page="Security-Index"] .security-setup-header p,
html[data-theme="light"] body[data-page="Security-Index"] .security-qr-shell > span,
html[data-theme="light"] body[data-page="Security-Index"] .security-tip-row p,
html[data-theme="light"] body[data-page="Security-Index"] .security-recovery-panel p {
  color: #65758b;
}

html[data-theme="light"] body[data-page="Admin-Sources"] {
  --rss-bg: #f4f7fb;
  --rss-card: #ffffff;
  --rss-row: #f7f9fc;
  --rss-hover: #edf3fb;
  --rss-input: #ffffff;
  --rss-border: #d7e0ec;
  --rss-border-strong: #c0ccdc;
  --rss-text: #172033;
  --rss-muted: #65758b;
  background:
    radial-gradient(circle at 78% 0%, rgba(59, 130, 246, 0.09), transparent 34rem),
    radial-gradient(circle at 12% 16%, rgba(6, 182, 212, 0.06), transparent 28rem),
    var(--rss-bg);
}

html[data-theme="light"] body[data-page="Admin-Sources"] .rss-admin-heading p,
html[data-theme="light"] body[data-page="Admin-Sources"] .rss-source-description,
html[data-theme="light"] body[data-page="Admin-Sources"] .rss-source-meta,
html[data-theme="light"] body[data-page="Admin-Sources"] .rss-source-meta a {
  color: #65758b;
}

html[data-theme="light"] body[data-page="Admin-Sources"] .rss-admin-ghost,
html[data-theme="light"] body[data-page="Admin-Sources"] .rss-secondary-button,
html[data-theme="light"] body[data-page="Admin-Sources"] .rss-category-tabs button,
html[data-theme="light"] body[data-page="Admin-Sources"] .rss-menu-button {
  border-color: var(--rss-border);
  background: #f7f9fc;
  color: #526176;
}

html[data-theme="light"] body[data-page="Admin-Sources"] .rss-action-menu {
  border-color: var(--rss-border);
  background: #ffffff;
}

html[data-theme="light"] body[data-page="Admin-Sources"] .rss-action-menu a,
html[data-theme="light"] body[data-page="Admin-Sources"] .rss-action-menu button {
  color: #334155;
}

html[data-theme="light"] body[data-page="Admin-Sources"] .rss-source-list {
  scrollbar-color: rgba(59, 130, 246, 0.62) #edf3fb;
}

html[data-theme="light"] body[data-page="Admin-Sources"] .rss-source-list::-webkit-scrollbar-track {
  background-color: #edf3fb;
}

html[data-theme="light"] body[data-page="Admin-Sources"] .rss-source-list::-webkit-scrollbar-thumb {
  border-color: #edf3fb;
  background-color: rgba(59, 130, 246, 0.72);
}

html[data-theme="light"] .ai-provider-admin {
  --ai-bg: #f4f7fb;
  --ai-card: #ffffff;
  --ai-card-soft: #f7f9fc;
  --ai-border: #d7e0ec;
  --ai-border-soft: rgba(192, 204, 220, 0.8);
  --ai-label: #65758b;
  --ai-text: #172033;
  --ai-muted: #65758b;
  border-color: var(--ai-border);
  background:
    radial-gradient(circle at 84% 4%, rgba(59, 130, 246, 0.09), transparent 28rem),
    linear-gradient(180deg, #ffffff, #f7f9fc),
    var(--ai-bg);
}

html[data-theme="light"] .ai-provider-header h1,
html[data-theme="light"] .ai-provider-nav-item strong,
html[data-theme="light"] .ai-priority-row strong,
html[data-theme="light"] .ai-card-title h2,
html[data-theme="light"] .ai-form-section-head h2 {
  color: #172033;
}

html[data-theme="light"] .ai-sidebar-card,
html[data-theme="light"] .ai-code-card,
html[data-theme="light"] .ai-priority-card,
html[data-theme="light"] .ai-test-result,
html[data-theme="light"] .ai-form-section {
  border-color: var(--ai-border);
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(30, 64, 175, 0.08);
}

html[data-theme="light"] .ai-provider-nav-item,
html[data-theme="light"] .ai-priority-row,
html[data-theme="light"] .ai-provider-admin .checkbox-row {
  background: #f7f9fc;
}

html[data-theme="light"] .ai-provider-admin .form-control,
html[data-theme="light"] .ai-provider-admin .form-select,
html[data-theme="light"] .ai-provider-admin .form-check-input {
  background-color: #ffffff;
  color: var(--ai-text);
}

html[data-theme="light"] .ai-provider-admin .form-control:focus,
html[data-theme="light"] .ai-provider-admin .form-select:focus {
  background-color: #ffffff;
  color: var(--ai-text);
}

html[data-theme="light"] .ai-code-card pre,
html[data-theme="light"] .ai-provider-admin .code-editor-control {
  border-color: #cbd7e6;
  background: #eef3f9;
  color: #1e3a5f;
}

html[data-theme="light"] body[data-page="Admin-Dashboard"] .pipeline-monitor {
  border-color: #d7e0ec;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(30, 64, 175, 0.1);
}

html[data-theme="light"] body[data-page="Admin-Dashboard"] .pipeline-header h2,
html[data-theme="light"] body[data-page="Admin-Dashboard"] .pipeline-card h3,
html[data-theme="light"] body[data-page="Admin-Dashboard"] .tier-count,
html[data-theme="light"] body[data-page="Admin-Dashboard"] .stat-number,
html[data-theme="light"] body[data-page="Admin-Dashboard"] .log-time {
  color: #172033;
}

html[data-theme="light"] body[data-page="Admin-Dashboard"] .worker-card,
html[data-theme="light"] body[data-page="Admin-Dashboard"] .pipeline-card,
html[data-theme="light"] body[data-page="Admin-Dashboard"] .stat-box {
  border-color: #d7e0ec;
  background: #f7f9fc;
}

html[data-theme="light"] body[data-page="Admin-Dashboard"] .tier-bar-wrap,
html[data-theme="light"] body[data-page="Admin-Dashboard"] .health-row,
html[data-theme="light"] body[data-page="Admin-Dashboard"] .error-row,
html[data-theme="light"] body[data-page="Admin-Dashboard"] .log-container {
  border-color: #d7e0ec;
  background: #eef3f9;
  color: #334155;
}

html[data-theme="light"] body[data-page="Admin-Dashboard"] .log-title {
  color: #334155;
}

html[data-theme="light"] body[data-page="Admin-Dashboard"] .log-entry {
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body[data-page="Admin-Dashboard"] .pipeline-actions button {
  border-color: #c0ccdc;
  color: #172033;
}

/* Operational media intelligence suite. */
.intelligence-ops-page {
  --intel-bg: #080c14;
  --intel-card: #0f1520;
  --intel-card-soft: #131b29;
  --intel-border: #1e2a3c;
  --intel-text: #f1f5f9;
  --intel-muted: #8a9ab2;
  --intel-blue: #3b82f6;
  --intel-cyan: #67e8f9;
  --intel-green: #10b981;
  --intel-yellow: #f59e0b;
  --intel-red: #ef4444;
  --intel-violet: #8b5cf6;
  color: var(--intel-text);
}

body[data-page^="Intelligence-"] {
  background:
    linear-gradient(rgba(59, 130, 246, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 82% 0%, rgba(59, 130, 246, 0.1), transparent 32rem),
    radial-gradient(circle at 8% 26%, rgba(139, 92, 246, 0.07), transparent 28rem),
    #080c14;
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
}

.intel-command-header {
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 1.5rem;
  border-color: var(--intel-border);
  background:
    linear-gradient(110deg, rgba(59, 130, 246, 0.12), transparent 45%),
    var(--intel-card);
}

.intel-command-header h1 {
  margin: 0.2rem 0 0.35rem;
  color: var(--intel-text);
  font-size: clamp(1.65rem, 3.2vw, 2.65rem);
  font-weight: 900;
  letter-spacing: 0;
}

.intel-command-header p {
  max-width: 78ch;
  margin: 0;
  color: var(--intel-muted);
  line-height: 1.8;
}

.intel-live-state {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
  color: #a7f3d0;
  font-size: 0.82rem;
  font-weight: 800;
}

.intel-live-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--intel-green);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1);
  animation: intelPulse 1.8s ease-in-out infinite;
}

.intel-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.intel-metric {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--intel-border);
  border-radius: 8px;
  background: var(--intel-card);
}

.intel-metric::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: #64748b;
}

.intel-metric.info::before { background: var(--intel-blue); }
.intel-metric.success::before { background: var(--intel-green); }
.intel-metric.warning::before { background: var(--intel-yellow); }
.intel-metric.danger::before { background: var(--intel-red); }

.intel-metric span,
.intel-metric small {
  color: var(--intel-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.intel-metric strong {
  color: var(--intel-text);
  font-family: "Inter", "IBM Plex Sans Arabic", sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.intel-stack,
.intel-prediction-grid,
.intel-source-score-grid,
.intel-response-grid,
.intel-profile-grid,
.intel-brief-developments {
  display: grid;
  gap: 0.9rem;
}

.intel-prediction-grid,
.intel-source-score-grid,
.intel-response-grid,
.intel-profile-grid,
.intel-brief-developments {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.intel-empty {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed #334155;
  background: rgba(15, 21, 32, 0.72);
  text-align: center;
}

.intel-empty h2 {
  color: var(--intel-text);
  font-size: 1.2rem;
}

.intel-empty p {
  margin: 0;
  color: var(--intel-muted);
}

.intelligence-waiting {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  padding: 3rem 1.5rem;
  border: 1px dashed #2a3a50;
  background: rgba(15, 21, 32, 0.78);
  color: #64748b;
  text-align: center;
}

.waiting-icon {
  margin-bottom: 1rem;
  color: #60a5fa;
  font-family: "JetBrains Mono", monospace;
  font-size: 3rem;
  line-height: 1;
  opacity: 0.55;
}

.intelligence-waiting h3 {
  margin: 0 0 0.5rem;
  color: #94a3b8;
  font-size: 1.125rem;
}

.waiting-desc {
  max-width: 400px;
  margin: 0 auto 1.5rem;
  color: #718198;
  font-size: 0.82rem;
  line-height: 1.7;
}

.waiting-stats {
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 5vw, 2rem);
  margin-bottom: 1rem;
}

.waiting-stat {
  min-width: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.waiting-stat .stat-num {
  color: var(--intel-blue);
  font-family: "JetBrains Mono", "Inter", monospace;
  font-size: 1.5rem;
  font-weight: 800;
}

.waiting-stat .stat-label {
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.7rem;
}

.waiting-note {
  margin: 0;
  color: #526075;
  font-family: "JetBrains Mono", "IBM Plex Sans Arabic", monospace;
  font-size: 0.7rem;
}

.intel-narrative-card,
.intel-trajectory-card,
.intel-source-score-card,
.intel-response-card,
.intel-profile-card,
.intel-region-card,
.intel-radar-card,
.intel-pulse-chart,
.intel-anomaly-card,
.intel-ranked-list,
.intel-brief-section,
.intel-brief-developments > article {
  min-width: 0;
  padding: 1.1rem;
  border-color: var(--intel-border);
  background: var(--intel-card);
}

.intel-narrative-card {
  display: grid;
  gap: 1rem;
  border-inline-start: 4px solid #64748b;
}

.intel-narrative-card.critical { border-inline-start-color: var(--intel-red); }
.intel-narrative-card.watch { border-inline-start-color: var(--intel-yellow); }
.intel-narrative-card.organic { border-inline-start-color: var(--intel-green); }

.intel-narrative-card > header,
.intel-trajectory-card > header,
.intel-source-score-card > header,
.intel-response-card > header,
.intel-profile-card > header,
.intel-region-card > header,
.intel-pulse-chart > header,
.intel-brief-developments > article > header,
.intel-brief-cover {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.intel-narrative-card h2,
.intel-trajectory-card h2,
.intel-source-score-card h2,
.intel-response-card h2,
.intel-profile-card h3,
.intel-region-card h2,
.intel-radar-card h2,
.intel-pulse-chart h2,
.intel-anomaly-card h2,
.intel-ranked-list h2,
.intel-brief-section h2,
.intel-brief-developments h2 {
  margin: 0.35rem 0;
  color: var(--intel-text);
  line-height: 1.55;
}

.intel-narrative-card header p,
.intel-trajectory-card > p,
.intel-response-card > p,
.intel-radar-card p,
.intel-anomaly-card p,
.intel-brief-section p,
.intel-brief-developments p {
  margin: 0;
  color: var(--intel-muted);
  line-height: 1.8;
}

.intel-status-chip {
  display: inline-flex;
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.08);
  color: #fcd34d;
  font-size: 0.72rem;
  font-weight: 800;
}

.intel-score {
  min-width: 82px;
  display: grid;
  place-items: center;
  gap: 0.1rem;
  padding: 0.65rem;
  border: 1px solid #2b3950;
  border-radius: 8px;
  background: #0a101a;
  text-align: center;
}

.intel-score strong {
  color: var(--intel-cyan);
  font-family: "Inter", sans-serif;
  font-size: 1.45rem;
}

.intel-score span {
  color: var(--intel-muted);
  font-size: 0.68rem;
}

.intel-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.intel-signal-grid > div {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
  padding: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 6px;
  background: var(--intel-card-soft);
}

.intel-signal-grid span {
  color: var(--intel-muted);
  font-size: 0.72rem;
}

.intel-signal-grid strong {
  overflow-wrap: anywhere;
  color: var(--intel-text);
}

.intel-source-timeline {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--intel-border);
  border-radius: 8px;
}

.intel-source-timeline a {
  min-width: 0;
  display: grid;
  grid-template-columns: 62px 150px minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--intel-text);
  text-decoration: none;
}

.intel-source-timeline a:last-child {
  border-bottom: 0;
}

.intel-source-timeline a:hover {
  background: rgba(59, 130, 246, 0.07);
}

.intel-source-timeline time,
.intel-source-timeline span {
  color: var(--intel-muted);
  font-family: "Inter", "IBM Plex Sans Arabic", sans-serif;
  font-size: 0.76rem;
}

.intel-source-timeline strong {
  min-width: 0;
  overflow: hidden;
  color: var(--intel-text);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-keywords {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.intel-keywords span {
  padding: 0.2rem 0.55rem;
  border: 1px solid #2b3950;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: #b7c5d9;
  font-size: 0.72rem;
}

.intel-recommendation,
.intel-response-window,
.intel-history,
.intel-talking-points {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.07);
}

.intel-recommendation strong,
.intel-response-window span,
.intel-history > strong,
.intel-talking-points > strong {
  color: #93c5fd;
  font-size: 0.78rem;
}

.intel-recommendation p,
.intel-response-window strong {
  margin: 0;
  color: var(--intel-text);
  line-height: 1.7;
}

.intel-alert-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.06);
  color: #bbf7d0;
}

.intel-alert-line.is-warning {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.07);
  color: #fde68a;
}

.intel-alert-line span {
  color: var(--intel-muted);
}

.intel-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
  gap: 0.9rem;
}

.intel-region-list,
.intel-score-lines,
.intel-ranked-list {
  display: grid;
  gap: 0.65rem;
}

.intel-region-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(140px, 1.4fr) 44px 62px;
  align-items: center;
  gap: 0.7rem;
}

.intel-region-row > div:first-child {
  min-width: 0;
  display: grid;
}

.intel-region-row strong {
  color: var(--intel-text);
}

.intel-region-row span {
  overflow: hidden;
  color: var(--intel-muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-bar,
.intel-score-lines i,
.intel-ranked-list i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #1b2638;
}

.intel-bar i,
.intel-score-lines b,
.intel-ranked-list b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--intel-blue), var(--intel-cyan));
}

.intel-region-row b,
.intel-region-row em {
  color: var(--intel-text);
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-style: normal;
}

.positive { color: #34d399 !important; }
.negative { color: #f87171 !important; }

.intel-radar-card {
  display: grid;
  align-content: start;
  justify-items: center;
  text-align: center;
}

.intel-radar {
  position: relative;
  width: 190px;
  aspect-ratio: 1;
  margin: 1rem 0;
  border: 1px solid rgba(59, 130, 246, 0.38);
  border-radius: 50%;
  background:
    linear-gradient(rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.2)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.2)) 0 50% / 100% 1px no-repeat;
}

.intel-radar i {
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(59, 130, 246, 0.26);
  border-radius: 50%;
}

.intel-radar i:nth-child(2) { inset: 32%; }
.intel-radar i:nth-child(3) { inset: 44%; }

.intel-radar b {
  position: absolute;
  width: 7px;
  height: 7px;
  top: 27%;
  left: 64%;
  border-radius: 50%;
  background: var(--intel-cyan);
  box-shadow: -42px 55px 0 var(--intel-violet), 25px 72px 0 var(--intel-blue), 0 0 16px var(--intel-cyan);
}

.intel-profile-card header span,
.intel-profile-card dl,
.intel-profile-card dd {
  color: var(--intel-muted);
  font-size: 0.76rem;
}

.intel-profile-card header > strong {
  min-width: 46px;
  padding: 0.45rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  font-family: "Inter", sans-serif;
  text-align: center;
}

.intel-profile-card dl {
  display: grid;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.intel-profile-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.intel-profile-card dt {
  color: #cbd5e1;
}

.intel-profile-card dd {
  margin: 0;
}

.intel-probability {
  min-width: 62px;
  padding: 0.55rem;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  color: #fcd34d;
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
}

.intel-probability.is-high {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.intel-spark-bars {
  height: 92px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 0.6rem;
  border-bottom: 1px solid var(--intel-border);
  background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.03));
}

.intel-spark-bars i {
  flex: 1;
  max-height: 100%;
  min-height: 8px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--intel-cyan), var(--intel-blue));
  opacity: 0.8;
}

.intel-history span {
  color: var(--intel-muted);
  font-size: 0.78rem;
}

.intel-score-lines > div {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(100px, 1.5fr) 42px;
  align-items: center;
  gap: 0.65rem;
}

.intel-score-lines span,
.intel-source-score-card footer {
  color: var(--intel-muted);
  font-size: 0.76rem;
}

.intel-score-lines strong {
  color: var(--intel-text);
  font-family: "Inter", sans-serif;
  font-size: 0.76rem;
}

.intel-source-score-card footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--intel-border);
}

.intel-talking-points ol,
.intel-brief-section ul,
.intel-brief-section ol {
  margin: 0;
  padding-inline-start: 1.2rem;
  color: var(--intel-text);
  line-height: 1.9;
}

.intel-response-card footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.intel-response-card footer button,
.intel-brief-cover button {
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #172033;
  color: var(--intel-text);
  font-weight: 800;
}

.intel-response-card footer button:first-child,
.intel-brief-cover form button {
  border-color: var(--intel-blue);
  background: var(--intel-blue);
}

.intel-response-card footer button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.intel-pulse-bars {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(12, minmax(14px, 1fr));
  align-items: end;
  gap: 0.4rem;
  margin-top: 1rem;
}

.intel-pulse-bars > div {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 0.35rem;
}

.intel-pulse-bars i {
  width: 100%;
  max-height: 100%;
  min-height: 7px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--intel-cyan), var(--intel-blue));
}

.intel-pulse-bars span {
  color: var(--intel-muted);
  font-family: "Inter", sans-serif;
  font-size: 0.62rem;
  writing-mode: vertical-rl;
}

.intel-anomaly-card {
  display: grid;
  align-content: center;
  border-top: 4px solid var(--intel-green);
}

.intel-anomaly-card.is-active {
  border-top-color: var(--intel-red);
  background: linear-gradient(150deg, rgba(239, 68, 68, 0.09), transparent 60%), var(--intel-card);
}

.intel-ranked-list > div {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(100px, 1.4fr) 42px;
  align-items: center;
  gap: 0.65rem;
}

.intel-ranked-list > div span {
  color: #cbd5e1;
  font-size: 0.8rem;
}

.intel-ranked-list > div strong {
  color: var(--intel-text);
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
}

.intel-brief-cover {
  align-items: center;
  padding: 1.4rem;
  border-top: 5px solid var(--intel-red);
  background:
    linear-gradient(110deg, rgba(239, 68, 68, 0.09), transparent 45%),
    var(--intel-card);
}

.intel-brief-cover h1 {
  margin: 0.25rem 0;
  color: var(--intel-text);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.intel-brief-cover p {
  margin: 0;
  color: var(--intel-muted);
}

.brief-export-actions {
  display: flex;
  gap: 0.5rem;
}

.intel-brief-section.executive {
  border-inline-start: 4px solid var(--intel-blue);
}

.intel-brief-section.threats {
  border-inline-start: 4px solid var(--intel-red);
}

.intel-brief-section.actions {
  border-inline-start: 4px solid var(--intel-green);
}

.intel-brief-section.outlook {
  border-inline-start: 4px solid var(--intel-violet);
}

.intel-brief-developments > article header {
  color: var(--intel-muted);
  font-size: 0.74rem;
}

.intel-brief-developments h2 {
  font-size: 1.1rem;
}

.intel-brief-developments h2 a {
  color: inherit;
  text-decoration: none;
}

.intel-brief-section small {
  color: var(--intel-muted);
}

@keyframes intelPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.2); }
}

@media (max-width: 991px) {
  .intel-metric-grid,
  .intel-prediction-grid,
  .intel-source-score-grid,
  .intel-response-grid,
  .intel-profile-grid,
  .intel-brief-developments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intel-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .intel-command-header,
  .intel-narrative-card > header,
  .intel-trajectory-card > header,
  .intel-source-score-card > header,
  .intel-response-card > header,
  .intel-brief-cover {
    align-items: stretch;
    flex-direction: column;
  }

  .intel-live-state {
    align-self: flex-start;
  }

  .intel-metric-grid,
  .intel-prediction-grid,
  .intel-source-score-grid,
  .intel-response-grid,
  .intel-profile-grid,
  .intel-brief-developments {
    grid-template-columns: 1fr;
  }

  .intel-signal-grid {
    grid-template-columns: 1fr;
  }

  .intel-source-timeline a {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .intel-source-timeline strong {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .intel-region-row {
    grid-template-columns: minmax(0, 1fr) 46px;
  }

  .intel-region-row .intel-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .intel-region-row em {
    grid-column: 2;
    grid-row: 2;
  }

  .intel-pulse-bars {
    gap: 0.22rem;
  }

  .brief-export-actions,
  .intel-response-card footer {
    flex-direction: column;
  }

  .brief-export-actions button,
  .intel-response-card footer button {
    width: 100%;
  }

  .waiting-stats {
    width: 100%;
    gap: 0.5rem;
  }

  .waiting-stat {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 400px) {
  .intel-command-header,
  .intel-narrative-card,
  .intel-trajectory-card,
  .intel-source-score-card,
  .intel-response-card,
  .intel-profile-card,
  .intel-region-card,
  .intel-radar-card,
  .intel-pulse-chart,
  .intel-anomaly-card,
  .intel-ranked-list,
  .intel-brief-section,
  .intel-brief-developments > article {
    padding: 0.85rem;
  }

  .intel-score-lines > div,
  .intel-ranked-list > div {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .intel-score-lines i,
  .intel-ranked-list i {
    grid-column: 1 / -1;
  }
}

html[data-theme="light"] body[data-page^="Intelligence-"] {
  background:
    linear-gradient(rgba(30, 64, 175, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 64, 175, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 82% 0%, rgba(59, 130, 246, 0.09), transparent 32rem),
    #f4f7fb;
  background-size: 32px 32px, 32px 32px, auto, auto;
}

html[data-theme="light"] .intelligence-ops-page {
  --intel-card: #ffffff;
  --intel-card-soft: #f6f8fc;
  --intel-border: #d7e0ec;
  --intel-text: #172033;
  --intel-muted: #65758b;
}

html[data-theme="light"] .intel-command-header,
html[data-theme="light"] .intel-brief-cover {
  background:
    linear-gradient(110deg, rgba(59, 130, 246, 0.08), transparent 45%),
    #ffffff;
}

html[data-theme="light"] .intel-score,
html[data-theme="light"] .intel-response-card footer button,
html[data-theme="light"] .intel-brief-cover button {
  background: #eef3f9;
  color: #172033;
}

html[data-theme="light"] .intel-response-card footer button:first-child,
html[data-theme="light"] .intel-brief-cover form button {
  background: var(--intel-blue);
  color: #ffffff;
}

html[data-theme="light"] .intel-bar,
html[data-theme="light"] .intel-score-lines i,
html[data-theme="light"] .intel-ranked-list i {
  background: #e3e9f2;
}

html[data-theme="light"] .intelligence-waiting {
  border-color: #cbd5e1;
  background: rgba(255, 255, 255, 0.86);
}

/* Public analytics: readable insight layer above the existing technical detail. */
.public-analytics-page {
  --public-card: #0f1520;
  --public-card-soft: #131b29;
  --public-border: #263247;
  --public-text: #f1f5f9;
  --public-muted: #9aa9bd;
  display: grid;
  min-width: 0;
  gap: 1.35rem;
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}

.public-analytics-page > * {
  min-width: 0;
}

.public-analytics-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem;
  padding: clamp(1.15rem, 2.5vw, 2rem);
  border-radius: 8px;
  border-color: var(--public-border);
  background:
    linear-gradient(120deg, rgba(59, 130, 246, 0.11), transparent 42%),
    var(--public-card);
}

.public-analytics-kicker {
  display: block;
  margin-bottom: 0.45rem;
  color: #73d8e6;
  font-size: 0.74rem;
  font-weight: 900;
}

.public-analytics-header h1 {
  margin: 0;
  color: var(--public-text);
  font-size: clamp(1.75rem, 4vw, 3.35rem);
  line-height: 1.25;
}

.public-analytics-header p {
  max-width: 58rem;
  margin: 0.65rem 0 0;
  color: var(--public-muted);
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  line-height: 1.9;
}

.public-analytics-meta {
  display: flex;
  max-width: 28rem;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.public-analytics-meta span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.public-insight-lead {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1.2rem;
  border-radius: 8px;
  border-color: rgba(115, 216, 230, 0.25);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.08), transparent 48%),
    var(--public-card);
}

.public-insight-mark,
.public-insight-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(115, 216, 230, 0.28);
  background: rgba(14, 165, 233, 0.1);
  color: #8be4ee;
  font-family: "Inter", sans-serif;
  font-weight: 900;
}

.public-insight-mark {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  font-size: 1.35rem;
}

.public-insight-lead span {
  color: #73d8e6;
  font-size: 0.75rem;
  font-weight: 900;
}

.public-insight-lead h2 {
  margin: 0.2rem 0;
  color: var(--public-text);
  font-size: clamp(1.2rem, 2.3vw, 1.75rem);
  line-height: 1.5;
}

.public-insight-lead p {
  margin: 0;
  color: var(--public-muted);
  line-height: 1.85;
}

.public-insight-grid,
.public-story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 0.9rem;
}

.public-insight-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  min-height: 148px;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--public-border);
  border-radius: 8px;
  background: var(--public-card);
}

.public-insight-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: #3b82f6;
}

.public-insight-card.accent-green::before { background: #10b981; }
.public-insight-card.accent-amber::before { background: #f59e0b; }
.public-insight-card.accent-cyan::before { background: #22d3ee; }
.public-insight-card.accent-red::before { background: #ef4444; }

.public-insight-icon {
  width: 42px;
  height: 42px;
  border-radius: 7px;
}

.public-insight-card small {
  display: block;
  color: var(--public-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.public-insight-card h2 {
  margin: 0.25rem 0;
  overflow-wrap: anywhere;
  color: var(--public-text);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.35;
}

.public-insight-card p {
  margin: 0;
  color: var(--public-muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.public-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  padding-top: 0.35rem;
}

.public-section-heading > div {
  min-width: 0;
}

.public-section-heading span {
  color: #73d8e6;
  font-size: 0.74rem;
  font-weight: 900;
}

.public-section-heading h2 {
  margin: 0.2rem 0 0;
  color: var(--public-text);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.45;
}

.public-section-heading p {
  max-width: 34rem;
  margin: 0;
  color: var(--public-muted);
  line-height: 1.75;
}

.public-story-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.65rem;
  min-height: 230px;
  padding: 1rem;
  border: 1px solid var(--public-border);
  border-radius: 8px;
  background: var(--public-card);
}

.public-story-topline,
.public-story-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.public-story-topline span {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 800;
}

.public-story-topline strong,
.public-story-card footer span {
  color: var(--public-muted);
  font-size: 0.75rem;
}

.public-story-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--public-text);
  font-size: 1.15rem;
  line-height: 1.55;
}

.public-story-card p {
  margin: 0;
  color: var(--public-muted);
  line-height: 1.75;
}

.public-story-card footer {
  padding-top: 0.7rem;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
}

.public-story-card footer a,
.public-trend-row > a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 6px;
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.public-explainer {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 8px;
  border-color: var(--public-border);
  background: var(--public-card);
}

.public-explainer h2 {
  margin: 0.2rem 0 0.45rem;
  color: var(--public-text);
}

.public-explainer p,
.public-explainer-callout span {
  margin: 0;
  color: var(--public-muted);
  line-height: 1.8;
}

.public-explainer-callout {
  display: grid;
  align-content: center;
  gap: 0.4rem;
  padding: 0.9rem;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 7px;
  background: rgba(34, 211, 238, 0.055);
}

.public-explainer-callout strong {
  color: #a5f3fc;
}

.public-trend-list {
  display: grid;
  padding: 0.35rem 1rem;
  border-radius: 8px;
  border-color: var(--public-border);
  background: var(--public-card);
}

.public-trend-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

.public-trend-row:last-child {
  border-bottom: 0;
}

.public-trend-rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}

.public-trend-row h3 {
  margin: 0.1rem 0;
  color: var(--public-text);
  font-size: 1rem;
}

.public-trend-row p,
.public-trend-row span {
  margin: 0;
  color: var(--public-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.public-trend-metric {
  display: grid;
  min-width: 90px;
  text-align: center;
}

.public-trend-metric strong {
  color: #73d8e6;
  font-family: "Inter", sans-serif;
}

.public-ai-conclusion,
.public-confidence-note {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.07);
}

.public-ai-conclusion strong,
.public-confidence-note strong {
  color: #bfdbfe;
}

.public-ai-conclusion p,
.public-ai-conclusion small,
.public-confidence-note p {
  margin: 0;
  color: var(--public-muted);
  line-height: 1.75;
}

.public-confidence-note {
  margin-bottom: 1.5rem;
  background: var(--public-card);
}

.public-empty-state {
  grid-column: 1 / -1;
  padding: 1.2rem;
  text-align: center;
}

.public-empty-state h2 {
  margin: 0 0 0.35rem;
  color: var(--public-text);
}

.public-empty-state p {
  margin: 0;
  color: var(--public-muted);
}

.public-analytics-page .analytics-card,
.public-analytics-page .section-panel,
.public-analytics-page .narrative-card,
.public-analytics-page .digest-story-card {
  min-width: 0;
  border-radius: 8px;
}

.public-analytics-page .heatmap-shell {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.public-analytics-page .narrative-source h3 a,
.public-analytics-page .digest-story-card h2 a {
  color: inherit;
  text-decoration: none;
}

.public-analytics-page .intelligence-alert {
  border-radius: 8px;
}

@media (max-width: 991px) {
  .public-analytics-header,
  .public-explainer {
    grid-template-columns: 1fr;
  }

  .public-analytics-meta {
    max-width: none;
    justify-content: flex-start;
  }

  .public-trend-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .public-trend-row > a {
    grid-column: 2 / -1;
    justify-self: start;
  }
}

@media (max-width: 767px) {
  .public-analytics-page {
    gap: 1rem;
  }

  .public-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-section-heading .btn {
    width: 100%;
  }

  .public-insight-lead {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 1rem;
  }

  .public-insight-mark {
    width: 42px;
    height: 42px;
  }

  .public-trend-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.7rem;
  }

  .public-trend-metric,
  .public-trend-row > a {
    grid-column: 2;
    justify-self: stretch;
    text-align: start;
  }

  .public-trend-metric {
    display: flex;
    gap: 0.7rem;
  }

  .public-analytics-page .narrative-card-header,
  .public-analytics-page .narrative-source-grid,
  .public-analytics-page .narrative-insight-grid,
  .public-analytics-page .intelligence-brief-grid {
    grid-template-columns: 1fr;
  }

  .public-analytics-page .narrative-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .public-analytics-header,
  .public-insight-card,
  .public-explainer,
  .public-story-card,
  .public-analytics-page .analytics-card,
  .public-analytics-page .section-panel,
  .public-analytics-page .narrative-card,
  .public-analytics-page .digest-story-card {
    padding: 0.85rem;
  }

  .public-analytics-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .public-analytics-meta span {
    white-space: normal;
  }

  .public-insight-card {
    min-height: 0;
  }

  .public-story-topline,
  .public-story-card footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-story-card footer a {
    width: 100%;
  }
}

html[data-theme="light"] .public-analytics-page {
  --public-card: #ffffff;
  --public-card-soft: #f6f8fc;
  --public-border: #d5deea;
  --public-text: #172033;
  --public-muted: #64748b;
}

html[data-theme="light"] .public-analytics-header,
html[data-theme="light"] .public-insight-lead {
  background:
    linear-gradient(120deg, rgba(59, 130, 246, 0.07), transparent 42%),
    var(--public-card);
}

html[data-theme="light"] .public-analytics-meta span,
html[data-theme="light"] .public-story-card,
html[data-theme="light"] .public-insight-card,
html[data-theme="light"] .public-explainer,
html[data-theme="light"] .public-trend-list,
html[data-theme="light"] .public-confidence-note {
  color: var(--public-text);
  background-color: var(--public-card);
}

/* Brand assets: favicon/logo support */
.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
  max-width: min(240px, 34vw);
  color: inherit;
  text-decoration: none;
}

.brandmark:hover,
.brandmark:focus-visible {
  color: inherit;
  text-decoration: none;
}

.brandmark-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 16px rgba(120, 224, 216, 0.28));
}

.brandmark-signal {
  display: none;
}

.brandmark-copy {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
  padding-inline-start: 0.1rem;
}

.brandmark-title {
  overflow: hidden;
  color: #ffffff;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brandmark-kicker {
  overflow: hidden;
  color: var(--primary, #78e0d8);
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  line-height: 1;
  opacity: 0.75;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .brandmark {
    gap: 0.65rem;
    max-width: 42vw;
  }

  .brandmark-logo {
    width: 32px;
    height: 32px;
  }

  .brandmark-kicker {
    display: none;
  }

  .brandmark-title {
    font-size: 0.9rem;
  }
}

@media (max-width: 400px) {
  .brandmark {
    min-width: 44px;
    justify-content: center;
  }

  .brandmark-copy {
    display: none;
  }
}

/* About / National Center page */
.about-page {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  padding-block: clamp(0.5rem, 2vw, 1.5rem) 2rem;
}

.about-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
  padding: clamp(1.25rem, 4vw, 2.6rem);
  border-color: rgba(120, 224, 216, 0.22);
  background:
    radial-gradient(circle at 82% 22%, rgba(120, 224, 216, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(18, 29, 48, 0.94), rgba(8, 13, 24, 0.98));
}

.about-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 224, 216, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 224, 216, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
  opacity: 0.42;
}

.about-hero-copy,
.about-seal-card {
  position: relative;
  z-index: 1;
}

.about-hero h1 {
  max-width: 780px;
  margin: 0.5rem 0 1rem;
  color: var(--text-primary, #f8fafc);
  font-size: clamp(2rem, 5vw, 4.4rem);
  font-weight: 900;
  line-height: 1.12;
}

.about-hero p,
.about-card p,
.about-card li,
.about-contact p {
  color: var(--text-secondary, #b6c3d6);
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  line-height: 1.95;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.about-actions .btn {
  min-height: 44px;
  padding-inline: 1.2rem;
}

.about-seal-card {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 1rem;
  min-width: 0;
  padding: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
}

.about-seal-frame {
  display: grid;
  place-items: center;
  width: min(220px, 70vw);
  aspect-ratio: 1;
  margin-inline: auto;
  padding: 0.85rem;
  border: 1px solid rgba(120, 224, 216, 0.28);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28), 0 0 45px rgba(120, 224, 216, 0.12);
}

.about-seal-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 999px;
}

.about-seal-card strong {
  display: block;
  color: var(--text-primary, #ffffff);
  font-size: 1.08rem;
  line-height: 1.6;
}

.about-seal-card span {
  display: block;
  color: var(--text-muted, #8ea1bb);
  font-size: 0.9rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.about-card {
  position: relative;
  min-width: 0;
  padding: 1.35rem;
}

.about-card-index {
  display: inline-grid;
  place-items: center;
  min-width: 2.35rem;
  height: 2rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(120, 224, 216, 0.28);
  border-radius: 999px;
  color: var(--primary, #78e0d8);
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.about-card h2,
.about-contact h2 {
  margin-bottom: 0.85rem;
  color: var(--text-primary, #ffffff);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 900;
}

.about-card ul {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding-inline-start: 1.2rem;
}

.about-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem;
}

.about-contact-link,
.footer-links a {
  color: var(--primary, #78e0d8);
  text-decoration: none;
}

.about-contact-link {
  direction: ltr;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(120, 224, 216, 0.3);
  border-radius: 999px;
  background: rgba(120, 224, 216, 0.08);
  font-weight: 800;
}

.about-contact-link:hover,
.footer-links a:hover {
  color: #ffffff;
}

.about-copyright {
  margin: 0;
  color: var(--text-muted, #8ea1bb);
  text-align: center;
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.footer-brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  padding: 0.22rem;
  border: 1px solid rgba(120, 224, 216, 0.2);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24), 0 0 24px rgba(120, 224, 216, 0.12);
}

.footer-brand-copy {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.footer-brand-copy .footer-title,
.footer-brand-copy .footer-copy {
  overflow-wrap: anywhere;
}

@media (max-width: 992px) {
  .about-hero,
  .about-contact {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-contact-link {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .footer-brand {
    align-items: flex-start;
  }

  .footer-brand-logo {
    width: 48px;
    height: 48px;
  }

  .about-actions .btn {
    width: 100%;
  }

  .about-seal-frame {
    width: min(180px, 68vw);
  }
}

/* Tech Orbit public redesign */
:root {
  --to-bg: #06111f;
  --to-bg-elevated: #09182a;
  --to-surface: #0b1728;
  --to-surface-soft: #101f33;
  --to-primary: #2f80ff;
  --to-cyan: #67e8f9;
  --to-violet: #8b5cf6;
  --to-green: #34d399;
  --to-amber: #fbbf24;
  --to-text: #f8fafc;
  --to-muted: #94a3b8;
  --to-border: rgba(103, 232, 249, 0.16);
  --to-border-strong: rgba(103, 232, 249, 0.28);
  --to-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --to-radius: 8px;
  --to-container-gap: 24px;
}

html[data-theme="light"] {
  --to-bg: #edf5fb;
  --to-bg-elevated: #ffffff;
  --to-surface: #ffffff;
  --to-surface-soft: #e8f1fb;
  --to-text: #07111f;
  --to-muted: #526176;
  --to-border: rgba(47, 128, 255, 0.18);
  --to-border-strong: rgba(47, 128, 255, 0.3);
  --to-shadow: 0 22px 60px rgba(15, 23, 42, 0.14);
}

html {
  scroll-padding-top: 96px;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(47, 128, 255, 0.08), transparent 360px),
    var(--to-bg);
  color: var(--to-text);
  font-family: "IBM Plex Sans Arabic", "Cairo", "Tajawal", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(103, 232, 249, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

img {
  max-width: 100%;
}

.page-glow,
.ambient-grid {
  display: none !important;
}

.to-page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.to-main {
  flex: 1;
}

.skip-link {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2000;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: var(--to-radius);
  background: var(--to-primary);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.to-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--to-border);
  background: rgba(6, 17, 31, 0.86);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .to-header {
  background: rgba(255, 255, 255, 0.88);
}

.to-header-inner {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.to-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--to-text);
  text-decoration: none;
}

.to-brand:hover {
  color: var(--to-text);
}

.to-brand-logo {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--to-border);
}

.to-brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.to-brand-copy strong {
  font-size: 1rem;
  font-weight: 900;
}

.to-brand-copy span {
  color: var(--to-cyan);
  direction: ltr;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.to-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.to-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--to-radius);
  background: transparent;
  color: var(--to-muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.to-nav-link:hover,
.to-nav-link.is-active {
  background: rgba(47, 128, 255, 0.12);
  color: var(--to-text);
}

.to-nav-dropdown {
  position: relative;
}

.to-nav-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: min(420px, 92vw);
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: rgba(11, 23, 40, 0.98);
  box-shadow: var(--to-shadow);
}

html[data-theme="light"] .to-nav-menu {
  background: rgba(255, 255, 255, 0.98);
}

.to-nav-dropdown.is-open .to-nav-menu {
  display: grid;
}

.to-nav-menu a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  padding: 12px;
  border-radius: var(--to-radius);
  color: var(--to-text);
  text-decoration: none;
}

.to-nav-menu a:hover {
  background: rgba(103, 232, 249, 0.08);
}

.to-nav-menu span {
  grid-row: span 2;
  color: var(--to-cyan);
  font-weight: 900;
}

.to-nav-menu strong {
  font-size: 0.95rem;
}

.to-nav-menu small {
  color: var(--to-muted);
}

.to-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.to-icon-button,
.to-login-link {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--to-text);
  text-decoration: none;
}

.to-icon-button:hover,
.to-login-link:hover {
  border-color: var(--to-border-strong);
  background: rgba(47, 128, 255, 0.13);
  color: var(--to-text);
}

.to-login-link {
  width: auto;
  padding: 0 13px;
  font-weight: 800;
}

.to-logout-form {
  margin: 0;
}

.to-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: transparent;
  color: var(--to-text);
  font-size: 1.35rem;
}

.to-kicker {
  color: var(--to-cyan);
  direction: ltr;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.to-home {
  padding-bottom: 72px;
}

.to-home-hero {
  padding-top: 42px;
}

.to-hero-copy {
  max-width: 780px;
  margin-bottom: 24px;
}

.to-hero-copy h1 {
  margin: 8px 0 10px;
  color: var(--to-text);
  font-size: 3.4rem;
  line-height: 1.08;
  font-weight: 950;
}

.to-hero-copy p {
  max-width: 720px;
  color: var(--to-muted);
  font-size: 1.08rem;
  line-height: 1.9;
}

.to-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.95fr);
  gap: var(--to-container-gap);
}

.to-main-story,
.to-side-story,
.to-article-card,
.to-category-card,
.to-topic-column,
.to-sidebar-block,
.to-media-card,
.to-summary-box,
.to-empty-state,
.to-search-summary,
.to-about-grid article,
.to-about-mark {
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: rgba(11, 23, 40, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset;
}

html[data-theme="light"] .to-main-story,
html[data-theme="light"] .to-side-story,
html[data-theme="light"] .to-article-card,
html[data-theme="light"] .to-category-card,
html[data-theme="light"] .to-topic-column,
html[data-theme="light"] .to-sidebar-block,
html[data-theme="light"] .to-media-card,
html[data-theme="light"] .to-summary-box,
html[data-theme="light"] .to-empty-state,
html[data-theme="light"] .to-search-summary,
html[data-theme="light"] .to-about-grid article,
html[data-theme="light"] .to-about-mark {
  background: rgba(255, 255, 255, 0.9);
}

.to-main-story {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  background: var(--to-surface);
}

.to-story-link,
.to-side-story > a,
.to-stream-item > a,
.to-card-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.to-story-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(47, 128, 255, 0.2), rgba(139, 92, 246, 0.16)),
    var(--to-surface-soft);
}

.to-story-media img,
.to-side-story-media img,
.to-card-media img,
.to-stream-thumb img,
.to-article-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.to-story-overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 34px;
  background: linear-gradient(to top, rgba(2, 8, 18, 0.96), rgba(2, 8, 18, 0.68), transparent);
}

.to-story-overlay h2 {
  max-width: 760px;
  margin: 12px 0;
  color: #fff;
  font-size: 2.35rem;
  line-height: 1.25;
  font-weight: 950;
}

.to-story-overlay p {
  max-width: 720px;
  color: rgba(248, 250, 252, 0.82);
  line-height: 1.9;
}

.to-story-overlay footer,
.to-card-body footer,
.to-stream-item footer,
.to-article-kicker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--to-muted);
  font-size: 0.83rem;
}

.to-category-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 999px;
  background: rgba(103, 232, 249, 0.1);
  color: var(--to-cyan);
  font-size: 0.76rem;
  font-weight: 900;
}

.to-side-stories {
  display: grid;
  gap: var(--to-container-gap);
}

.to-side-story {
  position: relative;
  min-height: 164px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding: 12px;
  overflow: hidden;
}

.to-side-story-media,
.to-stream-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--to-radius);
  background: var(--to-surface-soft);
}

.to-side-story h3 {
  margin: 10px 0 8px;
  color: var(--to-text);
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 900;
}

.to-side-story small {
  color: var(--to-muted);
}

.to-tech-ticker {
  margin-top: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: rgba(11, 23, 40, 0.72);
  overflow: hidden;
}

.to-tech-ticker strong {
  margin-inline-start: 16px;
  color: #fff;
  background: #dc2626;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.to-ticker-track {
  overflow: hidden;
}

.to-ticker-content {
  width: max-content;
  display: flex;
  gap: 32px;
  animation: toTicker 42s linear infinite;
}

.to-ticker-content a {
  color: var(--to-text);
  text-decoration: none;
  white-space: nowrap;
}

@keyframes toTicker {
  from { transform: translateX(-10%); }
  to { transform: translateX(50%); }
}

.to-section,
.to-topic-band,
.to-latest-layout,
.to-media-section,
.to-list-layout {
  margin-top: 58px;
}

.to-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.to-section-header h2 {
  margin: 3px 0 0;
  color: var(--to-text);
  font-size: 1.65rem;
  line-height: 1.35;
  font-weight: 950;
}

.to-section-header a {
  color: var(--to-cyan);
  font-weight: 800;
  text-decoration: none;
}

.to-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--to-container-gap);
}

.to-article-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease;
}

.to-article-card:hover {
  transform: translateY(-3px);
  border-color: var(--to-border-strong);
}

.to-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(47, 128, 255, 0.18), rgba(52, 211, 153, 0.1)),
    var(--to-surface-soft);
}

.to-card-media.is-missing img,
.to-story-media.is-missing img,
.to-side-story-media.is-missing img,
.to-stream-thumb.is-missing img,
.to-article-hero-image.is-missing img {
  display: none;
}

.to-card-media::before,
.to-side-story-media::before,
.to-stream-thumb::before,
.to-article-hero-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, rgba(47, 128, 255, 0.2), rgba(52, 211, 153, 0.12));
}

.to-card-media img,
.to-side-story-media img,
.to-stream-thumb img,
.to-article-hero-image img {
  position: relative;
  z-index: 1;
}

.to-card-media .to-category-badge {
  position: absolute;
  top: 10px;
  right: 10px;
}

.to-card-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.to-card-body h3 {
  margin: 0;
  color: var(--to-text);
  font-size: 1.08rem;
  line-height: 1.55;
  font-weight: 950;
}

.to-card-body p {
  min-height: 3.45em;
  margin: 0;
  color: var(--to-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.72;
}

.to-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.to-category-card {
  min-height: 178px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 16px;
  color: var(--to-text);
  text-decoration: none;
}

.to-category-card:hover {
  border-color: var(--to-border-strong);
  color: var(--to-text);
}

.to-category-card i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--to-radius);
  background: rgba(47, 128, 255, 0.14);
  color: var(--to-cyan);
  font-size: 1.2rem;
}

.to-category-card span {
  font-weight: 950;
}

.to-category-card p {
  margin: 0;
  color: var(--to-muted);
  line-height: 1.65;
  font-size: 0.9rem;
}

.to-category-card strong {
  margin-top: auto;
  color: var(--to-green);
}

.to-topic-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--to-container-gap);
}

.to-topic-column {
  padding: 18px;
}

.to-topic-column h2 {
  margin: 4px 0 14px;
  color: var(--to-text);
  font-weight: 950;
}

.to-topic-row {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--to-border);
  color: var(--to-text);
  text-decoration: none;
}

.to-topic-row span {
  color: var(--to-cyan);
  font-size: 0.78rem;
  font-weight: 900;
}

.to-topic-row strong {
  line-height: 1.55;
}

.to-topic-row small {
  color: var(--to-muted);
}

.to-latest-layout,
.to-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.to-news-stream {
  display: grid;
  gap: 16px;
}

.to-stream-item {
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 14px;
  border-top: 1px solid var(--to-border);
}

.to-stream-item:hover {
  background: rgba(103, 232, 249, 0.045);
}

.to-stream-thumb {
  aspect-ratio: 4 / 3;
}

.to-stream-item h3 {
  margin: 8px 0;
  color: var(--to-text);
  line-height: 1.5;
  font-size: 1.16rem;
  font-weight: 950;
}

.to-stream-item p {
  margin: 0 0 10px;
  color: var(--to-muted);
  line-height: 1.75;
}

.to-editorial-sidebar {
  display: grid;
  gap: 18px;
}

.to-sidebar-block {
  padding: 18px;
}

.to-sidebar-block h2 {
  margin: 0 0 12px;
  color: var(--to-text);
  font-size: 1.18rem;
  font-weight: 950;
}

.to-sidebar-block p {
  color: var(--to-muted);
  line-height: 1.8;
}

.to-sidebar-block > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--to-border);
  color: var(--to-text);
  text-decoration: none;
}

.to-sidebar-block > a strong {
  color: var(--to-cyan);
}

.to-newsletter-form {
  display: flex;
  gap: 8px;
}

.to-newsletter-form input {
  min-width: 0;
  flex: 1;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--to-text);
}

.to-newsletter-form button,
.to-primary-link,
.to-secondary-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--to-border-strong);
  border-radius: var(--to-radius);
  background: var(--to-primary);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.to-secondary-link {
  background: transparent;
  color: var(--to-text);
}

.to-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.to-social-row a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  color: var(--to-text);
  text-decoration: none;
}

.to-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--to-container-gap);
}

.to-media-card {
  min-height: 210px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 22px;
  color: var(--to-text);
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(47, 128, 255, 0.2), rgba(139, 92, 246, 0.18)),
    var(--to-surface);
}

.to-media-card i {
  color: var(--to-cyan);
  font-size: 2rem;
}

.to-media-card h3 {
  max-width: 520px;
  margin: 0;
  font-weight: 950;
  line-height: 1.4;
}

.to-footer {
  margin-top: 72px;
  border-top: 1px solid var(--to-border);
  background: rgba(4, 11, 21, 0.74);
}

html[data-theme="light"] .to-footer {
  background: rgba(255, 255, 255, 0.8);
}

.to-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 24px;
  padding: 34px 12px;
}

.to-footer-brand p,
.to-footer-newsletter p {
  margin: 14px 0 0;
  color: var(--to-muted);
  line-height: 1.8;
}

.to-footer-links {
  display: grid;
  align-content: start;
  gap: 8px;
}

.to-footer-links strong,
.to-footer-newsletter strong {
  color: var(--to-text);
}

.to-footer-links a {
  color: var(--to-muted);
  text-decoration: none;
}

.to-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 12px 26px;
  color: var(--to-muted);
  border-top: 1px solid var(--to-border);
}

.to-search-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
}

.to-search-modal.is-open {
  display: block;
}

.command-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.72);
  backdrop-filter: blur(10px);
}

.to-search-panel {
  position: relative;
  width: min(720px, calc(100vw - 28px));
  margin: 12vh auto 0;
  padding: 20px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: var(--to-surface);
  box-shadow: var(--to-shadow);
}

.to-search-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.to-search-panel h2 {
  margin: 6px 0 0;
  color: var(--to-text);
  font-weight: 950;
}

.to-command-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 12px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: rgba(255, 255, 255, 0.04);
}

.to-command-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--to-text);
}

.to-command-search button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--to-radius);
  background: var(--to-primary);
  color: #fff;
  font-weight: 900;
}

.to-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.to-quick-links a,
.to-related-topics a,
.to-search-tags span,
.to-search-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--to-border);
  border-radius: 999px;
  color: var(--to-text);
  text-decoration: none;
}

.to-list-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1fr);
  gap: 32px;
  align-items: end;
  padding-top: 42px;
}

.to-list-hero h1,
.to-article-header h1,
.to-about-hero h1 {
  margin: 8px 0 12px;
  color: var(--to-text);
  font-size: 2.55rem;
  line-height: 1.18;
  font-weight: 950;
}

.to-list-hero p,
.to-article-header p,
.to-about-hero p {
  color: var(--to-muted);
  line-height: 1.9;
}

.to-list-meta,
.to-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--to-muted);
}

.to-search-hero-form {
  display: grid;
  gap: 10px;
}

.to-search-hero-form label {
  color: var(--to-muted);
  font-weight: 800;
}

.to-search-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 12px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: var(--to-surface);
}

.to-search-field input,
.to-filter-row input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--to-text);
}

.to-search-field button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--to-radius);
  background: var(--to-primary);
  color: #fff;
  font-weight: 900;
}

.to-filter-row input {
  width: auto;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
}

.to-sort-control {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
}

.to-sort-control a {
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--to-muted);
  text-decoration: none;
}

.to-sort-control .is-active {
  background: rgba(47, 128, 255, 0.15);
  color: var(--to-text);
}

.to-search-summary {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.to-search-summary h2 {
  margin: 4px 0;
  color: var(--to-text);
  font-size: 1.3rem;
  font-weight: 950;
}

.to-search-summary p {
  margin: 0;
  color: var(--to-muted);
}

.to-search-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.to-category-strip {
  margin-top: 22px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.to-category-strip a {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--to-text);
  text-decoration: none;
}

.to-category-strip a.is-active {
  border-color: var(--to-primary);
  background: rgba(47, 128, 255, 0.16);
}

.to-category-strip strong {
  color: var(--to-cyan);
}

.to-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.to-list-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.to-empty-state {
  grid-column: 1 / -1;
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
}

.to-empty-state i {
  color: var(--to-cyan);
  font-size: 2rem;
}

.to-empty-state h2 {
  color: var(--to-text);
  font-weight: 950;
}

.to-empty-state p {
  color: var(--to-muted);
}

.to-empty-state a {
  color: var(--to-cyan);
  font-weight: 900;
}

.to-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
}

.to-pagination a,
.to-pagination span {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  color: var(--to-text);
  text-decoration: none;
}

.to-pagination .is-current {
  background: var(--to-primary);
  color: #fff;
}

.to-pagination .is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.to-article-header {
  max-width: 980px;
  padding-top: 46px;
}

.to-article-header h1 {
  font-size: 3rem;
}

.to-article-header p {
  max-width: 840px;
  font-size: 1.1rem;
}

.to-article-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.to-share-row {
  display: flex;
  gap: 8px;
}

.to-share-row a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  color: var(--to-text);
  text-decoration: none;
}

.to-article-hero-image {
  position: relative;
  margin: 28px 0 0;
  overflow: hidden;
  border-radius: var(--to-radius);
  border: 1px solid var(--to-border);
  background: var(--to-surface-soft);
}

.to-article-hero-image img {
  width: 100%;
  max-height: 620px;
  object-fit: cover;
}

.to-article-hero-image figcaption {
  padding: 10px 14px;
  color: var(--to-muted);
  font-size: 0.88rem;
}

.to-article-layout {
  margin-top: 34px;
}

.to-article-body {
  max-width: 780px;
}

.to-summary-box {
  padding: 20px;
  margin-bottom: 28px;
}

.to-summary-box h2 {
  margin: 4px 0 12px;
  color: var(--to-text);
  font-weight: 950;
}

.to-summary-box ul {
  margin: 0;
  padding-inline-start: 20px;
  color: var(--to-text);
  line-height: 1.9;
}

.to-story-body p {
  margin: 0 0 1.35rem;
  color: var(--to-text);
  font-size: 1.12rem;
  line-height: 1.95;
}

.to-related-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.to-article-aside {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 18px;
}

.to-about-page {
  padding-top: 42px;
}

.to-about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: center;
}

.to-about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.to-about-mark {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}

.to-about-mark img {
  width: 120px;
  height: 120px;
}

.to-about-mark strong {
  color: var(--to-text);
  font-size: 1.15rem;
}

.to-about-mark span {
  color: var(--to-cyan);
  direction: ltr;
  font-weight: 800;
}

.to-about-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--to-container-gap);
}

.to-about-grid article {
  padding: 22px;
}

.to-about-grid span {
  color: var(--to-cyan);
  font-weight: 950;
}

.to-about-grid h2 {
  margin: 12px 0 8px;
  color: var(--to-text);
  font-weight: 950;
}

.to-about-grid p {
  margin: 0;
  color: var(--to-muted);
  line-height: 1.8;
}

.to-skeleton-card {
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  overflow: hidden;
  background: var(--to-surface);
}

.to-skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
}

.to-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  animation: toSkeleton 1.2s ease infinite;
}

.to-skeleton-image {
  aspect-ratio: 16 / 9;
}

.to-skeleton-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.to-skeleton-line {
  height: 12px;
  border-radius: 999px;
}

.to-skeleton-line.is-short {
  width: 36%;
}

.to-skeleton-line.is-title {
  width: 80%;
  height: 18px;
}

@keyframes toSkeleton {
  to { transform: translateX(-100%); }
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .to-ticker-content,
  .to-skeleton::after,
  .reveal-on-scroll {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1240px) {
  .to-header-inner {
    grid-template-columns: auto auto 1fr auto;
  }

  .to-menu-toggle {
    display: grid;
    place-items: center;
  }

  .to-nav {
    position: fixed;
    top: 76px;
    right: 12px;
    left: 12px;
    max-height: calc(100vh - 92px);
    overflow: auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--to-border);
    border-radius: var(--to-radius);
    background: var(--to-surface);
    box-shadow: var(--to-shadow);
  }

  .to-nav.is-open {
    display: flex;
  }

  .to-nav-link {
    justify-content: space-between;
  }

  .to-nav-menu {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }

  .to-hero-grid,
  .to-list-hero,
  .to-about-hero {
    grid-template-columns: 1fr;
  }

  .to-side-stories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .to-side-story {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .to-featured-grid,
  .to-list-grid,
  .to-topic-band,
  .to-about-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .to-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .to-latest-layout,
  .to-list-layout,
  .to-article-layout,
  .to-footer-grid {
    grid-template-columns: 1fr;
  }

  .to-article-aside {
    position: static;
  }
}

@media (max-width: 768px) {
  :root {
    --to-container-gap: 16px;
  }

  .to-header-inner {
    min-height: 66px;
    gap: 10px;
  }

  .to-nav {
    top: 66px;
  }

  .to-brand-copy span {
    font-size: 0.66rem;
  }

  .to-header-actions {
    gap: 6px;
  }

  .to-icon-button,
  .to-login-link,
  .to-menu-toggle {
    width: 38px;
    height: 38px;
  }

  .to-login-link {
    width: auto;
  }

  .to-home-hero,
  .to-list-hero,
  .to-article-header,
  .to-about-page {
    padding-top: 28px;
  }

  .to-hero-copy h1,
  .to-article-header h1,
  .to-list-hero h1,
  .to-about-hero h1 {
    font-size: 2.15rem;
  }

  .to-story-overlay h2 {
    font-size: 1.65rem;
  }

  .to-main-story {
    min-height: 460px;
  }

  .to-story-overlay {
    padding: 22px;
  }

  .to-side-stories,
  .to-featured-grid,
  .to-list-grid,
  .to-topic-band,
  .to-category-grid,
  .to-media-grid,
  .to-about-grid {
    grid-template-columns: 1fr;
  }

  .to-stream-item {
    grid-template-columns: 112px 1fr;
    gap: 12px;
  }

  .to-stream-item p {
    display: none;
  }

  .to-section-header,
  .to-search-summary,
  .to-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .to-search-field,
  .to-command-search {
    grid-template-columns: auto 1fr;
  }

  .to-search-field button,
  .to-command-search button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 430px) {
  .container-xxl {
    padding-right: 14px;
    padding-left: 14px;
  }

  .to-brand-logo {
    width: 36px;
    height: 36px;
  }

  .to-brand-copy strong {
    font-size: 0.92rem;
  }

  .to-header-actions {
    max-width: 128px;
  }

  .to-main-story {
    min-height: 420px;
  }

  .to-card-body,
  .to-category-card,
  .to-sidebar-block,
  .to-summary-box {
    padding: 14px;
  }

  .to-stream-item {
    grid-template-columns: 1fr;
  }

  .to-stream-thumb {
    aspect-ratio: 16 / 9;
  }

  .to-newsletter-form {
    flex-direction: column;
  }

  .to-newsletter-form button {
    width: 100%;
  }
}
