/*  ============================================================
   FOUNDATIONS — element selectors + typography utilities + layout
   Missed by class-based cluster extraction.
   Prepend this to ui-components.css or load before it.
   ============================================================  */
/*   source: style.css :root   */
:root {
  /* Typography - Inter (2026 Standard) */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;

  /* Legacy alias */
  --font-system: var(--font-body);

  /* Spacing Scale - More generous */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 56px;
  --space-3xl: 80px;

  /* Border Radius - Larger for modern feel */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions - Snappy */
  --transition-fast: 100ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-spring: 200ms ease;

  /* Shadows - Minimal */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.6);

  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
}
*::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.3;
}
.grid {
  display: grid;
  gap: var(--space-md);
}
.app-footer {
  margin-top: var(--space-3xl);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}
.flex { display: flex; }
.hidden { display: none; }
/*   source: style.css @media print   */
@media print {
  body::before { display: none; }
}
.app-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}
.main-content {
  flex: 1;
  padding: var(--space-lg) var(--space-xl);
  max-width: min(95vw, 1400px);
  margin: 0 auto;
  overflow-x: hidden;
}
.content-section {
  display: none !important;
  opacity: 0;
  transform: translateY(10px);
  overflow: hidden;
  height: 0;
  pointer-events: none;
}
.content-section.active {
  display: block !important;
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
  height: auto;
  pointer-events: auto;
  animation: pageSlideIn 0.3s ease-out;
}
/*   source: style.css @media (min-width: 1441px)   */
@media (min-width: 1441px) {
  .main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-2xl);
  }
}
/*   source: style.css @media (max-width: 1440px) and (min-width: 1025px)   */
@media (max-width: 1440px) and (min-width: 1025px) {
  .main-content {
    padding: var(--space-lg) var(--space-xl);
    max-width: min(90vw, 1200px);
  }
}
/*   source: style.css @media (max-width: 1024px)   */
@media (max-width: 1024px) {

  .main-content {
    padding: var(--space-md);
    max-width: 100%;
  }
}
.app-footer {
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}
/*   source: style.css @media (max-width: 768px)   */
@media (max-width: 768px) {
    .main-content {
        padding-bottom: 80px !important;
    }
}
/*   source: style.css @keyframes pulse-subtle   */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
/*   source: style.css @keyframes popupSlideIn   */
@keyframes popupSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
/*   source: style.css @keyframes fadeIn   */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/*   source: style.css @keyframes slideIn   */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
/*   source: style.css @keyframes spin   */
@keyframes spin {
  to { transform: rotate(360deg); }
}
/*   source: style.css @keyframes loadingDots   */
@keyframes loadingDots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}
/*   source: style.css @keyframes shimmer   */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/*   source: style.css @keyframes countPulse   */
@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
/*   source: style.css @keyframes sparkle   */
@keyframes sparkle {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
/*   source: style.css @keyframes aiPulse   */
@keyframes aiPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.05); }
}
/*   source: style.css @keyframes pulse-famine   */
@keyframes pulse-famine {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(139, 0, 0, 0.5);
  }
  50% {
    opacity: 0.85;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.8);
  }
}
/*   source: style.css @keyframes row-pulse   */
@keyframes row-pulse {
  0%, 100% { background: rgba(139, 0, 0, 0.15); }
  50% { background: rgba(139, 0, 0, 0.25); }
}
/*   source: style.css @keyframes modalFadeIn   */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/*   source: style.css @keyframes paletteSlideIn   */
@keyframes paletteSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
/*   source: style.css @keyframes chip-pulse   */
@keyframes chip-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(181, 50, 26, 0);
  }
  50% {
    box-shadow: 0 0 12px 2px rgba(181, 50, 26, 0.4);
  }
}
/*   source: style.css @keyframes marker-pulse   */
@keyframes marker-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}
/*   source: style.css @keyframes trend-pulse-up   */
@keyframes trend-pulse-up {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
/*   source: style.css @keyframes dot-pulse-green   */
@keyframes dot-pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.4); }
  50% { box-shadow: 0 0 8px 2px rgba(48, 209, 88, 0.6); }
}
/*   source: style.css @keyframes pulse-warning   */
@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
/*   source: style.css @keyframes pageSlideIn   */
@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/*   source: style.css @keyframes spin   */
@keyframes spin { to { transform: rotate(360deg); } }
/*   source: style.css @keyframes criticalPulse   */
@keyframes criticalPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(181, 50, 26, 0.3), 0 0 24px rgba(181, 50, 26, 0.1); }
  50% { box-shadow: 0 0 18px rgba(181, 50, 26, 0.5), 0 0 32px rgba(181, 50, 26, 0.2); }
}
/*   source: style.css @keyframes freshGlow   */
@keyframes freshGlow {
  0%, 100% { box-shadow: 0 0 2px rgba(74, 125, 45, 0.3); }
  50% { box-shadow: 0 0 5px rgba(74, 125, 45, 0.6); }
}
/*   source: style.css @keyframes spin   */
@keyframes spin {
  to { transform: rotate(360deg); }
}
/*   source: style.css @keyframes spin   */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
/*   source: style.css @keyframes spin   */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
/*   source: style.css @keyframes fadeIn   */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/*  ============================================================
   EDITORIAL CARD — 2027 primitive
   ------------------------------------------------------------
   One card system to replace insight-card__, .news-card,
   .ranking-row, .glass-card variants. Flat, paper-style, no
   shadow, minimal chrome, one hierarchy (kind -> title -> dek).
   Three density variants: base, --hero, --compact.
   Consumed progressively as sections are rebuilt section-by-
   section (see docs for the 2027 redesign plan).
   ============================================================  */
