:root {
  --bg-0: #171d19;
  --bg-1: #222b24;
  --ink: #f4f0e7;
  --muted: #9aa89c;
  --present: #6fbf7a;
  --absent: #d4a15a;
  --error: #d97867;
  --ring: rgba(244, 240, 231, 0.12);
  --line: rgba(244, 240, 231, 0.08);
  --font-display: "Newsreader", Georgia, serif;
  --font-ui: "Manrope", system-ui, sans-serif;
  --accent: var(--muted);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-ui);
  background: var(--bg-0);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 18% -5%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 58%),
    radial-gradient(ellipse 70% 45% at 90% 110%, rgba(90, 110, 100, 0.14), transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0) 60%);
  animation: drift 20s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

body:has([data-state="present"]) {
  --accent: var(--present);
}

body:has([data-state="absent"]) {
  --accent: var(--absent);
}

body:has([data-state="error"]) {
  --accent: var(--error);
}

@keyframes drift {
  from {
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.05) translate3d(0, -1.2%, 0);
  }
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  max-width: 58rem;
  margin: 0 auto;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.brand {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.who {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.5vw, 2.2rem);
  font-weight: 500;
  line-height: 1.15;
}

.live {
  margin: 0.2rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  animation: breathe 2.4s ease-out infinite;
}

@keyframes breathe {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  }
  70% {
    box-shadow: 0 0 0 0.55rem transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
  width: 100%;
}

.verdict {
  min-width: 0;
}

.status {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 5.4rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
  animation: rise 0.5s ease both;
}

.detail {
  margin: 0.85rem 0 0;
  max-width: 32rem;
  font-size: clamp(1rem, 2.1vw, 1.15rem);
  line-height: 1.45;
  color: var(--muted);
  animation: rise 0.65s ease both;
}

.confidence {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}

.last-seen {
  margin: 1.35rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.25rem;
  max-width: 28rem;
}

.last-seen-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.last-seen-value {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 600;
  line-height: 1.3;
}

.gauge {
  position: relative;
  width: clamp(8.5rem, 22vw, 10.5rem);
  height: clamp(8.5rem, 22vw, 10.5rem);
  flex-shrink: 0;
  animation: rise 0.75s ease both;
}

.gauge-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track,
.gauge-progress {
  fill: none;
  stroke-width: 7;
}

.gauge-track {
  stroke: var(--ring);
}

.gauge-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.8s ease, stroke 0.4s ease;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 45%, transparent));
}

.gauge-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.gauge-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.35rem);
  font-weight: 600;
  line-height: 1;
}

.gauge-value small {
  font-size: 0.45em;
  color: var(--muted);
  margin-left: 0.05em;
}

.gauge-label {
  margin: 0.3rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.hint {
  margin: 0;
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.4;
  max-width: 40rem;
}

.signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  width: 100%;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.signal {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.85rem 0 0;
  min-width: 0;
}

.signal-dot {
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: #5d6960;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.signal[data-on="true"] .signal-dot {
  background: var(--present);
  box-shadow: 0 0 12px color-mix(in srgb, var(--present) 55%, transparent);
}

.signal[data-on="false"] .signal-dot:not(.habit) {
  background: #5d6960;
}

.signal-dot.habit {
  background: color-mix(in srgb, var(--accent) 70%, #5d6960);
}

.signal-title {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.signal-state {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.signal-badge {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.85;
  margin-top: 0.2rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.55rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

  .gauge {
    justify-self: start;
  }

  .signals {
    grid-template-columns: 1fr;
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel {
    grid-template-columns: 1fr;
  }
}

.panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.75rem 2rem;
  width: 100%;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.panel-title {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
  max-height: 14rem;
  overflow: auto;
}

.timeline li {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.timeline time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.timeline-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.heatmap {
  display: grid;
  grid-template-columns: 1.6rem repeat(24, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
}

.hm-label {
  font-size: 0.62rem;
  color: var(--muted);
  align-self: center;
  text-transform: uppercase;
}

.hm-cell {
  aspect-ratio: 1;
  min-height: 0.55rem;
  background: rgba(244, 240, 231, 0.06);
}

.hm-head {
  font-size: 0.55rem;
  color: var(--muted);
  text-align: center;
}

.feedback {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.feedback-label {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.feedback-hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.btn {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--present) 55%, transparent);
  background: color-mix(in srgb, var(--present) 18%, transparent);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
}

.btn:hover {
  background: color-mix(in srgb, var(--present) 28%, transparent);
}

.btn-ghost {
  border-color: var(--ring);
  background: transparent;
}

.btn-ghost:hover {
  background: rgba(244, 240, 231, 0.06);
}

.feedback-note {
  margin: 0.55rem 0 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--muted);
}
