:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-dim: #6b7280;
  --text-faint: #9ca3af;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --yellow: #d97706;
  --yellow-bg: #fffbeb;
  --orange: #ea580c;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --accent: #4f46e5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  font-family: -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  color: var(--text);
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 600;
}

h1 { font-size: 1.5rem; margin: 0 0 0.25rem; color: var(--text); }
.subtitle { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 1.5rem; }

.banner {
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
}
.banner.stage-0 { border-left: 5px solid var(--green); background: var(--green-bg); }
.banner.stage-1 { border-left: 5px solid var(--yellow); background: var(--yellow-bg); }
.banner.stage-2 { border-left: 5px solid var(--orange); background: #fff7ed; }
.banner.stage-3 { border-left: 5px solid var(--red); background: var(--red-bg); }

.banner-top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; }
.stage-label { font-size: 1.35rem; font-weight: 700; color: var(--text); }
.updated-at { font-size: 0.8rem; color: var(--text-dim); }
.glide { font-size: 1rem; margin-top: 0.5rem; color: var(--text); }
.reasons { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.5rem; }

.disclaimer {
  font-size: 0.8rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.narrative, .panel {
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
}
.narrative h2, .panel h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin: 0 0 0.6rem; }

.grid-title { font-size: 1rem; margin: 1.75rem 0 0.75rem; color: var(--text); font-weight: 700; }

.indicator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }
.card-label { font-size: 0.84rem; color: var(--text); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.green { background: var(--green); }
.dot.yellow { background: var(--yellow); }
.dot.red { background: var(--red); }
.card-value { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.card-detail { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.15rem; }

.spark-wrap { position: relative; margin-top: 0.55rem; }
.spark-wrap svg { width: 100%; height: 36px; display: block; color: var(--accent); }
.spark-minmax { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-faint); margin-top: 0.15rem; }
.spark-range { font-size: 0.7rem; color: var(--text-faint); margin-top: 0.1rem; }

.card-desc { font-size: 0.78rem; color: var(--text-dim); line-height: 1.5; margin-top: 0.65rem; }
.card-history { font-size: 0.76rem; color: var(--text-dim); line-height: 1.5; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--border); }
.card-history strong { color: var(--text); }
.card-rule { font-size: 0.72rem; color: var(--text-faint); margin-top: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }

.glide-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.glide-table th, .glide-table td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); }
.glide-table th { color: var(--text-dim); font-weight: 600; background: #fafafa; }
.glide-table tr:last-child td { border-bottom: none; }

.footer { font-size: 0.78rem; color: var(--text-faint); margin-top: 2rem; }
.footer a { color: var(--text-dim); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-dim); }
