:root {
  color-scheme: dark;
  --bg: #07100d;
  --panel: #101916;
  --panel-strong: #17241f;
  --text: #edf7f2;
  --muted: #9eb0a8;
  --line: rgba(255, 255, 255, 0.12);
  --green: #7ef0b2;
  --amber: #f5c25b;
  --red: #ff7a6f;
  --cyan: #78c7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(7, 16, 13, 0.2), rgba(7, 16, 13, 0.92)),
    url("https://images.unsplash.com/photo-1483347756197-71ef80e95f73?auto=format&fit=crop&w=2200&q=85");
  background-attachment: fixed;
  background-position: center top;
  background-size: cover;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: var(--green);
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero {
  min-height: 40vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: end;
  padding: 64px 0 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  max-width: 780px;
  font-size: clamp(3.2rem, 9vw, 7.4rem);
  line-height: 0.9;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.18rem;
}

.lede {
  max-width: 660px;
  color: #d9e8e0;
  font-size: 1.08rem;
  line-height: 1.65;
}

.birthday-message {
  display: inline-flex;
  max-width: 620px;
  margin: 6px 0 0;
  border: 1px solid rgba(245, 194, 91, 0.52);
  border-radius: 8px;
  background: rgba(245, 194, 91, 0.13);
  color: #ffe5a8;
  font-weight: 800;
  line-height: 1.45;
  padding: 12px 14px;
}

.birthday-message[hidden] {
  display: none;
}

.status-card,
.panel,
.metrics article {
  border: 1px solid var(--line);
  background: rgba(16, 25, 22, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.status-card {
  border-radius: 8px;
  padding: 22px;
}

.status-label,
.metrics span,
.metrics small,
.panel p,
.legend {
  color: var(--muted);
}

.status-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 2rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.metrics article {
  min-height: 132px;
  border-radius: 8px;
  padding: 20px;
}

.metrics strong {
  display: block;
  margin: 10px 0 2px;
  font-size: 2.4rem;
}

.panel {
  border-radius: 8px;
  padding: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

button {
  min-width: 92px;
  border: 1px solid rgba(126, 240, 178, 0.5);
  border-radius: 8px;
  background: rgba(126, 240, 178, 0.13);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 14px;
}

button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.chart-wrap {
  width: 100%;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: min(52vw, 480px);
  min-height: 320px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  font-size: 0.92rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.dot.kp {
  background: var(--cyan);
}

.dot.chance {
  background: var(--green);
}

.threshold {
  width: 22px;
  height: 2px;
  background: var(--amber);
}

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

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}

.error {
  color: var(--red);
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding-top: 18px;
  }

  .hero,
  .metrics,
  .details {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
