:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --saffron: #ff9933;
  --green: #138808;
  --blue: #1a4f9c;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: linear-gradient(135deg, #0b1f4b 0%, #12306e 55%, #0b2a5b 100%);
  color: #fff;
  padding: 22px 0;
  border-bottom: 4px solid;
  border-image: linear-gradient(90deg, var(--saffron), #fff, var(--green)) 1;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--saffron), #ff7a29);
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; letter-spacing: 0.5px;
  box-shadow: 0 6px 18px rgba(255, 153, 51, 0.4);
}

.brand-text h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.brand-text p { font-size: 13px; color: rgba(255, 255, 255, 0.75); margin-top: 2px; }

.header-status { display: flex; align-items: center; gap: 10px; }

.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
}

.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.mode-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: #ffd9a8;
}

/* Ticker */
.ticker {
  background: var(--saffron);
  color: #fff;
  padding: 8px 0;
  overflow: hidden;
}

.ticker-inner { display: flex; align-items: center; gap: 14px; white-space: nowrap; }

.ticker-label {
  background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  padding: 4px 10px; border-radius: 6px;
  flex-shrink: 0;
}

.ticker-text { font-size: 14px; font-weight: 600; }

/* Controls */
.controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0 8px; }

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

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.update-info { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

.countdown { font-weight: 500; }
.countdown strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.edition { font-size: 12px; }

.refresh-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink);
  padding: 7px 14px; border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.refresh-btn:hover { border-color: var(--blue); color: var(--blue); }
.refresh-btn:disabled { opacity: 0.5; cursor: wait; }

/* News grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
  padding: 18px 0 40px;
}

.card {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  animation: rise 0.35s ease both;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12); }

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

.card-accent { height: 5px; }

.card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.cat-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; color: #fff;
}

.trend-badge {
  font-size: 11px; font-weight: 700;
  background: #fef2f2; color: #dc2626;
  padding: 3px 8px; border-radius: 999px;
}

.card-title { font-size: 17px; font-weight: 700; line-height: 1.35; letter-spacing: -0.2px; }

.card-summary { font-size: 13.5px; color: var(--muted); flex: 1; }

.card-meta {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column; gap: 3px;
}

.meta-row { display: flex; justify-content: space-between; align-items: center; }

.byline { font-weight: 500; color: var(--ink); }

/* Empty state */
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); margin-bottom: 8px; }

/* Footer */
.site-footer { margin-top: auto; background: var(--ink); color: rgba(255, 255, 255, 0.75); text-align: center; padding: 20px 0; font-size: 13px; }
.footer-sub { margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, 0.5); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0; pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .news-grid { grid-template-columns: 1fr; }
  .brand-text h1 { font-size: 20px; }
}
