:root {
  color-scheme: dark;
  --bg: #060b12;
  --ink: #e8fff7;
  --muted: #8aa79f;
  --line: rgba(99, 255, 211, 0.16);
  --panel: rgba(10, 20, 29, 0.88);
  --panel-strong: rgba(14, 31, 42, 0.94);
  --accent: #38f2c2;
  --accent-dark: #9efbe3;
  --gold: #f6c75f;
  --red: #ff6b7c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --glow: 0 0 0 1px rgba(56, 242, 194, 0.2), 0 18px 46px rgba(56, 242, 194, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(56, 242, 194, 0.13), transparent 36%),
    linear-gradient(240deg, rgba(246, 199, 95, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(9, 18, 28, 0.82), rgba(2, 5, 10, 0.96)),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.app-logo {
  width: clamp(64px, 8vw, 96px);
  height: clamp(64px, 8vw, 96px);
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(56, 242, 194, 0.24));
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(56, 242, 194, 0.32);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 44%, rgba(56, 242, 194, 0.16), transparent 58%),
    var(--panel);
  color: var(--accent-dark);
  cursor: pointer;
  box-shadow: var(--glow);
}

.icon-button:hover {
  border-color: rgba(56, 242, 194, 0.68);
  color: var(--accent);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.icon-button.loading svg {
  opacity: 0.58;
  animation: spin 0.8s linear infinite;
}

.overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.toolband,
.article-panel,
.source-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12, 25, 35, 0.92), rgba(8, 17, 26, 0.88));
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.9rem;
  line-height: 1;
}

.metric.wide strong {
  font-size: 1.15rem;
  line-height: 1.25;
}

.toolband {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
}

.search-wrap {
  display: grid;
  gap: 6px;
  flex: 1;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.search-wrap input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(3, 10, 17, 0.82);
  color: var(--ink);
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 242, 194, 0.16);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(3, 10, 17, 0.82);
}

.segment {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segment:last-child {
  border-right: 0;
}

.segment.active {
  background: var(--accent);
  color: #06110e;
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(3, 10, 17, 0.82);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.toggle-wrap input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.article-panel,
.source-panel {
  min-width: 0;
  overflow: hidden;
}

.source-panel {
  position: sticky;
  top: 14px;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(56, 242, 194, 0.09), transparent 68%),
    var(--panel-strong);
}

.panel-head.compact {
  display: block;
}

.panel-head h2 {
  margin-bottom: 5px;
  font-size: 1.08rem;
}

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.soft-pill {
  flex: 0 0 auto;
  max-width: 180px;
  border: 1px solid rgba(56, 242, 194, 0.28);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(56, 242, 194, 0.1);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.article-list {
  display: grid;
  gap: 0;
}

.article-card {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 24, 0.56);
}

.article-card:last-child {
  border-bottom: 0;
}

.article-card:hover {
  background: rgba(13, 29, 40, 0.92);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.source {
  color: var(--accent-dark);
}

.article-card h3 {
  margin-bottom: 10px;
  font-size: 1.22rem;
  line-height: 1.25;
}

.article-card a {
  color: var(--ink);
  text-decoration: none;
}

.article-card a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.summary {
  max-width: 76ch;
  margin-bottom: 14px;
  color: #b5cac4;
  line-height: 1.55;
}

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

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(5, 13, 21, 0.8);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.tag.crypto {
  border-color: rgba(246, 199, 95, 0.34);
  color: #ffd87a;
}

.tag.security {
  border-color: rgba(255, 107, 124, 0.32);
  color: #ff9aa6;
}

.source-list {
  display: grid;
  max-height: 620px;
  overflow: auto;
}

.source-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.source-row:last-child {
  border-bottom: 0;
}

.source-row strong {
  display: block;
  margin-bottom: 4px;
}

.source-row span {
  color: var(--muted);
  font-size: 0.8rem;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--red);
}

.status-dot.ok {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(56, 242, 194, 0.55);
}

.empty-state {
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.1rem;
}

.site-footer {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 34px;
  padding: 22px 16px 24px;
  background: #000;
  border-top: 1px solid rgba(56, 242, 194, 0.18);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  font-size: 0.68rem;
  font-style: italic;
  font-weight: 700;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.footer-links a:hover,
.kwistech-link:hover,
.legal-page a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.kwistech-link {
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.legal-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 46px;
}

.legal-page h1 {
  margin: 18px 0 8px;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.legal-page h2 {
  margin: 28px 0 8px;
  color: var(--accent-dark);
  font-size: 1.08rem;
}

.legal-page p {
  color: #c3d8d2;
  line-height: 1.7;
}

.legal-page a,
.back-link {
  color: var(--accent-dark);
}

.legal-date {
  color: var(--muted);
  font-weight: 800;
}

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

@media (max-width: 860px) {
  .overview,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .source-panel {
    position: static;
  }

  .source-list {
    max-height: 560px;
  }

  .toolband {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .toggle-wrap {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .soft-pill {
    max-width: none;
  }

  h1 {
    font-size: 2.35rem;
  }
}
