:root {
  --kri-green: #2d6a4f;
  --kri-green-light: #52b788;
  --kri-green-pale: #d8f3dc;
  --kri-bg: #f8faf8;
  --kri-card: #ffffff;
  --kri-text: #1a2e1a;
  --kri-text-body: #3d5c3d;
  --kri-text-muted: #6b8f6b;
  --kri-border: #d4e6d4;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--kri-bg);
  color: var(--kri-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

/* Prevent horizontal overflow */
html, body { max-width: 100vw; overflow-x: hidden; }

img, video { max-width: 100%; height: auto; }

/* Don't let max-width:100% break layout on normal elements */
div, section, main, article, aside, nav, header, footer { max-width: 100%; }

/* But let buttons/inputs/selects be natural */
button, input, select, textarea { box-sizing: border-box; }

.kri-card {
  background: var(--kri-card);
  border: 1px solid var(--kri-border);
  border-radius: 12px;
}

.kri-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Category badges */
.cat-research { background: #e8f5e9; color: #2d6a4f; border: 1px solid #a8d5b5; }
.cat-news     { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.cat-policy   { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.cat-safety   { background: #fce4ec; color: #880e4f; border: 1px solid #f48fb1; }
.cat-default  { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

.info-card {
  background: #ffffff;
  border: 1px solid #d4e6d4;
  border-radius: 12px;
  padding: 1.25rem;
}

.glow-line {
  height: 1px;
  background: #d4e6d4;
  border: none;
}

.sb-why-matters {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a2e1a;
  line-height: 1.7;
  padding-left: 1rem;
  border-left: 3px solid #2d6a4f;
}

.sb-key-findings li::marker {
  color: #2d6a4f;
}

.sb-quote {
  padding: 1rem 1.25rem;
  background: #f0f7f2;
  border-left: 3px solid #52b788;
  border-radius: 0 8px 8px 0;
  color: #3d5c3d;
  font-style: italic;
}

.sb-bottom-line {
  padding: 1rem 1.25rem;
  background: #e8f5e9;
  border: 1px solid #a8d5b5;
  border-radius: 10px;
}

/* Hide scrollbar on category pills */
.filter-pills::-webkit-scrollbar { display: none; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* =====================
   MOBILE RESPONSIVE
   ===================== */

/* All inner page wrappers get horizontal padding on mobile */
@media (max-width: 768px) {
  /* Main page content padding */
  [style*="maxWidth: 1200"],
  [style*="max-width: 1200"],
  [style*="maxWidth: 860"],
  [style*="maxWidth: 800"],
  [style*="maxWidth: 900"] {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Headings */
  h1 { font-size: clamp(1.5rem, 6vw, 2.5rem) !important; }
  h2 { font-size: clamp(1.2rem, 5vw, 1.75rem) !important; line-height: 1.3 !important; }
  h3 { font-size: clamp(0.95rem, 4vw, 1.25rem) !important; }

  /* Smart brevity smaller on mobile */
  .sb-why-matters { font-size: 0.95rem; padding-left: 0.75rem; }
  .sb-quote { font-size: 0.9rem; padding: 0.75rem 1rem; }

  /* State grid - 2 columns */
  .state-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    font-size: 0.68rem !important;
  }

  /* Force all grid layouts to be single column or 2-col responsive on small screens */
  [style*="gridTemplateColumns: 'repeat(3"],
  [style*="gridTemplateColumns: 'repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  /* Article detail */
  .article-detail-inner { padding: 1rem !important; }

  /* Reduce section vertical padding */
  [style*="padding: '4rem"],
  [style*="padding: '3rem"] {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

@media (max-width: 480px) {
  h1 { font-size: clamp(1.35rem, 7vw, 1.8rem) !important; }
  h2 { font-size: clamp(1.1rem, 5.5vw, 1.4rem) !important; }

  /* Pill buttons - make scrollable row */
  [style*="overflowX"] {
    -webkit-overflow-scrolling: touch;
  }

  /* Cards - reduce padding on tiny screens */
  .kri-card, .info-card {
    padding: 1rem !important;
  }
}
