:root {
  --bg: #0f172a;
  --accent: #4fd1c5;
  --accent-2: #7c3aed;
  --card: rgba(255, 255, 255, 0.06);
  --muted: #cbd5e1;
  --text: #e2e8f0;
  --border: rgba(255, 255, 255, 0.12);
  --glass: blur(12px);
  --font: "SF Pro Rounded", "Segoe UI Variable Display", "PingFang SC", "Hiragino Sans", "Noto Sans SC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(circle at 20% 20%, rgba(79, 209, 197, 0.18), transparent 35%),
              radial-gradient(circle at 80% 10%, rgba(124, 58, 237, 0.22), transparent 38%),
              linear-gradient(135deg, #0b1224, #0f172a 50%, #0a1120);
  color: var(--text);
  min-height: 100vh;
  padding: 32px 18px 48px;
  display: flex;
  justify-content: center;
}

.page {
  width: min(1100px, 100%);
  position: relative;
}

.hero {
  position: relative;
  padding: 28px 28px 24px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.12), rgba(124, 58, 237, 0.08)), var(--card);
  border-radius: 22px;
  overflow: hidden;
  backdrop-filter: var(--glass);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

.hero::after, .hero::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  z-index: 0;
}

.hero::before {
  background: #4fd1c5;
  top: -60px;
  right: -120px;
}

.hero::after {
  background: #7c3aed;
  bottom: -120px;
  left: -120px;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: center;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 2.8vw, 32px);
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.badge span {
  color: #a5f3fc;
  font-size: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 16px 16px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: var(--glass);
  display: grid;
  gap: 6px;
}

.bmi-card {
  grid-column: span 2;
}

.stat-label {
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bmi-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  width: fit-content;
}

.bmi-low { color: #38bdf8; border-color: rgba(56, 189, 248, 0.35); }
.bmi-ok { color: #34d399; border-color: rgba(52, 211, 153, 0.35); }
.bmi-mid { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }
.bmi-high { color: #f87171; border-color: rgba(248, 113, 113, 0.35); }

.bmi-visual {
  margin: 8px 0 6px;
  display: grid;
  gap: 8px;
}

.bmi-scale {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    #38bdf8 0%,
    #38bdf8 21.5%,
    #34d399 21.5%,
    #34d399 47.6%,
    #fbbf24 47.6%,
    #fbbf24 66.7%,
    #f87171 66.7%,
    #f87171 100%);
  overflow: visible;
}

.bmi-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
  background: #e2e8f0;
}

.bmi-marker-label {
  position: absolute;
  top: -26px;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text);
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.bmi-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.delta {
  color: #4fd1c5;
  font-size: 13px;
  font-weight: 600;
}

.delta.down { color: #f97316; }

.panel {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 14px;
  backdrop-filter: var(--glass);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

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

.panel-header h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.entries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.entry {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.entry:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 209, 197, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

.entry-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #a5f3fc;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}

.note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.chart-wrap {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
  overflow: hidden;
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip-button {
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chip-button:hover { transform: translateY(-1px); }
.chip-button.active {
  border-color: rgba(79, 209, 197, 0.8);
  box-shadow: 0 0 0 1px rgba(79, 209, 197, 0.35);
  background: rgba(79, 209, 197, 0.12);
}

canvas {
  width: 100%;
  height: 280px;
  display: block;
}

@media (max-width: 820px) {
  body { padding: 24px 14px 40px; }
  .hero-content { grid-template-columns: 1fr; }
  .panel { padding: 16px 14px 12px; }
}

@media (max-width: 640px) {
  .bmi-card { grid-column: span 1; }
}
