:root {
  /* WhatsApp-inspired light theme */
  --bg: #efeae2; /* chat wallpaper cream */
  --panel: #ffffff; /* cards / message panel */
  --panel-soft: #f7f4ef; /* faint cream for bubble backdrops */
  --header: #075e54; /* classic WhatsApp teal-green */
  --header-2: #128c7e;
  --border: #e7e1d8;
  --border-soft: #eceae6;
  --text: #111b21; /* WhatsApp near-black text */
  --muted: #667781; /* WhatsApp secondary text */
  --dim: #8696a0;

  --accent: #008069; /* primary green accent */
  --accent-strong: #25d366; /* iconic WhatsApp green */
  --blue: #34b7f1; /* tick blue */
  --bubble-out: #d9fdd3; /* outgoing bubble */

  --thriving: #25d366;
  --steady: #128c7e;
  --cooling: #f4a300;
  --fading: #ea4335;
  --work: #34b7f1; /* tick blue */
  --personal: #25d366; /* green */

  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 20, 26, 0.1);
  --shadow-bubble: 0 1px 1px rgba(11, 20, 26, 0.13);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 50% 50%, rgba(7, 94, 84, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, Helvetica, Arial,
    sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 32px;
  background: linear-gradient(90deg, var(--header), var(--header-2));
  box-shadow: 0 2px 6px rgba(11, 20, 26, 0.18);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.wordmark {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}
.tagline {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}
.meta {
  display: flex;
  gap: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  flex-wrap: wrap;
  align-items: center;
}
.meta b {
  color: #fff;
}
.pill {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 60px;
}

.loading {
  color: var(--muted);
  text-align: center;
  padding: 80px 0;
}

/* stat row */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.stat .num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent);
}
.stat .lbl {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 22px;
  align-items: start;
}

section.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.panel h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 700;
}

/* nudges as incoming chat bubbles */
.panel.nudges {
  background: var(--panel-soft);
}
.nudge {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--panel);
  border-radius: 2px 10px 10px 10px;
  box-shadow: var(--shadow-bubble);
  padding: 11px 13px;
  margin-bottom: 9px;
}
.nudge:last-child {
  margin-bottom: 0;
}
.nudge .dot {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
  background: var(--dim); /* fallback so an icon is never invisible */
}
.nudge .body {
  font-size: 14px;
  color: var(--text);
}
.nudge .who {
  font-weight: 700;
}
.k-reply-debt .dot {
  background: var(--cooling);
}
.k-boundary .dot {
  background: var(--fading);
}
.k-drifting .dot {
  background: var(--blue);
}
.k-responsiveness .dot {
  background: var(--accent);
}
.k-rekindle .dot {
  background: var(--accent-strong);
}
.empty {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.tick {
  color: var(--blue);
  font-weight: 700;
}

/* contacts grid */
.contacts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.contact {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  position: relative;
  box-shadow: var(--shadow);
}
.ring {
  flex: 0 0 64px;
}
.contact .name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.contact .sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.chip {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
}
.chip.work {
  color: #0b6a8e;
  background: rgba(52, 183, 241, 0.16);
}
.chip.personal {
  color: #0a8a3f;
  background: rgba(37, 211, 102, 0.16);
}
.chip.unknown {
  color: var(--dim);
  background: rgba(104, 119, 129, 0.12);
}
.chip.group {
  color: #0c6b5e;
  background: rgba(18, 140, 126, 0.15);
}
.cbody {
  min-width: 0;
}
.oweline {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-strong);
  border-radius: 999px;
  padding: 2px 9px;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.18);
}

/* balance */
.balance-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: center;
}
.weekbars {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  height: 120px;
}
.weekbars .col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.weekbars .fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent-strong), rgba(37, 211, 102, 0.45));
  min-height: 3px;
}
.weekbars .day {
  font-size: 11px;
  color: var(--muted);
}
.legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.bignum {
  font-size: 22px;
  font-weight: 800;
}

/* momentum */
.mom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 14px;
}
.mom:first-of-type {
  border-top: none;
}
.mom .rise {
  color: var(--accent);
  font-weight: 700;
}
.mom .fall {
  color: var(--cooling);
  font-weight: 700;
}

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px 40px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.dim {
  color: var(--muted);
}

@media (max-width: 860px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .balance-grid {
    grid-template-columns: 1fr;
  }
}
