:root {
  --bg: #0b1020;
  --panel: rgba(18, 25, 47, 0.88);
  --panel-2: rgba(11, 16, 32, 0.82);
  --text: #ecf2ff;
  --muted: #98a6c8;
  --line: rgba(255, 255, 255, 0.08);
  --brand: #79b8ff;
  --fresh: #36d399;
  --warning: #f6c760;
  --stale: #ff7a7a;
  --shadow: 0 14px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Noto Sans SC", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(121, 184, 255, 0.18), transparent 25%),
    linear-gradient(180deg, #111935 0%, #090d1b 100%);
}

a { color: inherit; }

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.hero, .toolbar, .panel, .card, .legend {
  backdrop-filter: blur(18px);
}

.hero > div,
.toolbar,
.panel,
.legend {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero > div:first-child { padding: 28px; }
.hero-panel {
  padding: 20px;
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, rgba(121,184,255,0.14), rgba(121,184,255,0.03));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

h1, h2, h3 { margin: 0; }
h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  margin-bottom: 14px;
}

.hero-copy {
  margin: 0;
  max-width: 70ch;
  color: #d8e2ff;
  line-height: 1.7;
}

.hero-stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
}

.hero-stat .label,
.meta,
.facts dt,
.monitor-label,
.sources-table th,
.legend,
.toolbar label {
  color: var(--muted);
}

.hero-stat strong {
  display: block;
  font-size: 20px;
  margin-top: 6px;
}

.toolbar {
  margin-top: 20px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.toolbar label {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #091124;
  color: var(--text);
  padding: 12px;
}

.legend {
  margin-top: 14px;
  padding: 14px 18px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
}
.dot.fresh { background: var(--fresh); }
.dot.warning { background: var(--warning); }
.dot.stale { background: var(--stale); }

.cards {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18,25,47,0.96), rgba(10,16,31,0.92));
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}

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

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.fresh { background: rgba(54, 211, 153, 0.16); color: #9df0ca; }
.badge.warning { background: rgba(246, 199, 96, 0.16); color: #f6d887; }
.badge.stale { background: rgba(255, 122, 122, 0.16); color: #ffb0b0; }

.summary {
  color: #d9e4ff;
  line-height: 1.65;
  min-height: 78px;
}

.highlights {
  padding-left: 18px;
  margin: 0 0 16px;
  color: #d7e5ff;
  line-height: 1.6;
}

.facts {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px 14px;
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}
.facts dd { margin: 0; }

.monitor {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(121,184,255,0.08);
  line-height: 1.6;
  font-size: 14px;
}
.monitor-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #c0d8ff;
}

.actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.actions a {
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}
.actions a.primary {
  background: linear-gradient(180deg, #7ab6ff, #4f8dff);
  color: #041225;
  font-weight: 700;
}

.method-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  padding: 22px;
}
.panel ol,
.panel ul {
  margin: 14px 0 0;
  padding-left: 20px;
  line-height: 1.8;
  color: #d7e5ff;
}

.sources-panel { margin-top: 20px; }
.sources-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}
.sources-table th,
.sources-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.sources-table td small { color: var(--muted); }

@media (max-width: 900px) {
  .hero,
  .method-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(1180px, calc(100vw - 24px));
    padding: 20px 0 40px;
  }

  .hero > div:first-child,
  .hero-panel,
  .toolbar,
  .panel,
  .card {
    padding: 18px;
  }

  .hero {
    gap: 14px;
  }

  .hero-copy {
    font-size: 14px;
    line-height: 1.65;
    max-width: none;
  }

  .hero-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hero-stat {
    padding: 12px 14px;
  }

  .hero-stat:last-child {
    grid-column: 1 / -1;
  }

  .hero-stat strong {
    font-size: 18px;
  }

  .legend {
    margin-top: 12px;
    padding: 12px 14px;
    gap: 10px;
    font-size: 13px;
  }

  .cards {
    margin-top: 16px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .badge {
    white-space: normal;
    line-height: 1.4;
  }

  .summary,
  .highlights,
  .monitor,
  .panel ol,
  .panel ul {
    font-size: 14px;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px;
  }

  .facts dt {
    margin-top: 8px;
    font-size: 12px;
  }

  .facts dt:first-of-type {
    margin-top: 0;
  }

  .actions {
    flex-direction: column;
  }

  .actions a {
    width: 100%;
    text-align: center;
  }

  .sources-panel {
    overflow: hidden;
  }

  .sources-table,
  .sources-table thead,
  .sources-table tbody,
  .sources-table tr,
  .sources-table th,
  .sources-table td {
    display: block;
    width: 100%;
  }

  .sources-table thead {
    display: none;
  }

  .sources-table tbody {
    display: grid;
    gap: 12px;
  }

  .sources-table tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
  }

  .sources-table td {
    padding: 0;
    border-bottom: 0;
  }

  .sources-table td + td {
    margin-top: 10px;
  }

  .sources-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
  }

  .sources-table a,
  .sources-table small {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 30px;
    margin-bottom: 10px;
  }

  h2 {
    font-size: 20px;
  }

  .toolbar label {
    gap: 6px;
    font-size: 12px;
  }

  select {
    padding: 11px 12px;
    min-height: 44px;
  }

  .card h3 {
    font-size: 22px;
    line-height: 1.2;
  }

  .highlights {
    padding-left: 16px;
  }
}
