/* Boring — "Your health, visualised". Built on the happy-longevity tokens
   (butter + ink on warm paper; Nunito Sans display, DM Sans body). */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  color: var(--boring-color-text-primary);
  background: var(--boring-color-surface-page);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  overflow: hidden;
}
h1, h2, h3, h4 { font-family: "Nunito Sans", system-ui, sans-serif; margin: 0; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

:root {
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-camera: cubic-bezier(0.65, 0, 0.25, 1);
  --good: #4F7A4A;
  --good-soft: var(--boring-palette-sage);
  --attn: #B7832A;
  --attn-soft: var(--boring-palette-attention);
  --glass: rgb(255 254 250 / 0.82);
  --glass-line: rgb(41 73 104 / 0.09);
}

/* ---- ambient mood light ------------------------------------------------------ */
.mood { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* Four soft colour blobs, each floating on its own slow loop while its shape
   gently morphs, like light moving behind frosted glass. */
.mood span {
  position: absolute; filter: blur(64px); opacity: 0.6;
  border-radius: 46% 54% 58% 42% / 44% 48% 52% 56%;
  will-change: transform, border-radius;
  animation: var(--path) var(--dur) ease-in-out infinite, morph calc(var(--dur) * .7) ease-in-out infinite alternate;
}
.mood span:nth-child(1) { --path: float-a; --dur: 22s; width: 52vmax; height: 52vmax; left: -14vmax; top: -18vmax; background: #F6DB93; }
.mood span:nth-child(2) { --path: float-b; --dur: 26s; width: 46vmax; height: 46vmax; right: -16vmax; top: 8vmax; background: #CFE2EE; animation-delay: -9s, -4s; }
.mood span:nth-child(3) { --path: float-c; --dur: 30s; width: 40vmax; height: 40vmax; left: 18vmax; bottom: -24vmax; background: #F5D2B4; opacity: 0.5; animation-delay: -15s, -8s; }
.mood span:nth-child(4) { --path: float-d; --dur: 19s; width: 30vmax; height: 30vmax; right: 12vmax; bottom: -8vmax; background: #DCEAD3; opacity: 0.55; animation-delay: -6s, -2s; }
@keyframes float-a {
  0%, 100% { transform: translate(0, 0) rotate(0) scale(1); }
  33% { transform: translate(12vmax, 7vmax) rotate(40deg) scale(1.12); }
  66% { transform: translate(4vmax, 14vmax) rotate(-20deg) scale(.94); }
}
@keyframes float-b {
  0%, 100% { transform: translate(0, 0) rotate(0) scale(1); }
  33% { transform: translate(-11vmax, 9vmax) rotate(-35deg) scale(.92); }
  66% { transform: translate(-5vmax, -6vmax) rotate(25deg) scale(1.1); }
}
@keyframes float-c {
  0%, 100% { transform: translate(0, 0) rotate(0) scale(1); }
  33% { transform: translate(10vmax, -10vmax) rotate(30deg) scale(1.14); }
  66% { transform: translate(-9vmax, -4vmax) rotate(-30deg) scale(.95); }
}
@keyframes float-d {
  0%, 100% { transform: translate(0, 0) rotate(0) scale(1); }
  33% { transform: translate(-9vmax, -8vmax) rotate(-45deg) scale(1.18); }
  66% { transform: translate(6vmax, -12vmax) rotate(20deg) scale(.9); }
}
@keyframes morph {
  0% { border-radius: 46% 54% 58% 42% / 44% 48% 52% 56%; }
  50% { border-radius: 60% 40% 38% 62% / 55% 38% 62% 45%; }
  100% { border-radius: 38% 62% 50% 50% / 40% 60% 40% 60%; }
}

/* ---- screens ------------------------------------------------------------------ */
#app { position: fixed; inset: 0; z-index: 1; }
.screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease), visibility .6s;
}
.screen[data-active] { opacity: 1; visibility: visible; transform: none; }
.screen--stage { padding: 0; overflow: hidden; }

/* ---- buttons ------------------------------------------------------------------ */
.btn {
  font: var(--boring-typography-button);
  border-radius: var(--boring-radius-pill); border: 1.5px solid transparent;
  min-height: 48px; padding: 0 24px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .14s var(--ease), background .2s, border-color .2s, opacity .2s, box-shadow .2s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--boring-color-action-primary); color: var(--boring-color-action-on-primary); box-shadow: 0 10px 24px -12px rgb(41 73 104 / .6); }
.btn--primary:hover:not(:disabled) { background: var(--boring-color-action-hover); }
.btn--ghost { background: var(--boring-color-surface-card); border-color: var(--boring-color-border-subtle); }
.btn--ghost:hover { border-color: var(--boring-color-border-focus); }
.btn--text { background: none; color: var(--boring-color-text-secondary); min-height: 40px; padding: 0 12px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(89 105 120 / .35); }
.btn--text:hover { color: var(--boring-color-text-primary); }
.btn--lg { min-height: 58px; padding: 0 34px; font-size: 18px; }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }
:focus-visible { outline: 3px solid var(--boring-color-border-focus); outline-offset: 3px; }

.iconbtn {
  width: 46px; height: 46px; flex: none; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--glass-line); background: var(--boring-color-surface-card);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .14s var(--ease), background .2s, border-color .2s;
}
.iconbtn:hover { border-color: var(--boring-color-border-focus); }
.iconbtn:active { transform: scale(0.94); }
.iconbtn--sm { width: 34px; height: 34px; }

/* ---- welcome ------------------------------------------------------------------ */
.welcome { max-width: 700px; text-align: center; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 36px; }
.wordmark img { width: 34px; }
.wordmark span { font: var(--boring-typography-wordmark); font-size: 26px; letter-spacing: -1px; }
.welcome__title { font-weight: 800; font-size: clamp(42px, 8.4vw, 84px); line-height: 1.0; letter-spacing: -0.035em; margin-bottom: 24px; }
.welcome__title em { font-style: normal; background: linear-gradient(transparent 62%, rgb(242 202 102 / .75) 62%, rgb(242 202 102 / .75) 92%, transparent 92%); padding: 0 .06em; }
.welcome__lede { font-size: clamp(17px, 2.2vw, 20px); line-height: 1.55; color: var(--boring-color-text-secondary); max-width: 34em; margin: 0 auto 36px; }
.welcome__note { margin-top: 18px; font-size: 13.5px; color: var(--boring-color-text-secondary); }
.dev-note { margin: 22px auto 0; max-width: 30em; font-size: 13px; padding: 10px 14px; border-radius: 12px; background: var(--attn-soft); color: var(--boring-color-status-attention-foreground); }

/* ---- sheets (selfie + report) ------------------------------------------------- */
.sheet {
  width: 100%; max-width: 470px; text-align: center; margin: auto;
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--glass-line); border-radius: var(--boring-radius-sheet);
  box-shadow: 0 40px 80px -40px rgb(41 73 104 / .35);
  padding: 40px 32px 28px;
}
.eyebrow { font: var(--boring-typography-label); letter-spacing: 1.3px; text-transform: uppercase; color: var(--boring-color-text-secondary); margin-bottom: 10px; }
.sheet__title { font-weight: 800; font-size: clamp(28px, 5vw, 36px); letter-spacing: -0.025em; margin-bottom: 10px; }
.sheet__lede { color: var(--boring-color-text-secondary); line-height: 1.5; margin: 0 auto 26px; max-width: 30em; }
.sheet__error { margin-top: 14px; font-size: 14px; line-height: 1.45; padding: 10px 14px; border-radius: 12px; background: var(--attn-soft); color: var(--boring-color-status-attention-foreground); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 8px; }

