:root {
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --green: #10b981;
  --green-light: #d1fae5;
  --red: #ef4444;
  --red-light: #fee2e2;
  --yellow: #f59e0b;
  --yellow-light: #fef3c7;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

/* Header */
header {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
  color: white;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; }
.subtitle { margin-top: 0.5rem; opacity: 0.85; font-size: 0.95rem; }

/* Main */
main { max-width: 900px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* Section */
.section {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title .icon { font-size: 1.1rem; }

/* Metric row */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.metric-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  text-align: center;
}
.metric-card .label { font-size: 0.7rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; }
.metric-card .value { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.metric-card .value.green { color: var(--green); }
.metric-card .value.red { color: var(--red); }

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}
th {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td {
  border: 1px solid var(--gray-200);
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}
tr:nth-child(even) td { background: var(--gray-50); }
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.tag-green { background: var(--green-light); color: #065f46; }
.tag-red { background: var(--red-light); color: #991b1b; }
.tag-yellow { background: var(--yellow-light); color: #92400e; }

/* Pattern list */
.pattern-list { list-style: none; }
.pattern-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.pattern-list li:last-child { border-bottom: none; }
.pattern-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }
.pattern-text strong { display: block; font-size: 0.9rem; color: var(--gray-900); }
.pattern-text span { font-size: 0.82rem; color: var(--gray-600); }

/* Quote */
.quote {
  background: var(--purple-light);
  border-left: 3px solid var(--purple);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  font-style: italic;
  font-size: 0.87rem;
  color: #4c1d95;
}

/* Case block */
.case-block {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.case-block h4 { font-size: 0.88rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.5rem; }
.case-block p { font-size: 0.83rem; color: var(--gray-600); }
.case-block.red { border-color: #fca5a5; background: #fff5f5; }
.case-block.red h4 { color: #991b1b; }

/* Signal badges */
.signal-grid { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.signal-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
}
.signal-row.green { background: var(--green-light); }
.signal-row.red { background: var(--red-light); }
.signal-row.yellow { background: var(--yellow-light); }
.signal-row strong { min-width: 200px; }

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--gray-400);
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  table { font-size: 0.78rem; }
}
