/*
  MyAKILi, the client app (/app/). It stands on akili.css: the same Wellspring
  tokens, fonts, buttons, forms, badges and messages as akiliug.com. This file
  adds only the app's frame (top bar, bottom tabs, cards) and the ripples with
  AKILI's red dot, placed exactly as on the website's home page.
  No inline styles anywhere: the Content-Security-Policy forbids them.
*/

body.app { background: var(--paper); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- Top bar (the website's header, made small) ---------- */
.app-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-4) var(--space-3); background: var(--pool); color: var(--white); }
/* MyAKILi's own logo (Papa, 5 November 2026): the one word "MyAKILi", drawn the same way as the
   AKILi logo (akili.css .mark), with "My" inside the mark. */
.app-brand { display: inline-flex; color: var(--white); text-decoration: none; }
.app-brand .mark { font-size: 1.2rem; }
.app-top__actions { display: flex; align-items: center; gap: var(--space-4); }
.app-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--pool-2); border: 1px solid rgb(255 255 255 / 18%);
  color: var(--on-dark); font-weight: 700; font-size: 0.85rem; text-decoration: none; text-transform: uppercase; }
.app-top a:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; border-radius: var(--radius); }

/* ---------- Page and bottom tabs ---------- */
.app-main { flex: 1; width: 100%; max-width: 40rem; margin: 0 auto; padding: var(--space-4) var(--space-4) calc(104px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--space-4); }
.app-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: var(--space-2) var(--space-2) calc(var(--space-2) + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgb(29 41 45 / 8%); }
.app-tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 64px; min-height: 56px;
  padding: 4px 6px 10px; color: var(--muted); font-size: 0.75rem; font-weight: 600; text-decoration: none; border-radius: var(--radius); }
.app-tabs a svg { width: 24px; height: 24px; }
.app-tabs a[aria-current="page"] { color: var(--pool); }
.app-tabs a[aria-current="page"]::after { content: ""; position: absolute; bottom: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--akili-red); }
.app-tabs a:focus-visible { outline: 3px solid var(--pool); outline-offset: -3px; }