.selfie { margin-bottom: 22px; }
.selfie__frame {
  width: 250px; height: 250px; margin: 0 auto; position: relative; overflow: hidden;
  border-radius: 40% 40% 44% 44% / 44% 44% 40% 40%;
  background: var(--boring-palette-sky);
  box-shadow: 0 0 0 6px var(--boring-color-surface-card), 0 0 0 7px var(--glass-line), 0 30px 50px -30px rgb(41 73 104 / .5);
}
.selfie__frame video, .selfie__frame img { width: 100%; height: 100%; object-fit: cover; }
.selfie__frame video { transform: scaleX(-1); }
.selfie__placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--boring-color-text-secondary); padding: 24px; }
.selfie__guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.selfie__guide ellipse { fill: none; stroke: rgb(255 251 242 / .8); stroke-width: .8; stroke-dasharray: 2 2.4; }
.selfie__frame:has(img:not([hidden])) .selfie__guide { display: none; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 34px 20px; border-radius: var(--boring-radius-hero); cursor: pointer;
  border: 1.5px dashed var(--boring-color-border-control); background: rgb(255 251 242 / .7);
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--boring-color-border-focus); background: var(--boring-palette-sky); transform: translateY(-2px); }
.dropzone.is-busy { pointer-events: none; opacity: .6; }
.dropzone__icon { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--boring-color-surface-card); margin-bottom: 6px; box-shadow: var(--boring-shadow-raised); }
.dropzone__title { font-weight: 600; font-size: 17px; }
.dropzone__sub { font-size: 14px; color: var(--boring-color-text-secondary); }
.or { display: flex; align-items: center; gap: 12px; color: var(--boring-color-text-secondary); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--boring-color-border-subtle); }

.drawing { display: inline-flex; align-items: center; gap: 10px; margin: -12px auto 22px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--boring-palette-sky); font-size: 13.5px; font-weight: 500; }
.drawing__face { width: 34px; height: 34px; flex: none; border-radius: 999px; overflow: hidden; background: var(--boring-color-surface-card); }
.drawing__face img { width: 100%; height: 100%; object-fit: cover; animation: shimmer 1.6s ease-in-out infinite; }
/* once matched, zoom the full-body character to its face */
.drawing.is-done .drawing__face img { width: 110px; height: 165px; max-width: none; object-fit: fill; margin: -13px 0 0 -38px; animation: none; }
@keyframes shimmer { 50% { filter: saturate(.3) brightness(1.15); } }

/* ---- stage --------------------------------------------------------------------- */
.stage { position: absolute; inset: 0; }
.viewport { position: absolute; inset: 0; overflow: hidden; }

.topbar {
  position: absolute; z-index: 20; top: 0; left: 0; right: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) 20px 12px;
}
.topbar::before {
  content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: linear-gradient(to bottom, rgb(255 251 242 / .96) 55%, rgb(255 251 242 / 0));
}
.stage[data-mode="focus"] .topbar::before { opacity: 1; }
.topbar__title { text-align: center; }
.topbar__title strong { display: block; font-family: "Nunito Sans"; font-weight: 800; font-size: 19px; letter-spacing: -0.015em; }
.topbar__title span { display: block; font-size: 13px; color: var(--boring-color-text-secondary); margin-top: 1px; }
.topbar__pills { justify-self: end; display: flex; gap: 8px; }
.stage[data-mode="reveal"] .topbar__title, .stage[data-mode="reveal"] .topbar__pills { opacity: 0; }
.topbar__title, .topbar__pills { transition: opacity .5s; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 8px 0 14px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass); backdrop-filter: blur(12px);
  font-size: 13.5px; font-weight: 600; animation: pop .5s var(--ease) both;
}
.pill b { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--boring-palette-sky); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.pill--plan b { background: var(--boring-palette-butter); }
.pill[aria-expanded="true"] { border-color: var(--boring-color-border-focus); }
.popover {
  position: absolute; top: calc(100% - 2px); right: 20px; width: min(360px, calc(100vw - 40px)); max-height: 60vh; overflow: auto;
  background: var(--boring-color-surface-card); border: 1px solid var(--glass-line); border-radius: 22px; padding: 18px 20px;
  box-shadow: 0 30px 60px -30px rgb(41 73 104 / .45); animation: pop .3s var(--ease) both;
}
.popover h4 { font-size: 16px; margin-bottom: 12px; }
.popover ul, .popover ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.facts li { font-size: 14.5px; line-height: 1.4; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; text-transform: capitalize; padding: 2px 8px; margin-right: 8px; border-radius: 999px; background: var(--boring-palette-sky); vertical-align: 1px; }
.plan { counter-reset: step; }
.plan li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; font-size: 14px; line-height: 1.4; }
.plan li::before { content: counter(step); grid-row: span 3; width: 26px; height: 26px; border-radius: 999px; background: var(--boring-palette-butter); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.plan li span { color: var(--boring-color-text-secondary); font-size: 13px; }
.plan li em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--boring-color-text-secondary); }

/* reveal intro + progress */
.intro { position: absolute; z-index: 5; top: max(56px, 8vh); left: 0; right: 0; text-align: center; padding: 0 24px; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.intro h2 { font-weight: 800; font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.025em; margin-bottom: 6px; }
.intro p { color: var(--boring-color-text-secondary); font-size: 16px; }
.stage:not([data-mode="reveal"]) .intro { opacity: 0; transform: translateY(-16px); pointer-events: none; }
.progress {
  position: absolute; z-index: 5; left: 50%; bottom: max(40px, 6vh); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px 12px 12px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--glass-line); font-size: 15px; white-space: nowrap;
  box-shadow: 0 20px 40px -24px rgb(41 73 104 / .4); transition: opacity .5s, transform .5s var(--ease);
}
.progress__pulse { width: 34px; height: 34px; border-radius: 999px; background: var(--good-soft); color: var(--good); display: flex; align-items: center; justify-content: center; animation: breathe-dot 1.6s ease-in-out infinite; }
@keyframes breathe-dot { 50% { transform: scale(1.12); } }
.stage:not([data-mode="reveal"]) .progress { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }

/* the character */
.figure {
  position: absolute; z-index: 2; transform-origin: 0 0; perspective: 1600px;
  transition: transform 1.25s var(--ease-camera);
  will-change: transform;
}
.figure__tilt { position: absolute; inset: 0; transform-style: preserve-3d; }
.figure__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transform-origin: 50% 96%; animation: breathe 5.5s ease-in-out infinite;
  filter: drop-shadow(0 30px 40px rgb(41 73 104 / .18));
  opacity: 0; transition: opacity .9s var(--ease);
}
.figure__img[src] { opacity: 1; }
/* If a generated avatar comes back cropped at the feet, this makes the edge read as a deliberate fade. */
.figure__img.is-cropped { -webkit-mask-image: linear-gradient(to top, transparent 0, #000 9%); mask-image: linear-gradient(to top, transparent 0, #000 9%); }
.figure__img.is-swapping { opacity: 0; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.004, 1.009); } }
.figure__halo {
  position: absolute; left: -15%; right: -15%; top: 8%; bottom: 12%;
  background: radial-gradient(closest-side, rgb(255 251 242 / .95), rgb(255 251 242 / 0));
}
.stage[data-mode="reveal"] .figure__halo {
  background: radial-gradient(closest-side, rgb(255 251 242 / .95) 55%, rgb(228 237 221 / .6) 70%, rgb(255 251 242 / 0));
  border-radius: 50%;
}
.figure__shadow { position: absolute; left: 22%; right: 22%; bottom: 1.2%; height: 3.2%; border-radius: 50%; background: radial-gradient(closest-side, rgb(41 73 104 / .22), transparent); }