.editorial-card {
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.editorial-card--hero {
  padding: var(--space-7);
  gap: var(--space-4);
}
.editorial-card--compact {
  padding: var(--space-4);
  gap: var(--space-2);
}

.editorial-card__kind {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-red);
  font-weight: 600;
}
.editorial-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 0;
}
.editorial-card--hero .editorial-card__title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.2;
}
.editorial-card__dek {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}
.editorial-card__ask {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-tertiary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color .15s ease;
}
.editorial-card__ask:hover {
  color: var(--accent-red);
}

/* Bottom-row of an editorial-card: primary action on the left,
   Ask-Argus micro-CTA on the right. Optional — only used by
   cards that expose a direct action (Run, Generate, ...). */
.editorial-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/*  ============================================================
   COMPACT CONTROL PRIMITIVES — 2027
   ------------------------------------------------------------
   Three primitives that replace the chunky BI-style controls
   (big <select>, tab nav, block buttons) with pill-styled,
   inline equivalents. No feature loss — same semantics,
   smaller footprint, editorial feel.
   ============================================================  */

/* Segmented pill — replaces chip groups and tab navs.
   Use .segmented-pill__item.is-active for the selected state. */
.segmented-pill {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  align-items: center;
}
.segmented-pill__item {
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.segmented-pill__item:hover {
  color: var(--text-primary);
}
.segmented-pill__item.is-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Inline pill-styled select — replaces chunky <select> controls.
   Native select under the hood (keyboard + a11y free), styled as
   a pill with a tiny CSS chevron on the right. */
.pill-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 5px 26px 5px 12px;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1.2;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%),
    linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  transition: border-color .15s ease;
}
.pill-select:hover {
  border-color: rgba(0, 0, 0, 0.2);
}
.pill-select:focus {
  outline: none;
  border-color: var(--accent-red);
}

/* Inline button — the compact cousin of the chunky primary button.
   Use for in-card actions (Run, Generate) so the card stays
   editorial rather than "dashboard widget with big CTA". */
.inline-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  border-radius: 8px;
  border: none;
  background: var(--accent-red);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, transform .15s ease;
}
.inline-btn:hover {
  background: color-mix(in oklab, var(--accent-red) 88%, #000);
  transform: translateY(-1px);
}
.inline-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}
.inline-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.inline-btn--ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  transform: none;
}