/* ---------- Headings and cards ---------- */
.app-eyebrow { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.app-title { margin: 0; font-size: 2.1rem; line-height: 1.1; }
.app-heading { margin: var(--space-3) 0 0; font-size: 1.5rem; }
.app-card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: var(--space-4) var(--space-5); box-shadow: var(--shadow); }
.app-card > :first-child { margin-top: 0; }
.app-card > :last-child { margin-bottom: 0; }
.app-card h2 { font-size: 1.35rem; margin: 0 0 var(--space-2); }
.app-card--deep { background: var(--pool); border-color: var(--pool); color: var(--white); }
.app-card--deep h2 { color: var(--white); }
.app-card--deep .app-label, .app-card--deep .app-sub { color: var(--on-dark); }
.app-card--deep a:not(.button) { color: var(--white); }
.app-card--deep .button:not(.button--pearl) { background: transparent; color: var(--white); border-color: rgb(255 255 255 / 55%); }
/* Block, not flex: the words (and the AKILI logo inside them) wrap as one line of text. */
.app-label { display: block; margin: 0 0 0.25rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.app-card h3.app-label { margin-top: var(--space-3); }
.app-label svg { display: inline-block; width: 1rem; height: 1rem; margin-right: 0.4rem; vertical-align: -0.15em; }
.app-big { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.app-sub { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.app-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.app-list { list-style: none; margin: 0; padding: 0; }
.app-list > li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.app-list > li:first-child { border-top: 0; padding-top: 0; }
.app-list > li:last-child { padding-bottom: 0; }
.app-list__main { min-width: 0; }
.app-empty { color: var(--muted); margin: 0; }
.app-list--ticks > li { justify-content: flex-start; align-items: flex-start; }
.app-list--ticks svg { width: 22px; height: 22px; margin-top: 0.15rem; color: var(--calm); flex: none; }
.app-card .app-list + .app-quiet, .app-card .app-form + .app-quiet { margin-top: var(--space-4); }
.app-quiet { font-size: 0.9rem; color: var(--muted); margin: 0; }
.app-form { display: grid; gap: var(--space-4); }
.app-form .button { justify-self: start; }
input.pin { font-size: 1.5rem; letter-spacing: 0.45em; text-align: center; }
body.app .messages { width: 100%; max-width: 40rem; margin: var(--space-4) auto 0; padding: 0 var(--space-4); }
body.app--welcome .messages { margin: 0 0 var(--space-4); padding: 0; }

/* ---------- The ripples, with AKILI's red dot ---------- */
/* static/img/ripples-*.jpg: the dot sits 68.4% across and 45.9% down the picture (1200 x 805).
   Each placement below pins the dot where it should be, at any screen size. */

/* Today: a band of the wellspring behind the greeting, the dot above the words. */
.app-hero { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 380px;
  margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) 0; padding: var(--space-6) var(--space-5) var(--space-5); background: var(--pool); color: var(--white); border-radius: 0 0 22px 22px; }
.app-hero::before { --h: 560px; content: ""; position: absolute; z-index: -2; left: 70%; top: 25%; width: calc(var(--h) * 1.4907); height: var(--h);
  margin-left: calc(var(--h) * -1.0196); margin-top: calc(var(--h) * -0.4592); background: url("../img/ripples-1200.b4231ded6dc8.jpg") 0 0 / 100% 100% no-repeat;
  transform-origin: 68.4% 45.9%; animation: settle 2.4s ease-out both; }
.app-hero::after { content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(180deg, rgb(18 28 32 / 0%) 0%, rgb(18 28 32 / 10%) 30%, rgb(18 28 32 / 82%) 47%, rgb(18 28 32 / 96%) 70%); }
.app-hero .app-eyebrow { color: var(--silver); }
.app-hero .app-title { color: var(--white); }
.app-hero .app-sub { color: #D0DADC; }
@media (min-width: 40rem) { .app-hero { margin-inline: 0; border-radius: 22px; } }

/* Signing in and welcomes: the website's home page, as it looks on a phone. */
body.app--welcome { background: var(--pool); color: var(--white); }
.welcome { position: relative; overflow: hidden; isolation: isolate; flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--pool); }
.welcome::before { content: ""; position: absolute; z-index: -2; left: 0; right: 0; top: 0; height: 560px;
  background: url("../img/ripples-1200.b4231ded6dc8.jpg") 65% 0 / auto 560px no-repeat; animation: settle 2.4s ease-out both; }
.welcome::after { content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(180deg, rgb(18 28 32 / 10%) 0, rgb(18 28 32 / 10%) 270px, rgb(18 28 32 / 90%) 380px, rgb(18 28 32 / 96%) 560px, rgb(18 28 32 / 96%) 100%); }
.welcome__inner { width: 100%; max-width: 30rem; margin: 0 auto; padding: 300px var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom)); }
.welcome h1 { color: var(--white); font-size: 2.4rem; margin: var(--space-4) 0 var(--space-2); }
.welcome .welcome__logo { margin-top: 0; color: var(--white); }
.welcome__logo .mark { font-size: 2.1rem; }
.welcome__brand { margin: 0; color: var(--white); }
.welcome__brand .mark { font-size: 1.4rem; }
.welcome .lead { color: #D0DADC; margin: 0 0 var(--space-5); }
.welcome-card { background: var(--white); color: var(--ink); border-radius: 12px; padding: var(--space-5); display: grid; gap: var(--space-4); box-shadow: var(--shadow-lift); }
.welcome-card .button { width: 100%; }
.welcome__help { margin: var(--space-5) 0 0; font-size: 0.9rem; color: var(--silver); }
.welcome-first { margin-top: var(--space-5); padding: var(--space-5); border: 1px solid rgb(255 255 255 / 18%); border-radius: 12px; display: grid; gap: var(--space-3); }
.welcome-first h2 { margin: 0; font-size: 1.5rem; color: var(--white); }
.welcome-first p { margin: 0; color: #D0DADC; }
.welcome-first .button { justify-self: start; }
.welcome-first__form { display: grid; gap: var(--space-2); }
.welcome-first__form label { color: var(--white); font-weight: 600; }
.welcome-first .button:not(.button--pearl) { background: transparent; color: var(--white); border-color: rgb(255 255 255 / 55%); }
.welcome__help a { color: #E6ECED; }
.welcome__link { margin: var(--space-4) 0 0; text-align: center; }
.welcome__link a { color: #E6ECED; }
@media (min-width: 900px) {
  .welcome::before { height: auto; bottom: 0; background-image: url("../img/ripples-2400.086d21c31fca.jpg"); background-position: 65% 50%; background-size: cover; }
  .welcome::after { background: linear-gradient(90deg, rgb(18 28 32 / 94%) 0%, rgb(18 28 32 / 82%) 34%, rgb(18 28 32 / 30%) 56%, rgb(18 28 32 / 0%) 64%); }
  .welcome__inner { margin: 0 0 0 8vw; padding: 6rem 0; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
}

/* A living ripple: rings spreading from the red dot and fading, like the picture.
   For welcomes, empty pages and the breathing exercise. Size it with --ripple-size. */
.ripple { position: relative; display: grid; place-items: center; width: var(--ripple-size, 120px); aspect-ratio: 1; margin: 0 auto; flex: none; }
.ripple__dot { position: relative; z-index: 2; width: 14%; aspect-ratio: 1; border-radius: 50%; background: var(--akili-red); box-shadow: 0 0 0 4px rgb(227 30 36 / 12%); }
.ripple__ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgb(30 43 48 / 34%); transform: scale(0.12); opacity: 0;
  animation: ripple-out 4.8s cubic-bezier(.2, .6, .3, 1) infinite; }
.ripple__ring:nth-child(2) { animation-delay: 1.2s; }
.ripple__ring:nth-child(3) { animation-delay: 2.4s; }
.ripple__ring:nth-child(4) { animation-delay: 3.6s; }
.ripple--on-dark .ripple__ring { border-color: rgb(255 255 255 / 45%); }
.ripple--small { --ripple-size: 72px; }
.ripple--large { --ripple-size: 200px; }
@keyframes ripple-out { 0% { transform: scale(0.12); opacity: 0; } 12% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
.app-still { display: grid; justify-items: center; gap: var(--space-3); text-align: center; padding: var(--space-5) 0; }
.app-still p { margin: 0; max-width: 30ch; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .app-hero::before, .welcome::before { animation: none; }
  .ripple__ring { animation: none; opacity: 0.5; }
  .ripple__ring:nth-child(1) { transform: scale(0.3); }
  .ripple__ring:nth-child(2) { transform: scale(0.55); }
  .ripple__ring:nth-child(3) { transform: scale(0.78); }
  .ripple__ring:nth-child(4) { transform: scale(1); opacity: 0.25; }
}

/* ---------- The opening ripple: after signing in, and when the app is opened from the home screen ---------- */
/* The wellspring fills the screen with the red dot at its centre; rings spread from the dot,
   "MyAKILi" rises beneath it, then everything melts into the app. A tap skips it. */
.splash { position: fixed; inset: 0; z-index: 100; overflow: hidden; isolation: isolate; background: var(--pool); color: var(--white);
  animation: splash-away 0.6s ease-in 2s forwards; }
.splash__water { --h: max(120vh, 108vw); position: absolute; z-index: -2; left: 50%; top: 42%; width: calc(var(--h) * 1.4907); height: var(--h);
  margin-left: calc(var(--h) * -1.0196); margin-top: calc(var(--h) * -0.4592); background: url("../img/ripples-1200.b4231ded6dc8.jpg") 0 0 / 100% 100% no-repeat;
  transform-origin: 68.4% 45.9%; animation: settle 2.6s ease-out both; }
@media (min-width: 900px) { .splash__water { background-image: url("../img/ripples-2400.086d21c31fca.jpg"); } }
.splash::after { content: ""; position: absolute; z-index: -1; inset: 0;
  background: radial-gradient(circle at 50% 42%, rgb(18 28 32 / 0%) 0, rgb(18 28 32 / 0%) 22vmin, rgb(18 28 32 / 55%) 70vmin, rgb(18 28 32 / 88%) 120vmin); }
/* Flattened like the rings in the photograph, as if lying on the water. */
.splash__rings { position: absolute; left: 50%; top: 42%; width: 120vmin; aspect-ratio: 1; transform: translate(-50%, -50%) scaleY(0.46); }
.splash__rings .ripple__ring { border-color: rgb(255 255 255 / 60%); animation-duration: 2.2s; animation-iteration-count: 1; }
.splash__rings .ripple__ring:nth-child(1) { animation-delay: 0s; }
.splash__rings .ripple__ring:nth-child(2) { animation-delay: 0.35s; }
.splash__rings .ripple__ring:nth-child(3) { animation-delay: 0.7s; }
.splash__rings .ripple__ring:nth-child(4) { animation-delay: 1.05s; }
.splash__mark { position: absolute; left: 0; right: 0; top: calc(42% + 9vmin); margin: 0; display: flex; justify-content: center; color: var(--white);
  animation: splash-rise 0.9s ease-out 0.3s both; }
.splash__mark .mark { font-size: 2rem; }
.splash__help { position: absolute; left: 50%; bottom: calc(var(--space-6) + env(safe-area-inset-bottom)); transform: translateX(-50%); }
.splash.is-skipped { animation: splash-away 0.25s ease-in forwards; }
@keyframes splash-away { to { opacity: 0; visibility: hidden; } }
@keyframes splash-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .splash { animation: splash-away 0.3s linear 0.9s forwards; }
  .splash__water, .splash__mark { animation: none; }
  .splash__rings { display: none; }
}

/* The client-only parts, greyed out for followers (they open after a first session). */
.app-card--locked .locked-list { list-style: none; margin: var(--space-2) 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2); }
.app-card--locked .locked-list li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: 10px; background: var(--mist); color: var(--muted); }
.app-card--locked .locked-list li span { flex: 1; }
.app-card--locked .locked-list svg { width: 1.15rem; height: 1.15rem; flex: none; opacity: 0.7; }

/* Motivation for today: a paper card with the AKILi mark, the words, Coach Elisha's signature,
   the website's ripple and red dot, and its theme's photo faded behind. */
.saying-card { position: relative; overflow: hidden; isolation: isolate; margin: var(--space-2) 0 var(--space-3); padding: var(--space-6) var(--space-5) var(--space-5); border-radius: 4px; background: var(--white); color: var(--ink); box-shadow: 0 1px 1px rgb(29 41 45 / 8%), 0 6px 18px rgb(29 41 45 / 10%), inset 0 0 0 1px var(--line); background-image: radial-gradient(circle at 18% 12%, rgb(29 41 45 / 3%) 0 1px, transparent 1px), radial-gradient(circle at 72% 64%, rgb(29 41 45 / 3%) 0 1px, transparent 1px); background-size: 7px 7px, 11px 11px; }
.saying-card__photo { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: 0.13; filter: grayscale(1) contrast(1.1); }
.saying-card__ripple { position: absolute; z-index: -1; right: -48px; bottom: -48px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid var(--line); box-shadow: 0 0 0 22px rgb(29 41 45 / 2%), 0 0 0 44px rgb(29 41 45 / 2%); }
.saying-card__ripple::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--akili-red); }
.saying-card__mark { margin: 0 0 var(--space-4); font-size: 1rem; }
.saying-card__words { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 1.7rem; line-height: 1.25; }
.saying-card__words p { margin: 0; }
.saying-card__words p:last-child::before { content: "\201C"; }
.saying-card__words p:last-child::after { content: "\201D"; }
.saying-card__original { margin-bottom: var(--space-2) !important; font-style: italic; font-size: 1.2rem; color: var(--muted); }
.saying-card__sign { margin-top: var(--space-4); font-family: var(--font-heading); font-style: italic; font-size: 1.25rem; color: var(--muted); }
.saying-card__sign::before { content: "\2014\00a0"; }