/* hotspots on the body */
.hotspot { position: absolute; width: 0; height: 0; z-index: 3; opacity: 0; transition: opacity .5s; }
.stage[data-mode="overview"] .hotspot, .stage[data-mode="focus"] .hotspot { opacity: 1; }
.stage[data-mode="focus"] .hotspot:not(.is-focused) { opacity: 0; }
.hotspot > * { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) scale(var(--inv, 1)); }
.hotspot__dot { width: 11px; height: 11px; border-radius: 999px; background: var(--boring-color-surface-card); border: 2.5px solid var(--good); box-shadow: 0 2px 6px rgb(41 73 104 / .3); transition: opacity .4s; }
.hotspot[data-tone="attention"] .hotspot__dot { border-color: var(--attn); }
.hotspot__pulse { width: 11px; height: 11px; border-radius: 999px; background: var(--good); opacity: 0; }
.hotspot[data-tone="attention"] .hotspot__pulse { background: var(--boring-palette-butter); animation: ping 2.2s var(--ease) infinite; }
@keyframes ping { 0% { opacity: .7; transform: translate(-50%, -50%) scale(var(--inv, 1)); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(calc(var(--inv, 1) * 4)); } }
.hotspot__icon { width: 100px; height: 100px; max-width: none; opacity: 0; transition: opacity .5s .5s, transform .6s .4s var(--ease); transform: translate(-50%, -50%) scale(calc(var(--inv, 1) * .4)); filter: drop-shadow(0 8px 14px rgb(41 73 104 / .3)); }
.hotspot.is-focused .hotspot__icon { opacity: 1; transform: translate(-50%, -50%) scale(calc(var(--inv, 1) * 1)); }
.hotspot.is-focused .hotspot__dot { opacity: 0; }
.hotspot.is-focused .hotspot__pulse { animation: ping 2.2s var(--ease) infinite; background: var(--good-soft); }
.hotspot.is-focused[data-tone="attention"] .hotspot__pulse { background: var(--boring-palette-butter); }
.hotspot.is-focused::before {
  content: ""; position: absolute; left: 0; top: 0; width: 220px; height: 220px; border-radius: 50%;
  transform: translate(-50%, -50%) scale(var(--inv, 1));
  background: radial-gradient(closest-side, rgb(228 237 221 / .95), rgb(228 237 221 / 0));
  animation: fade-in .8s .3s both;
}
.hotspot.is-focused[data-tone="attention"]::before { background: radial-gradient(closest-side, rgb(248 236 212 / .98), rgb(242 202 102 / .35) 60%, rgb(242 202 102 / 0)); }
@keyframes fade-in { from { opacity: 0; } }

