@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A";
  src: url("/static/fonts/EuclidCircularA-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A";
  src: url("/static/fonts/EuclidCircularA-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A";
  src: url("/static/fonts/EuclidCircularA-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #02050b;
  --panel: #070b14;
  --card: #0b111d;
  --line: #1b2435;
  --text: #f2f4f8;
  --muted: #b6bfcd;
  --accent: #e92f2b;
  --accent-soft: #e92f2b;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Euclid Circular A", "Avenir Next", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  background: #050912;
  border-bottom: 1px solid #111827;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  padding-top: 16px;
}

.logo {
  width: min(460px, 86vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}

.logo-small {
  width: min(165px, 39vw);
}

.topbar-admin-link {
  font-size: 0.95rem;
  white-space: nowrap;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", "Euclid Circular A", sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
}

.btn {
  border: 0;
  background: linear-gradient(120deg, var(--accent), var(--accent-soft));
  color: #fff;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.panel {
  background: var(--panel);
  border-top: 1px solid #0f1827;
  padding: 28px 0;
}

.panel-title {
  background: #060c18;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-top {
  background: #040810;
}

.panel-filter {
  background: #050b16;
  padding: 14px 0;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aeb8c9;
  font-weight: 600;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.toggle-wrap {
  display: inline-flex;
  border: 1px solid #293447;
  border-radius: 999px;
  overflow: hidden;
}

.toggle {
  border: 0;
  color: #c5ccda;
  background: transparent;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.toggle.active {
  background: #fff;
  color: #0d1320;
}

.meta,
.muted {
  color: var(--muted);
}

.card {
  background: #020710;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

h2 {
  margin: 0;
  font-family: "Space Grotesk", "Euclid Circular A", sans-serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 3vw, 3.2rem);
  text-align: center;
}

h3 {
  margin: 10px 0;
  font-family: "Space Grotesk", "Euclid Circular A", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
}

.two-col {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 16px;
}

.chip {
  background: #0f1726;
  color: #d9dfeb;
  border: 1px solid #2a3650;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  background: #fff;
  color: #111827;
}

.digest-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.digest-form input {
  flex: 1;
  min-width: 230px;
  background: #0f1726;
  border: 1px solid #2a3650;
  color: #fff;
  border-radius: 10px;
  padding: 10px;
}

.feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 22px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.btn-page {
  padding: 8px 14px;
  font-size: 0.92rem;
}

.btn-page:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.news-card {
  background: linear-gradient(180deg, #0d1422, #090e18);
  border: 1px solid #1d293d;
  border-radius: 15px;
  padding: 12px;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.news-image-wrap {
  margin: 0 -12px 0;
  border-bottom: 1px solid #1d293d;
  background: #0a0f19;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.news-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(7, 12, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 2px 6px;
}

.news-card-top,
.news-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.source {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  flex: 1;
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.score {
  color: #fff;
  background: rgba(233, 47, 43, 0.2);
  border: 1px solid rgba(233, 47, 43, 0.4);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.82rem;
  min-width: 104px;
  height: 38px;
  line-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  align-self: flex-start;
  box-sizing: border-box;
}

.title,
.summary,
.why,
.date,
.read {
  margin: 0;
}

.title {
  font-size: 1.05rem;
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover {
  text-decoration: underline;
}

.summary,
.date {
  color: #b4bfd0;
}

.why {
  color: #cbd5e5;
  line-height: 1.45;
}

.why-label {
  font-family: "Euclid Circular A", "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: #f1f5ff;
  margin-right: 6px;
}

.why-text {
  color: #b9c4d6;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  padding: 4px 8px;
  background: #121c2d;
  border: 1px solid #2b3951;
  color: #d6deea;
  font-size: 0.74rem;
  font-weight: 700;
}

.read {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.panel-about {
  text-align: center;
  padding-bottom: 60px;
}

.digest-card {
  max-width: 760px;
}

@media (max-width: 900px) {
  .feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .title-row {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .topbar-inner {
    padding-top: 12px;
  }
}

@media (max-width: 640px) {
  .feed {
    grid-template-columns: 1fr;
  }
}
