:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --grid: #e5e7eb;
  --border: #d1d5db;
  --accent: #2563eb;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--text);
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(209, 213, 219, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.header {
    padding: 20px 24px 8px;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.chart-wrap {
  padding: 8px 20px 24px;
  overflow: auto;
}

.chart-shell {
  min-width: 1260px;
}

svg {
  width: 100%;
  height: auto;
  display: block;
}

.axis-label {
  fill: #111827;
  font-size: 12px;
}

.x-label {
  text-anchor: end;
}

.grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}

.bubble {
  cursor: pointer;
  stroke: rgba(255,255,255,0.9);
  stroke-width: 1.5;
  transition: transform 0.18s ease, stroke-width 0.18s ease, opacity 0.18s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.bubble:hover {
  transform: scale(1.08);
  stroke-width: 2.5;
}

.bubble.is-active {
  stroke: #111827;
  stroke-width: 3;
}

.legend-label,
.legend-tick,
.chart-note {
  fill: #374151;
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  margin-top: 20px;
}

.panel {
  padding: 20px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 29px;
  background: #f9fafb;
  border: 1px solid var(--border);
  font-size: 13px;
  color: #111827;
  font-weight: 600;
  flex-wrap: wrap;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(17, 24, 39, 0.15);
}

.stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stats .stat:only-child {
  width: 100%;
}

.stat {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  min-width: 100px;
  padding: 16px;
  border-radius: 16px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

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

.articles-count {
  color: var(--muted);
  font-size: 14px;
}

.articles-list {
  display: grid;
  gap: 14px;
}

.article-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.article-card:hover {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.article-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
}

.article-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.badge {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 6px 10px;
  border-radius: 999px;
}

.article-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.article-desc {
  margin: 0;
  color: #374151;
  line-height: 1.6;
  font-size: 14px;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border: 2px dashed #d1d5db;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
  background: #fafafa;
}

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

.login-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: white;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.25s ease;
}

.login-btn:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 16px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-content input {
  padding: 10px 14px;
  border-radius: 999px; /* makes it oval */
  border: 1px solid #d1d5db;
  outline: none;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #f9fafb;
}

.modal-content input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.modal-content button {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 999px; /* oval */
  border: none;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-content button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.modal-content button:active {
  transform: translateY(0);
  box-shadow: none;
}

.error-msg {
  color: #dc2626;
  background: #fee2e2;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.article-card {
  border-radius: 20px;
  border: 1px solid #c7d2fe;
  background: #f9fafb;
  padding: 20px;
}

.article-card.project .badge {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}