.challenge__title { margin: var(--space-2) 0; font-size: 2rem; }
.challenge__question { font-size: 1.1rem; line-height: 1.5; color: var(--muted); }
.challenge__action { margin: var(--space-4) 0; padding: var(--space-4); border-left: 3px solid var(--akili-red); background: var(--paper); }
.challenge__action p:last-child { margin: 0; }
.challenge__writeup p { line-height: 1.65; }
.challenge__sign { font-family: var(--font-heading); font-style: italic; font-size: 1.35rem; }
.coaching-row { align-items: center; }

/* Dr. Lynda's wellbeing check */
.check__form { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.check__form fieldset, .check__form .field { margin: 0; }
.check__score { margin: var(--space-2) 0 var(--space-3); font-family: var(--font-heading); font-size: 3.2rem; line-height: 1; }
.check__score span { font-size: 1.4rem; color: var(--muted); }
.check__alert { margin: var(--space-3) 0; padding: var(--space-4); border-left: 3px solid var(--akili-red); background: var(--paper); }
.check__alert p:last-child { margin-bottom: 0; }
.check__history-h { margin-top: var(--space-5); }
.check__history { list-style: none; margin: 0 0 var(--space-4); padding: 0; }
.check__history li { display: flex; justify-content: space-between; padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.saying-card__face { position: absolute; z-index: -1; top: 0; right: 0; width: 62%; height: 100%; object-fit: cover; object-position: center 20%; filter: grayscale(1) contrast(1.05); opacity: 0.24; -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 15%, #000 75%); mask-image: linear-gradient(to right, transparent 0%, transparent 15%, #000 75%); }
.follow { margin: var(--space-3) 0 0; font-size: 0.92rem; color: var(--muted); }
.follow a { color: var(--ink); font-weight: 600; }

/* The coaching plan: goals with steps the client ticks off */
.coaching-goal { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.coaching-steps { list-style: none; margin: var(--space-3) 0; padding: 0; display: grid; gap: var(--space-2); }
.coaching-step { display: flex; gap: var(--space-3); align-items: flex-start; width: 100%; padding: var(--space-3); border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.coaching-step__box { flex: none; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border: 2px solid var(--muted); border-radius: 6px; font-size: 0.95rem; line-height: 1; }
.coaching-step.is-done { background: var(--paper); color: var(--muted); }
.coaching-step.is-done .coaching-step__box { border-color: var(--calm); background: var(--calm); color: var(--white); }
.coaching-step small { color: var(--muted); }