/* "connect the dots": one habit lights up several organs at once */
.stage[data-connect] .callout:not(.is-lit) { opacity: .3 !important; }
.stage[data-connect] .hotspot:not(.is-lit) { opacity: .25; }
.callout.is-lit { border-color: var(--boring-palette-butter); box-shadow: 0 0 0 3px rgb(242 202 102 / .45), 0 22px 46px -24px rgb(41 73 104 / .6); }
.hotspot.is-lit .hotspot__dot { width: 15px; height: 15px; border-color: var(--attn); }
.hotspot.is-lit .hotspot__pulse { background: var(--boring-palette-butter); animation: ping 1.6s var(--ease) infinite; }
.stage[data-connect] .leaders path:not([data-lit]) { opacity: .2; }
.leaders path[data-lit] { stroke: rgb(214 160 52 / .95); stroke-width: 2.2; }
.insight {
  position: absolute; z-index: 16; top: 84px; left: 50%; transform: translate(-50%, -14px);
  display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: min(460px, calc(100vw - 32px));
  padding: 12px 22px; border-radius: 22px; text-align: center;
  background: var(--boring-palette-butter); color: var(--boring-palette-ink);
  box-shadow: 0 20px 40px -22px rgb(121 82 20 / .55);
  opacity: 0; pointer-events: none; transition: opacity .45s var(--ease), transform .55s var(--ease);
}
.stage:is([data-connect], [data-summary]) .insight { opacity: 1; transform: translate(-50%, 0); }
/* results at a glance: everything visible, good ones glow green, the rest lit butter */
.stage[data-summary] .callout[data-tone="good"] { border-color: rgb(79 122 74 / .45); box-shadow: 0 0 0 3px rgb(111 167 102 / .28), 0 18px 40px -26px rgb(41 73 104 / .5); }
.stage[data-summary] .hotspot[data-tone="good"] .hotspot__dot { border-color: #6ea766; }
.stage[data-summary] .leaders path[data-tone="good"] { stroke: rgb(111 167 102 / .55); }
.insight__kicker { font: var(--boring-typography-label); letter-spacing: 1.2px; text-transform: uppercase; opacity: .75; }
.insight__habit { font-family: "Nunito Sans"; font-weight: 800; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }
.insight__organs { font-size: 13.5px; font-weight: 600; }

/* connector lines */
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.leaders path { fill: none; stroke: rgb(41 73 104 / .32); stroke-width: 1.3; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s var(--ease); }
.leaders path[data-tone="attention"] { stroke: rgb(183 131 42 / .6); }
.leaders.is-drawn path { stroke-dashoffset: 0; }

/* callouts */
.callouts { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.callout {
  position: absolute; left: 0; top: 0; width: 236px; min-height: 88px; pointer-events: auto; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 12px;
  border-radius: 22px; border: 1px solid var(--glass-line); background: var(--glass); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 18px 40px -26px rgb(41 73 104 / .5);
  opacity: 0;
  transition: transform 1s var(--ease-camera), opacity .45s var(--ease), width .6s var(--ease), padding .6s var(--ease), border-radius .6s var(--ease), border-color .2s, box-shadow .2s;
}
.callout.is-in { opacity: 1; }
.callout:hover { border-color: rgb(41 73 104 / .35); box-shadow: 0 22px 46px -24px rgb(41 73 104 / .6); }
.callout__icon { width: 56px; height: 56px; flex: none; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--good-soft); transition: border-radius .6s var(--ease), width .6s var(--ease), height .6s var(--ease); }
.callout[data-tone="attention"] .callout__icon { background: var(--attn-soft); }
.callout__icon img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 4px 6px rgb(41 73 104 / .2)); }
.callout.is-in .callout__icon img { animation: pop .6s var(--ease) both; }
.callout__fallback { font-family: "Nunito Sans"; font-weight: 800; font-size: 22px; }
.callout__body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.callout__name { font-weight: 600; font-size: 15.5px; }
.callout__status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--good); }
.callout__status i { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.callout[data-tone="attention"] .callout__status { color: var(--attn); }
.callout__line { font-size: 12.5px; line-height: 1.35; color: var(--boring-color-text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.callout__label { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }

/* compact callouts: icon bubbles (reveal ring, and mobile) */
.is-compact .callout { width: 64px; min-height: 64px; padding: 4px; border-radius: 999px; gap: 0; justify-content: center; }
.is-compact .callout__icon { width: 54px; height: 54px; border-radius: 999px; }
.is-compact .callout__body { display: none; }
.stage.is-mobile:not([data-mode="reveal"]) .callout__label { display: block; position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.stage.is-mobile:not([data-mode="reveal"]) .callout { overflow: visible; }

.stage[data-mode="focus"] .callout { opacity: 0 !important; pointer-events: none; }

/* organ detail */
.detail {
  position: absolute; z-index: 15; right: 20px; top: 84px; bottom: 20px; width: min(420px, 36vw); overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 24px 28px; border-radius: 30px; border: 1px solid var(--glass-line);
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 40px 80px -40px rgb(41 73 104 / .45);
  opacity: 0; transform: translateX(40px); pointer-events: none;
  transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.detail.is-open { opacity: 1; transform: none; pointer-events: auto; transition-delay: .25s; }
.detail__close { position: absolute; top: 18px; right: 18px; }
.detail__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding-right: 40px; }
.detail__icon { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 8px 12px rgb(41 73 104 / .25)); }
.detail__system { font: var(--boring-typography-label); letter-spacing: 1.2px; text-transform: uppercase; color: var(--boring-color-text-secondary); }
.detail__name { font-weight: 800; font-size: 30px; letter-spacing: -0.025em; line-height: 1.1; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--good-soft); color: var(--good); }
.chip[data-tone="attention"] { background: var(--attn-soft); color: var(--boring-color-status-attention-foreground); }
.detail__headline { font-family: "Nunito Sans"; font-weight: 800; font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; margin: 14px 0 8px; }
.detail__explain { font-size: 15px; line-height: 1.55; color: var(--boring-color-text-primary); margin-bottom: 18px; }
.detail__h { font-size: 13px; font-family: "DM Sans"; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--boring-color-text-secondary); margin: 20px 0 10px; }
.markers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.marker { padding: 12px 14px; border-radius: 16px; background: rgb(255 254 250 / .75); border: 1px solid var(--glass-line); transition: border-color .3s, box-shadow .3s, transform .3s var(--ease); }
.marker.is-highlighted { border-color: var(--boring-color-border-focus); box-shadow: 0 0 0 3px rgb(242 202 102 / .45); transform: scale(1.015); }
.marker__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.marker__name { font-weight: 600; font-size: 14.5px; }
.marker__value { font-family: "Nunito Sans"; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.marker__value small { font-family: "DM Sans"; font-weight: 500; font-size: 12px; color: var(--boring-color-text-secondary); margin-left: 3px; }
.marker__row--meta { font-size: 12.5px; color: var(--boring-color-text-secondary); margin-top: 2px; }
.marker__status { font-weight: 600; color: var(--good); }
.marker[data-tone="attention"] .marker__status { color: var(--attn); }
.marker__meaning { font-size: 13px; line-height: 1.45; color: var(--boring-color-text-secondary); margin-top: 6px; }
.guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guide li { position: relative; padding: 12px 14px 12px 40px; border-radius: 16px; background: var(--good-soft); font-size: 14.5px; line-height: 1.4; }
.guide li::before { content: ""; position: absolute; left: 14px; top: 14px; width: 16px; height: 16px; border-radius: 999px; background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/10px no-repeat; }
.detail__plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.detail__plan li { padding: 12px 14px; border-radius: 16px; background: rgb(242 202 102 / .3); display: grid; gap: 2px; font-size: 14.5px; }
.detail__plan li span { font-size: 13px; color: var(--boring-color-text-secondary); }

/* the call with Boring ---------------------------------------------------------
   One dark pill on the warm page, so it reads as a live phone call.
   data-state: hidden | incoming | connecting | live */
.call {
  --answer: #3E9B57; --hangup: #C8503F;
  position: absolute; z-index: 18; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); width: min(560px, calc(100vw - 24px));
  transform: translate(-50%, 0);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 12px 12px 12px 14px; border-radius: 999px;
  background: var(--boring-palette-ink); color: var(--boring-palette-paper);
  box-shadow: 0 30px 60px -24px rgb(24 48 71 / .6), 0 0 0 1px rgb(255 255 255 / .06) inset;
  transition: left .8s var(--ease), transform .6s var(--ease), opacity .45s var(--ease);
}
.call[data-state="hidden"] { opacity: 0; transform: translate(-50%, 140%); pointer-events: none; }
#app:has(.screen--stage[data-active] .stage[data-mode="reveal"]) .call { opacity: 0; transform: translate(-50%, 140%); pointer-events: none; }
#app:has(.screen--stage[data-active] .stage[data-mode="focus"]:not(.is-mobile)) .call { left: calc((100% - min(420px, 36vw) - 20px) / 2); }
.call[data-state="incoming"] { animation: call-shake 2.4s var(--ease) infinite; }
@keyframes call-shake { 0%, 20%, 100% { transform: translate(-50%, 0); } 4% { transform: translate(calc(-50% - 3px), 0) rotate(-.6deg); } 8% { transform: translate(calc(-50% + 3px), 0) rotate(.6deg); } 12% { transform: translate(calc(-50% - 2px), 0); } 16% { transform: translate(calc(-50% + 2px), 0); } }

.call__avatar { position: relative; width: 58px; height: 58px; flex: none; }
.call__face {
  position: absolute; inset: 0; border-radius: 999px; background: var(--boring-palette-wash);
  display: flex; align-items: center; justify-content: center; z-index: 1;
  transform: scale(calc(1 + var(--agent-level, 0) * .14)); transition: transform .08s;
}
.call__face svg { transition: transform .3s var(--ease); }
.call[data-speaking="agent"] .call__face svg { animation: bob .9s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2px) rotate(-3deg); } }
.call[data-speaking="user"] .eyes { stroke-width: 7; }
/* ripples: ringing when incoming, voice-reactive when live */
.call__wave { position: absolute; inset: 0; border-radius: 999px; border: 2px solid var(--boring-palette-butter); opacity: 0; }
.call[data-state="incoming"] .call__wave, .call[data-state="connecting"] .call__wave { animation: ripple 2.1s var(--ease) infinite; }
.call[data-state="incoming"] .call__wave:nth-child(2), .call[data-state="connecting"] .call__wave:nth-child(2) { animation-delay: .7s; }
.call[data-state="incoming"] .call__wave:nth-child(3), .call[data-state="connecting"] .call__wave:nth-child(3) { animation-delay: 1.4s; }
@keyframes ripple { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
.call[data-state="live"] .call__wave:first-child { opacity: calc(.25 + var(--level, 0) * .75); transform: scale(calc(1.06 + var(--level, 0) * .5)); transition: transform .08s, opacity .08s; }
.call[data-state="live"][data-speaking="user"] .call__wave:first-child { border-color: rgb(255 251 242 / .7); }

.call__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.call__name { font-family: "Nunito Sans"; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.call__status { font-size: 13.5px; color: rgb(255 251 242 / .72); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call__meta { display: flex; align-items: center; gap: 10px; min-height: 18px; }
.call:not([data-state="live"]) .call__meta { display: none; }
.call__bars { display: none; align-items: center; gap: 3px; height: 16px; }
.call[data-state="live"] .call__bars { display: inline-flex; }
.call__bars i { width: 3px; border-radius: 3px; background: var(--boring-palette-butter); height: calc(3px + var(--level, 0) * var(--k) * 13px); transition: height .08s; }
.call__bars i:nth-child(1) { --k: .5; } .call__bars i:nth-child(2) { --k: .9; } .call__bars i:nth-child(3) { --k: 1.2; } .call__bars i:nth-child(4) { --k: .8; } .call__bars i:nth-child(5) { --k: .45; }
.call__topic { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: rgb(255 251 242 / .14); white-space: nowrap; }
.call__topic:empty { display: none; }

.call__controls { display: flex; align-items: center; gap: 10px; }
.callbtn {
  width: 52px; height: 52px; border-radius: 999px; border: 0; cursor: pointer; flex: none;
  display: none; align-items: center; justify-content: center; gap: 8px;
  background: rgb(255 251 242 / .12); color: var(--boring-palette-paper);
  transition: transform .14s var(--ease), background .2s;
}
.callbtn:hover { background: rgb(255 251 242 / .2); }
.callbtn:active { transform: scale(.93); }
.callbtn--accept { background: var(--answer); width: auto; padding: 0 22px 0 18px; font-weight: 600; font-size: 15px; animation: breathe-dot 1.4s ease-in-out infinite; }
.callbtn--accept:hover { background: #358A4C; }
.callbtn--end { background: var(--hangup); }
.callbtn--end:hover { background: #B34636; }
.call[data-state="incoming"] :is(.callbtn--later, .callbtn--accept) { display: inline-flex; }
.call[data-state="connecting"] .callbtn--end, .call[data-state="live"] :is(.callbtn--mute, .callbtn--end) { display: inline-flex; }
#btn-mute .ic-muted { display: none; }
#btn-mute[aria-pressed="true"] { background: var(--boring-palette-paper); color: var(--boring-palette-ink); }
#btn-mute[aria-pressed="true"] .ic-mic { display: none; }
#btn-mute[aria-pressed="true"] .ic-muted { display: block; }

/* "call Boring" when there's no call on screen */
.callme {
  position: absolute; z-index: 17; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px 0 18px; cursor: pointer;
  border: 0; border-radius: 999px; background: var(--boring-palette-ink); color: var(--boring-palette-paper);
  font-weight: 600; font-size: 15px; white-space: nowrap; box-shadow: 0 20px 40px -20px rgb(24 48 71 / .6);
  transition: left .8s var(--ease), transform .14s var(--ease), opacity .4s;
  animation: pop .5s var(--ease) both;
}
.callme svg { color: #7DD39A; }
.callme:active { transform: translateX(-50%) scale(.97); }
.stage[data-mode="reveal"] .callme { opacity: 0; pointer-events: none; }
.stage[data-mode="focus"]:not(.is-mobile) .callme { left: calc((100% - min(420px, 36vw) - 20px) / 2); }

/* toast */
.toast {
  position: absolute; z-index: 30; top: 88px; left: 50%; transform: translate(-50%, -12px);
  display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 10px 18px 10px 10px; border-radius: 999px;
  background: var(--boring-color-surface-inverse); color: var(--boring-color-text-inverse); font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .35s, transform .45s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast__kind { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--boring-palette-butter); color: var(--boring-palette-ink); font-size: 12px; font-weight: 600; }

/* ---- onboarding & auth ------------------------------------------------------- */
.welcome__auth-status {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 22px;
  padding: 6px 14px 6px 12px; border-radius: 999px;
  background: var(--boring-color-surface-card); border: 1px solid var(--glass-line);
  box-shadow: 0 4px 12px -4px rgb(41 73 104 / 0.1);
}
.welcome__auth-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--boring-color-text-primary);
}
.welcome__cta-group {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px;
}

.btn--inline {
  background: none; border: none; padding: 0; font: inherit; font-size: 13.5px;
  color: var(--boring-color-text-secondary); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; transition: color .15s;
}
.btn--inline:hover { color: var(--boring-color-text-primary); }

.auth-form {
  display: grid; gap: 16px; margin-top: 8px; width: 100%;
}
.phone-input-wrap {
  display: flex; align-items: center; height: 56px; width: 100%;
  background: var(--boring-color-surface-card); border: 1.5px solid var(--boring-color-border-subtle);
  border-radius: 14px; overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.phone-input-wrap:focus-within {
  border-color: var(--boring-color-border-focus);
  box-shadow: 0 0 0 3px rgb(41 73 104 / 0.12);
}
.select-prefix {
  position: relative; height: 100%; display: flex; align-items: center;
  border-right: 1.5px solid var(--boring-color-border-subtle); background: rgb(255 254 250 / 0.7);
}
.select-prefix select {
  height: 100%; border: none; background: transparent; font-family: inherit;
  font-size: 15px; font-weight: 600; color: var(--boring-color-text-primary);
  padding: 0 10px 0 14px; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.phone-number-field {
  flex: 1; height: 100%; border: none; background: transparent; font-family: inherit;
  font-size: 18px; color: var(--boring-color-text-primary); padding: 0 16px;
  outline: none; letter-spacing: 0.4px; min-width: 0;
}
.phone-number-field::placeholder { color: var(--boring-palette-muted); opacity: 0.6; }

.otp-boxes {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 10px 0 4px;
}
.otp-box {
  width: 100%; height: 58px; text-align: center;
  font-family: "Nunito Sans", system-ui, sans-serif; font-size: 26px; font-weight: 700;
  color: var(--boring-color-text-primary); background: var(--boring-color-surface-card);
  border: 1.5px solid var(--boring-color-border-subtle); border-radius: 12px;
  outline: none; transition: border-color .18s, transform .14s, box-shadow .18s;
  padding: 0;
}
.otp-box:focus {
  border-color: var(--boring-color-border-focus);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px -2px rgb(41 73 104 / 0.15), 0 0 0 3px rgb(41 73 104 / 0.12);
}
.otp-box.is-filled {
  border-color: var(--boring-palette-ink);
  background: #FCFBF7;
}

.otp-resend {
  text-align: center; font-size: 14px; color: var(--boring-color-text-secondary); margin: 4px 0;
}
.auth-disclaimer {
  font-size: 12.5px; line-height: 1.45; color: var(--boring-color-text-secondary);
  text-align: center; margin: 8px auto 0; max-width: 32em;
}
.dev-hint {
  font-size: 12.5px; line-height: 1.4; padding: 8px 12px; border-radius: 10px;
  background: var(--boring-palette-sky); color: var(--boring-palette-ink);
  margin: 12px 0 0; text-align: center; font-weight: 500;
}

.profile-input-wrap {
  display: grid; gap: 8px; text-align: left;
}
.input-label {
  font-size: 13.5px; font-weight: 600; color: var(--boring-color-text-primary);
}
.text-field {
  height: 54px; padding: 0 16px; font-size: 17px; font-family: inherit;
  border-radius: 14px; border: 1.5px solid var(--boring-color-border-subtle);
  background: var(--boring-color-surface-card); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.text-field:focus {
  border-color: var(--boring-color-border-focus);
  box-shadow: 0 0 0 3px rgb(41 73 104 / 0.12);
}

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pill--user {
  background: var(--boring-color-surface-card); border-color: var(--glass-line);
  display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
}
.pill--user:hover { border-color: var(--boring-color-border-focus); }

.account-menu {
  display: grid; gap: 12px; min-width: 200px; padding: 6px; text-align: left;
}
.account-menu__meta {
  border-bottom: 1px solid var(--boring-color-border-subtle); padding-bottom: 10px;
}
.account-menu__name { font-weight: 700; font-size: 15px; color: var(--boring-color-text-primary); }
.account-menu__phone { font-size: 13px; color: var(--boring-color-text-secondary); margin-top: 2px; }
.account-menu__signout {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 36px; border-radius: 8px; border: 1px solid var(--boring-palette-line);
  background: transparent; color: var(--boring-color-status-error-foreground);
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s;
}
.account-menu__signout:hover { background: var(--boring-palette-error); }


/* ---- mobile ------------------------------------------------------------------ */
@media (max-width: 759px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: max(12px, env(safe-area-inset-top)) 12px 8px; }
  .topbar__title strong { font-size: 16px; }
  .topbar__title span { font-size: 12px; }
  .topbar__pills { flex-direction: column; align-items: flex-end; gap: 4px; }
  .pill { min-height: 30px; font-size: 12px; padding: 0 6px 0 10px; }
  .pill b { height: 20px; min-width: 20px; }
  .detail { left: 10px; right: 10px; width: auto; top: auto; bottom: 104px; max-height: 48vh; transform: translateY(40px); border-radius: 26px; padding: 22px 18px; }
  .detail__name { font-size: 24px; }
  .insight { top: 74px; padding: 8px 16px; border-radius: 18px; }
  .insight__kicker { font-size: 10.5px; }
  .insight__habit { font-size: 16px; }
  .insight__organs { font-size: 12px; }
  /* on a call the body is the star: keep the card short, it still scrolls */
  .stage.is-calling .detail { max-height: 34vh; }
  .call { gap: 12px; padding: 10px 10px 10px 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .call__avatar { width: 50px; height: 50px; }
  .callbtn { width: 48px; height: 48px; }
  .callbtn--accept span { display: none; }
  .callbtn--accept { width: 48px; padding: 0; }
  .sheet { padding: 32px 20px 22px; }
  .selfie__frame { width: 220px; height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* What we keep, said where we take it */
.consent { font-size: 12.5px; line-height: 1.45; color: var(--boring-color-text-secondary); text-align: center; margin: 10px auto 0; max-width: 34em; }

/* Returning user: a moment while their results load */
.sheet--center { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.spinner--lg { width: 28px; height: 28px; border-width: 3px; margin: 0; color: var(--boring-palette-ink); }
.account-menu__photo { width: 56px; height: 56px; border-radius: 999px; object-fit: cover; }

/* ---- tabs (once someone has a home) ---------------------------------------------
   Design-system app shell: icon over a short label, the active tab in ink. */
:root { --nav-h: 68px; --nav-space: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.tabbar {
  position: absolute; z-index: 25; left: 0; right: 0; bottom: 0; height: var(--nav-space);
  display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: env(safe-area-inset-bottom);
  background: var(--boring-color-surface-card); border-top: 1px solid var(--boring-color-border-subtle);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 0; background: none; cursor: pointer; font-size: 13px; letter-spacing: .01em;
  color: var(--boring-color-text-secondary);
}
.tabbar button[aria-current="page"] { color: var(--boring-color-action-primary); font-weight: 600; }
.tabbar button[aria-current="page"] svg { stroke-width: 2.2; }
#app.has-nav .screen { bottom: var(--nav-space); }
#app.has-nav .call { bottom: calc(var(--nav-space) + 12px); }
#app.has-nav #btn-user { display: none; }

/* ---- Home and You ------------------------------------------------------------------ */
.screen--tab { align-items: flex-start; padding: 0; }
.home { width: 100%; max-width: 620px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 20px 120px; display: grid; gap: 28px; }

/* message band: large type on a tinted panel, character half-body at the edge */
.home__band {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 42%; align-items: end;
  min-height: 220px; border-radius: 30px; background: var(--boring-palette-sky);
}
.home__band[data-tone="calm"] { background: var(--good-soft); }
.home__band-text { align-self: center; padding: 28px 0 28px 26px; display: grid; gap: 8px; }
.home__kicker { font: var(--boring-typography-label); letter-spacing: 1.2px; text-transform: uppercase; color: var(--boring-color-text-secondary); }
.home__headline { font-weight: 800; font-size: clamp(24px, 4.6vw, 32px); line-height: 1.12; letter-spacing: -0.02em; }
.home__support { font-size: 15.5px; line-height: 1.45; color: var(--boring-color-text-secondary); }
.home__figure { align-self: end; aspect-ratio: 800 / 620; overflow: hidden; margin-top: 12px; }
.home__figure img { width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgb(41 73 104 / .18)); animation: breathe 5.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 50% { transform: translateY(-1.5%) scale(1.01); } }

/* talk to Boring: the same dark pill as a call */
.talk {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 14px 14px 16px; border: 0; border-radius: 26px; cursor: pointer;
  background: var(--boring-palette-ink); color: var(--boring-palette-paper);
  box-shadow: 0 24px 48px -28px rgb(24 48 71 / .7); transition: transform .14s var(--ease);
}
.talk:active { transform: scale(.985); }
.talk__face { width: 54px; height: 54px; border-radius: 999px; background: var(--boring-palette-wash); display: flex; align-items: center; justify-content: center; }
.talk__text { display: grid; gap: 3px; }
.talk__text strong { font-family: "Nunito Sans"; font-weight: 800; font-size: 18px; }
.talk__text span { font-size: 14px; line-height: 1.4; color: rgb(255 251 242 / .75); }
.talk__go { width: 48px; height: 48px; border-radius: 999px; background: #3E9B57; display: flex; align-items: center; justify-content: center; }

.home__section { display: grid; gap: 12px; }
.home__h { font-family: "DM Sans"; font-size: 13px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--boring-color-text-secondary); }
.home__h-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.home__meta { font-size: 13px; color: var(--boring-color-text-secondary); }
.home__empty { font-size: 15px; color: var(--boring-color-text-secondary); padding: 16px 18px; border-radius: 18px; background: var(--glass); border: 1px dashed var(--boring-color-border-subtle); }
.home__link { justify-self: start; padding: 0; }
.home__foot { display: flex; justify-content: center; }

.home-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.home-plan__item {
  display: grid; gap: 4px; padding: 16px 18px; border-radius: 18px;
  background: var(--boring-color-surface-card); border: 1px solid var(--glass-line); border-left: 5px solid var(--boring-palette-butter);
}
.home-plan__item strong { font-family: "Nunito Sans"; font-weight: 800; font-size: 17px; line-height: 1.3; }
.home-plan__how { font-size: 13.5px; font-weight: 600; color: var(--boring-color-text-primary); }
.home-plan__why { font-size: 14px; line-height: 1.45; color: var(--boring-color-text-secondary); }
.home-plan__organ { justify-self: start; margin-top: 4px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--boring-palette-sky); }
.home-plan__item.is-paused { opacity: .6; border-left-color: var(--boring-color-border-subtle); }

.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.metric { display: grid; gap: 2px; align-content: start; padding: 14px 16px; border-radius: 18px; background: var(--boring-color-surface-card); border: 1px solid var(--glass-line); }
.metric[data-tone="attention"] { background: var(--attn-soft); }
.metric__name { font-size: 13.5px; font-weight: 600; }
.metric__value { font-family: "Nunito Sans"; font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; }
.metric__value small { font-family: "DM Sans"; font-weight: 500; font-size: 12px; color: var(--boring-color-text-secondary); margin-left: 3px; }
.metric__status { font-size: 12.5px; font-weight: 600; color: var(--good); }
.metric[data-tone="attention"] .metric__status { color: var(--boring-color-status-attention-foreground); }
.metric__trend { font-size: 12px; color: var(--boring-color-text-secondary); }

.lastcall { display: grid; gap: 8px; padding: 18px; border-radius: 18px; background: var(--boring-color-surface-card); border: 1px solid var(--glass-line); }
.lastcall__meta { font-size: 13px; font-weight: 600; color: var(--boring-color-text-secondary); }
.lastcall__summary { font-size: 15px; line-height: 1.5; }
.lastcall__next { font-size: 14px; line-height: 1.45; padding: 10px 12px; border-radius: 12px; background: var(--boring-palette-sky); }
.lastcall__next span { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--boring-color-text-secondary); margin-bottom: 2px; }

.you__head { display: flex; align-items: center; gap: 16px; }
.you__photo { width: 76px; height: 76px; border-radius: 999px; object-fit: cover; object-position: 50% 12%; background: var(--boring-palette-sky); }
.you__name { font-weight: 800; font-size: 28px; letter-spacing: -0.02em; }
.you__phone { font-size: 15px; color: var(--boring-color-text-secondary); }
.you-facts, .you-calls { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.you-facts li { font-size: 15px; line-height: 1.45; padding: 12px 14px; border-radius: 16px; background: var(--boring-color-surface-card); border: 1px solid var(--glass-line); }
.you-calls li { display: grid; gap: 4px; font-size: 14.5px; line-height: 1.45; padding: 14px 16px; border-radius: 16px; background: var(--boring-color-surface-card); border: 1px solid var(--glass-line); }

@media (max-width: 759px) {
  .home { padding: max(14px, env(safe-area-inset-top)) 14px 120px; gap: 24px; }
  .home__band { min-height: 196px; grid-template-columns: 1fr 44%; border-radius: 26px; }
  .home__band-text { padding: 22px 0 22px 20px; }
  .home__support { font-size: 14.5px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .talk__text span { font-size: 13px; }
}

/* ---- installable app: nudges and the how-to sheet ------------------------------ */
.install-chip {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 8px 16px 8px 8px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass); font-size: 14px; font-weight: 600;
}
.install-chip img { border-radius: 7px; }
.install-card {
  display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center;
  padding: 16px 18px; border-radius: 22px; background: var(--boring-palette-sky); border: 1px solid var(--glass-line);
}
.install-card__icon { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 8px 18px -10px rgb(41 73 104 / .6); }
.install-card__text { display: grid; gap: 3px; }
.install-card__text strong { font-family: "Nunito Sans"; font-weight: 800; font-size: 17px; }
.install-card__text span { font-size: 14px; line-height: 1.45; color: var(--boring-color-text-secondary); }
.install-card__actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.install-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; border-radius: 18px; border: 1px solid var(--glass-line); background: var(--boring-color-surface-card); font-size: 20px;
}
.install-row img { border-radius: 10px; }
.install-row span { display: grid; gap: 2px; }
.install-row strong { font-size: 16px; }
.install-row small { font-size: 13.5px; color: var(--boring-color-text-secondary); }

.install-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.install-sheet__backdrop { position: absolute; inset: 0; background: rgb(24 48 71 / .38); animation: fade .3s var(--ease) both; }
.install-sheet__panel {
  position: relative; width: min(480px, 100%); max-height: 92dvh; overflow-y: auto; display: grid; gap: 14px; justify-items: center; text-align: center;
  padding: 30px 24px max(24px, env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: var(--boring-color-surface-card);
  box-shadow: 0 -30px 60px -30px rgb(24 48 71 / .5); animation: rise .45s var(--ease) both;
}
@media (min-width: 760px) { .install-sheet { align-items: center; } .install-sheet__panel { border-radius: 30px; } }
.install-sheet__close { position: absolute; top: 16px; right: 16px; }
.install-sheet__icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 12px 24px -12px rgb(41 73 104 / .6); }
.install-sheet h2 { font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.install-sheet__lede { font-size: 15px; line-height: 1.5; color: var(--boring-color-text-secondary); max-width: 26em; }
.install-steps { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 10px; width: 100%; text-align: left; counter-reset: s; }
.install-steps li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; font-size: 15px; line-height: 1.45; padding: 10px 12px; border-radius: 16px; background: var(--boring-palette-paper); }
.install-steps__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--boring-palette-sky); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.install-sheet__note { font-size: 13.5px; line-height: 1.45; color: var(--boring-color-text-secondary); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---- Home, second pass (23 Sep feedback: bigger band with the call in it,
   Today instead of the plan, organ badges, whiter page) -------------------------- */
body[data-screen="home"], body[data-screen="you"] { background: #FFFEFB; }
body[data-screen="home"] .mood, body[data-screen="you"] .mood { opacity: 0; transition: opacity .6s; }
.mood { transition: opacity .6s; }

.band {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: min(520px, 64dvh); display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  padding: 28px 22px 18px; border-radius: 32px;
  background: linear-gradient(160deg, #FFF3D1 0%, #FDF8EC 55%, #EAF2F7 100%);
  box-shadow: 0 30px 60px -44px rgb(41 73 104 / .5);
}
.band__text { position: relative; z-index: 2; display: grid; gap: 10px; max-width: 62%; }
.band__kicker { font: var(--boring-typography-label); letter-spacing: 1.2px; text-transform: uppercase; color: var(--boring-color-text-secondary); }
.band__headline { font-weight: 800; font-size: clamp(28px, 7.4vw, 40px); line-height: 1.08; letter-spacing: -0.03em; }
.band__support { font-size: 16px; line-height: 1.45; color: var(--boring-color-text-secondary); }
.band__figure { position: absolute; z-index: 1; right: -4%; bottom: 84px; width: min(62%, 300px); aspect-ratio: 800 / 640; overflow: hidden; }
.band__figure img { width: 100%; height: auto; filter: drop-shadow(0 14px 20px rgb(41 73 104 / .2)); animation: breathe 5.2s ease-in-out infinite; transform-origin: 50% 100%; }
.band__call {
  position: relative; z-index: 3; margin-top: auto;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 10px 10px 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--boring-palette-ink); color: var(--boring-palette-paper);
  box-shadow: 0 20px 40px -18px rgb(24 48 71 / .7); transition: transform .14s var(--ease);
}
.band__call:active { transform: scale(.98); }
.band__face { width: 50px; height: 50px; border-radius: 999px; background: var(--boring-palette-wash); display: flex; align-items: center; justify-content: center; }
.band__call-text { display: grid; gap: 1px; }
.band__call-text strong { font-family: "Nunito Sans"; font-weight: 800; font-size: 19px; }
.band__call-text small { font-size: 13px; color: rgb(255 251 242 / .7); }
.band__go { width: 50px; height: 50px; border-radius: 999px; background: #3E9B57; display: flex; align-items: center; justify-content: center; animation: breathe-dot 2.4s ease-in-out infinite; }

.home__more { border: 0; background: none; padding: 0; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--boring-color-action-primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(41 73 104 / .3); }

.today { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.today__item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 14px 14px 14px 14px; border-radius: 18px; border: 1px solid var(--boring-color-border-subtle); background: #fff;
  transition: background .2s, border-color .2s;
}
.today__check {
  width: 30px; height: 30px; border-radius: 999px; border: 2px solid var(--boring-color-border-focus);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; transition: background .2s, border-color .2s;
}
.today__title { font-weight: 600; font-size: 16px; line-height: 1.3; min-width: 0; }
.today__title small { font-weight: 600; color: var(--boring-color-text-secondary); }
.today__kind { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: var(--boring-palette-sky); font-size: 11.5px; font-weight: 700; vertical-align: 2px; }
.today__item.is-done { background: var(--good-soft); border-color: transparent; }
.today__item.is-done .today__check { background: var(--good); border-color: var(--good); }
.today__item.is-done .today__title { color: var(--boring-color-text-secondary); text-decoration: line-through; text-decoration-color: rgb(79 122 74 / .5); }
.badges { display: flex; gap: 4px; }
.badge { width: 30px; height: 30px; padding: 3px; border-radius: 999px; background: var(--boring-palette-paper); border: 1px solid var(--glass-line); object-fit: contain; }

.working { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.working__item { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; background: #fff; border: 1px solid var(--boring-color-border-subtle); }
.working__icon { width: 52px; height: 52px; object-fit: contain; padding: 4px; border-radius: 16px; background: var(--attn-soft); }
.working__text { display: grid; gap: 2px; }
.working__text strong { font-family: "Nunito Sans"; font-weight: 800; font-size: 17px; }
.working__text span { font-size: 14.5px; line-height: 1.4; color: var(--boring-color-text-secondary); }
.working__help { font-size: 13px !important; }
.working__help b { font-weight: 600; color: var(--boring-color-text-primary); }
body[data-screen="home"] .lastcall, body[data-screen="you"] .you-calls li, body[data-screen="you"] .you-facts li { background: #fff; }

@media (max-width: 759px) {
  .band { border-radius: 28px; padding: 24px 18px 14px; }
  .band__text { max-width: 60%; }
  .band__figure { bottom: 76px; }
}

/* ---- boot loader, Plan tab, floating call, band v2.1 ------------------------------ */
.boot {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--boring-palette-sky); transition: opacity .45s var(--ease), visibility .45s;
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot__word { font: var(--boring-typography-wordmark); font-size: 26px; letter-spacing: -1px; color: var(--boring-palette-ink); }

.band { min-height: min(440px, 54dvh); }
.band__text { max-width: 52%; }
.band__figure { right: -8%; bottom: 70px; width: min(74%, 360px); aspect-ratio: 800 / 600; }
@media (max-width: 759px) { .band__text { max-width: 50%; } .band__figure { bottom: 66px; } }

.tabbar { grid-template-columns: repeat(4, 1fr); }

.page-head { display: grid; gap: 6px; padding-top: 8px; }
.page-head h1 { font-weight: 800; font-size: 32px; letter-spacing: -0.025em; }
.page-head p { font-size: 15.5px; color: var(--boring-color-text-secondary); }
.helps { display: flex; flex-wrap: wrap; gap: 8px; }
.helps__chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; background: #fff; border: 1px solid var(--boring-color-border-subtle); font-size: 14px; font-weight: 600; }
.helps__chip img { width: 28px; height: 28px; object-fit: contain; }
.helps__chip b { color: var(--boring-color-text-secondary); font-weight: 700; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-row { display: grid; gap: 10px; padding: 14px 16px; border-radius: 18px; background: #fff; border: 1px solid var(--boring-color-border-subtle); }
.plan-row__text { display: grid; gap: 2px; }
.plan-row__text strong { font-size: 16px; }
.plan-row__text span { font-size: 13.5px; font-weight: 600; color: var(--boring-color-text-secondary); }
.plan-row__text small { font-size: 13.5px; line-height: 1.4; color: var(--boring-color-text-secondary); }
.plan-row.is-paused { opacity: .55; }
/* Every organ a habit helps, by name. */
.plan-row__helps { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.plan-row__helps > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--boring-color-text-secondary); margin-right: 1px; }
.organ-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px 1px 1px; border-radius: 999px; background: var(--boring-palette-paper); border: 1px solid var(--glass-line); font-size: 12.5px; font-weight: 600; }
.organ-chip img { width: 22px; height: 22px; object-fit: contain; }
/* Several organs on one line of Today: badges overlap a little. */
.badges .badge + .badge { margin-left: -9px; box-shadow: -2px 0 0 #fff; }

/* The last two weeks, a pill a day (js/plan-graph.js). Green like the ticks
   on Today; empty is warm grey; days still to come are outlines. */
.pills {
  --l0: #EEECE6; --l1: #D3E8C8; --l2: #9FCF8C; --l3: #62A956; --l4: #3B7A35;
  display: grid; gap: 8px; padding: 16px 16px 18px; border-radius: 22px; background: #fff; border: 1px solid var(--boring-color-border-subtle);
}
.pills__head, .pills__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 56px)); justify-content: space-between; column-gap: 8px; }
.pills__head { text-align: center; font-size: 12px; font-weight: 700; color: var(--boring-color-text-secondary); }
.pills__grid { row-gap: 10px; }
.pills__day {
  aspect-ratio: 3 / 4; border-radius: 999px; background: var(--l0);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.pills__day.is-today { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--boring-palette-ink); }
.pills__day.is-ahead { background: none; border: 2px dashed var(--boring-color-border-subtle); }
.pills .l1 { background: var(--l1); } .pills .l2 { background: var(--l2); } .pills .l3 { background: var(--l3); } .pills .l4 { background: var(--l4); }
.pills__count { font-size: 14px; font-weight: 700; color: var(--good); }
body[data-screen="plan"] { background: #FFFEFB; }
body[data-screen="plan"] .mood { opacity: 0; }

.fab {
  position: absolute; z-index: 24; right: 16px; bottom: calc(var(--nav-space) + 16px);
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 22px 0 18px; cursor: pointer;
  border: 0; border-radius: 999px; background: var(--boring-palette-ink); color: var(--boring-palette-paper); font-weight: 700; font-size: 15px;
  box-shadow: 0 18px 36px -14px rgb(24 48 71 / .7); animation: pop .35s var(--ease) both;
}
.fab svg { color: #7DD39A; }

/* Band character, head to waist in every browser. Safari lets an aspect-ratio
   box grow to its content, so the image is taken out of flow and fills the
   box from the top instead of sizing it. */
.band__figure { width: min(80%, 400px); right: -10%; aspect-ratio: 800 / 600; min-height: 0; }
.band__figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.band__text { max-width: 52%; }

/* Band text: greeting and headline across the top, the smaller line beside
   the character. */
.band__text { max-width: none; }
.band__headline { max-width: 15ch; font-size: clamp(28px, 7.8vw, 40px); }
.band__support { max-width: 48%; }
