/* ==========================================================================
   App UI — the interrupt, drawn the way the phone draws it
   ==========================================================================

   Every number in this file is copied from the app's own interrupt,
   popcue-app/src/overlay/OverlayRoot.tsx (sizes, radii, paddings, fills, the
   1200ms read-pause, the 200ms reveal tint, the 280ms card entrance, the
   420ms answer fade-up and the 200/240ms exit). Change it there first.

   One unit, --u, is one device pixel of a 360dp-wide Android screen. Every
   dimension below is `N * var(--u)`, so the whole phone scales as one object
   and is sized to fit the viewport: the smaller of its column's width
   (container query units) and the height left on screen once the section's
   own copy is accounted for (--fit-reserve, set per section in site.css).

   Colour is the one deliberate departure. A handful of the app's text
   colours measure under WCAG AA on the web (#A29CB0 labels and captions on
   white at 2.6:1, the sage ANSWER label at 2.0:1, the footer caption at
   4.1:1). Here they use the nearest passing token instead: the site's
   --ink-faint, --sage-strong, and the app's own inkOnDarkSoft. Fills,
   shapes and motion are unchanged.
   ========================================================================== */

.device-fit {
  container-type: inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ── The phone ────────────────────────────────────────────────────────── */

.device {
  /* Never smaller than --u-min: on a short phone a legible phone that runs
     a little past the fold beats a postage stamp that fits. */
  --u: max(var(--u-min, 0.42px), min(var(--u-max, 0.92px), calc(100cqw / 380), calc((100svh - var(--fit-reserve, 180px)) / 800)));
  position: relative;
  flex-shrink: 0;
  width: calc(380 * var(--u));
  height: calc(800 * var(--u));
  padding: calc(10 * var(--u));
  border-radius: calc(50 * var(--u));
  background: linear-gradient(160deg, #2D2858 0%, #15112C 55%, #0B0818 100%);
  box-shadow:
    0 0 0 calc(1.5 * var(--u)) rgba(255, 255, 255, 0.08) inset,
    0 calc(2 * var(--u)) calc(6 * var(--u)) rgba(14, 10, 32, 0.25),
    0 calc(30 * var(--u)) calc(80 * var(--u)) rgba(14, 10, 32, 0.3),
    0 calc(10 * var(--u)) calc(40 * var(--u)) rgba(75, 58, 192, 0.18);
  font-family: 'Manrope', var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  border-radius: calc(40 * var(--u));
  background: #FFFFFF;
}

/* Android status bar: time on the left, the punch-hole camera centred, the
   radios on the right. It sits over whichever surface is up, so its ink
   flips when the app shows through. */
.device-status {
  position: absolute;
  inset: 0 0 auto;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(30 * var(--u));
  padding: 0 calc(22 * var(--u)) 0 calc(24 * var(--u));
  color: #FFFFFF;
  font-size: calc(12.5 * var(--u));
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 240ms cubic-bezier(0.23, 1, 0.32, 1);
}
.device-icons { display: flex; align-items: center; gap: calc(5 * var(--u)); }
.device-icons svg { width: calc(14 * var(--u)); height: calc(14 * var(--u)); }
.device-camera {
  position: absolute;
  top: calc(9 * var(--u));
  left: 50%;
  z-index: 7;
  width: calc(11 * var(--u));
  height: calc(11 * var(--u));
  margin-left: calc(-5.5 * var(--u));
  border-radius: 50%;
  background: #05030A;
  box-shadow: 0 0 0 calc(1.5 * var(--u)) rgba(255, 255, 255, 0.06);
}
/* Gesture navigation handle. */
.device-nav {
  position: absolute;
  bottom: calc(9 * var(--u));
  left: 50%;
  z-index: 6;
  width: calc(110 * var(--u));
  height: calc(4 * var(--u));
  margin-left: calc(-55 * var(--u));
  border-radius: calc(2 * var(--u));
  background: rgba(255, 255, 255, 0.72);
  transition: background 240ms cubic-bezier(0.23, 1, 0.32, 1);
}
.device.is-app-open .device-status { color: var(--ink); }
.device.is-app-open .device-nav { background: rgba(20, 16, 31, 0.55); }

/* ── The app being opened ─────────────────────────────────────────────────
   What shows through when the interrupt lets go. Deliberately generic: a
   feed, not any particular app's design. */
.pi-app {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  padding: calc(38 * var(--u)) calc(16 * var(--u)) 0;
  background: #FFFFFF;
  color: var(--ink);
}
.pi-app-bar { display: flex; align-items: center; justify-content: space-between; }
.pi-app-name { font-size: calc(20 * var(--u)); font-weight: 800; letter-spacing: -0.02em; }
.pi-app-dots { display: flex; gap: calc(10 * var(--u)); }
.pi-app-dots i { width: calc(20 * var(--u)); height: calc(20 * var(--u)); border-radius: calc(6 * var(--u)); border: calc(2 * var(--u)) solid #D9D5E2; }
.pi-app-stories { display: flex; gap: calc(12 * var(--u)); margin-top: calc(18 * var(--u)); }
.pi-app-stories i {
  width: calc(54 * var(--u));
  height: calc(54 * var(--u));
  flex-shrink: 0;
  border-radius: 50%;
  background: #EEEBF3;
  box-shadow: 0 0 0 calc(2.5 * var(--u)) #FFFFFF, 0 0 0 calc(4.5 * var(--u)) var(--pi-accent, #654CF4);
}
.pi-app-post { margin-top: calc(22 * var(--u)); }
.pi-app-who { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.pi-app-who i { width: calc(30 * var(--u)); height: calc(30 * var(--u)); border-radius: 50%; background: #E3DFEA; }
.pi-app-who b { width: calc(110 * var(--u)); height: calc(10 * var(--u)); border-radius: calc(5 * var(--u)); background: #E3DFEA; }
.pi-app-media {
  height: calc(300 * var(--u));
  margin: calc(12 * var(--u)) calc(-16 * var(--u)) 0;
  background:
    radial-gradient(60% 70% at 30% 30%, rgba(255, 255, 255, 0.35), transparent 60%),
    linear-gradient(135deg, var(--pi-accent, #654CF4), var(--pi-accent-2, #F4CB3D));
}
.pi-app-lines { display: grid; gap: calc(8 * var(--u)); margin-top: calc(14 * var(--u)); }
.pi-app-lines b { height: calc(10 * var(--u)); border-radius: calc(5 * var(--u)); background: #ECE9F1; }
.pi-app-lines b:last-child { width: 62%; }

/* ── The interrupt overlay ────────────────────────────────────────────── */

.pi {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: linear-gradient(158deg, #241A54 0%, #150F3A 45%, #0E0A20 80%);
  transition: opacity 240ms cubic-bezier(0.23, 1, 0.32, 1) 60ms;
}
/* The amber circle bleeding off the bottom-right corner. */
.pi::before {
  content: '';
  position: absolute;
  right: calc(-100 * var(--u));
  bottom: calc(-110 * var(--u));
  width: calc(280 * var(--u));
  height: calc(280 * var(--u));
  border-radius: 50%;
  background: #F4CB3D;
  opacity: 0.12;
  pointer-events: none;
}
.pi-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc((30 + 26) * var(--u)) calc(20 * var(--u)) calc((22 + 28) * var(--u));
}

.pi-header { display: flex; align-items: flex-start; justify-content: space-between; }
.pi-header-left { display: flex; align-items: center; gap: calc(10 * var(--u)); min-width: 0; }
.pi-appchip {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  border-radius: calc(11 * var(--u));
  background: #39325C;
  color: #FFFFFF;
}
.pi-appchip svg { width: calc(16 * var(--u)); height: calc(16 * var(--u)); }
.pi-header-text { min-width: 0; }
.pi-title {
  font-size: calc(14 * var(--u));
  font-weight: 700;
  line-height: 1.35;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pi-sub {
  margin-top: calc(1 * var(--u));
  font-size: calc(12 * var(--u));
  font-weight: 500;
  line-height: 1.35;
  color: #B4AFC4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pi-goal {
  flex-shrink: 0;
  max-width: calc(140 * var(--u));
  margin-left: calc(8 * var(--u));
  padding: calc(7 * var(--u)) calc(13 * var(--u));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: calc(11.5 * var(--u));
  font-weight: 700;
  line-height: 1.3;
  color: #E7E3F5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pi-goal:empty { display: none; }

.pi-area {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: calc(18 * var(--u));
}
.pi-footer {
  margin-top: calc(20 * var(--u));
  font-size: calc(12 * var(--u));
  line-height: 1.4;
  text-align: center;
  color: #9089A6;
}

/* ── The white card ───────────────────────────────────────────────────── */

.pi-card {
  position: relative;
  padding: calc(26 * var(--u)) calc(22 * var(--u));
  border-radius: calc(28 * var(--u));
  background: #FFFFFF;
  color: var(--ink);
  transition:
    opacity 200ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
/* Mount: opacity plus a 12dp rise, 280ms — the overlay window landing. */
.pi-card.is-entering { animation: piEnter 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes piEnter {
  from { opacity: 0; transform: translateY(calc(12 * var(--u))); }
  to { opacity: 1; transform: none; }
}

.pi-label {
  font-size: calc(11 * var(--u));
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.pi-center { text-align: center; }

.pi-q {
  margin-top: calc(8 * var(--u));
  font-family: var(--font-serif);
  font-size: calc(27 * var(--u));
  font-weight: 600;
  line-height: calc(36 * var(--u));
  text-align: center;
  color: var(--ink);
}
.pi-q-sm {
  margin-top: calc(8 * var(--u));
  font-family: var(--font-serif);
  font-size: calc(20 * var(--u));
  font-weight: 600;
  line-height: calc(26 * var(--u));
  color: var(--ink);
}
.pi-cloze {
  margin-top: calc(10 * var(--u));
  font-family: var(--font-serif);
  font-size: calc(22 * var(--u));
  font-weight: 600;
  line-height: calc(30 * var(--u));
  text-align: center;
  color: var(--ink);
}

/* Reveal answer: dim for the read-pause, then washes to amber over 200ms.
   Never a countdown, never a spinner. */
.pi-reveal {
  position: relative;
  display: block;
  width: 100%;
  margin-top: calc(20 * var(--u));
  padding: calc(15 * var(--u)) 0;
  border: 0;
  border-radius: 999px;
  background: #F4E9C0;
  font: inherit;
  font-size: calc(15.5 * var(--u));
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: rgba(14, 10, 32, 0.62);
  cursor: default;
  transition: background-color 200ms ease-out, color 200ms ease-out, opacity 120ms ease-out;
}
.pi-card.is-ready .pi-reveal { background: #F4CB3D; color: #0E0A20; cursor: pointer; }

/* Revealed content fades up 6dp over 420ms, exactly like the app's fadeUp. */
.pi-answer,
.pi-rate { display: none; }
.pi-card.is-revealed .pi-reveal,
.pi-card.is-revealed .pi-listhint { display: none; }
.pi-card.is-revealed .pi-answer { display: block; animation: piFadeUp 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.pi-card.is-revealed .pi-rate { display: flex; animation: piFadeUp 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes piFadeUp {
  from { opacity: 0; transform: translateY(calc(6 * var(--u))); }
  to { opacity: 1; transform: none; }
}

.pi-answer {
  margin-top: calc(18 * var(--u));
  padding-top: calc(18 * var(--u));
  border-top: max(1px, calc(1 * var(--u))) solid #EEECF2;
}
.pi-alabel {
  font-size: calc(11 * var(--u));
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-align: center;
  color: var(--sage-strong);
}
.pi-a {
  margin-top: calc(6 * var(--u));
  font-family: var(--font-serif);
  font-size: calc(20 * var(--u));
  font-weight: 600;
  line-height: calc(28 * var(--u));
  text-align: center;
  color: var(--ink);
}
.pi-caption {
  margin-top: calc(8 * var(--u));
  font-size: calc(12 * var(--u));
  font-style: italic;
  line-height: 1.4;
  text-align: center;
  color: var(--ink-faint);
}

.pi-rate { gap: calc(10 * var(--u)); margin-top: calc(20 * var(--u)); }
.pi-still,
.pi-got {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: calc(14 * var(--u)) 0;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: calc(14.5 * var(--u));
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: opacity 120ms ease-out;
}
.pi-still { background: #F1EFF6; color: var(--ink); }
.pi-got { background: #66C79E; color: #0E0A20; }

/* Pressed: the app's 0.85 opacity, plus the touch itself, so an autoplaying
   replica shows where the thumb landed. */
.is-pressed { opacity: 0.85; }
.is-pressed::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(46 * var(--u));
  height: calc(46 * var(--u));
  margin: calc(-23 * var(--u)) 0 0 calc(-23 * var(--u));
  border-radius: 50%;
  background: rgba(14, 10, 32, 0.22);
  box-shadow: 0 0 0 calc(2 * var(--u)) rgba(255, 255, 255, 0.6);
  pointer-events: none;
  animation: piTouch 520ms ease-out both;
}
@keyframes piTouch {
  0% { opacity: 0; transform: scale(0.55); }
  25% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25); }
}

/* ── Per-type bodies ──────────────────────────────────────────────────── */

/* Cloze: the blank fills in, underline and all, inkFaint to sage. */
.pi-blank {
  display: inline-block;
  min-width: 4.2em;
  border-bottom: calc(2 * var(--u)) solid var(--ink-faint);
  line-height: 1.15;
  color: transparent;
  transition: color 200ms ease-out, border-color 200ms ease-out;
}
.pi-card.is-revealed .pi-blank { min-width: 0; color: var(--sage-strong); font-weight: 700; border-bottom-color: #66C79E; }

/* Choice and True/False: receptive, never tap-to-guess. The correct option
   washes #F5F4F8 to sage in place on reveal. */
.pi-options { display: grid; gap: calc(8 * var(--u)); margin-top: calc(14 * var(--u)); }
.pi-opt {
  padding: calc(12 * var(--u)) calc(14 * var(--u));
  border-radius: calc(12 * var(--u));
  background: #F5F4F8;
  font-size: calc(14 * var(--u));
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-soft);
  transition: background-color 200ms ease-out;
}
.pi-card.is-revealed .pi-opt.is-correct { background: #66C79E; color: #0E0A20; font-weight: 700; }

/* Code: monospace snippet on the option-pill fill. */
.pi-code {
  margin-top: calc(14 * var(--u));
  padding: calc(14 * var(--u));
  border-radius: calc(12 * var(--u));
  background: #F5F4F8;
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
  font-size: calc(13.5 * var(--u));
  line-height: calc(20 * var(--u));
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Image recall: the picture in a 220×150 frame. */
.pi-image {
  display: grid;
  place-items: center;
  width: calc(220 * var(--u));
  height: calc(140 * var(--u));
  margin: calc(14 * var(--u)) auto 0;
  border-radius: calc(14 * var(--u));
  background: #FBEFD0;
  color: #B8862A;
}
.pi-image svg { width: calc(120 * var(--u)); height: calc(84 * var(--u)); }

/* List recall: the count up front, the whole set at once on reveal. */
.pi-listhint {
  margin-top: calc(14 * var(--u));
  font-size: calc(13 * var(--u));
  line-height: 1.4;
  text-align: center;
  color: var(--ink-faint);
}
.pi-list { display: grid; gap: calc(8 * var(--u)); margin: calc(4 * var(--u)) 0; }
.pi-list span {
  display: flex;
  align-items: flex-start;
  gap: calc(10 * var(--u));
  padding: calc(11 * var(--u)) calc(14 * var(--u));
  border-radius: calc(12 * var(--u));
  background: #F5F4F8;
  font-size: calc(14 * var(--u));
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.pi-list span::before {
  content: '';
  flex-shrink: 0;
  width: calc(7 * var(--u));
  height: calc(7 * var(--u));
  margin-top: calc(6 * var(--u));
  border-radius: 50%;
  background: #66C79E;
}

/* Picture match, image-to-word: the picture, then four word tiles. */
.pi-picbox {
  display: grid;
  place-items: center;
  width: calc(104 * var(--u));
  height: calc(104 * var(--u));
  margin: calc(14 * var(--u)) auto 0;
  border-radius: calc(20 * var(--u));
  background: #FBEFD0;
  color: #B8862A;
}
.pi-picbox svg { width: calc(44 * var(--u)); height: calc(44 * var(--u)); }
.pi-words { display: grid; grid-template-columns: 1fr 1fr; gap: calc(8 * var(--u)); margin-top: calc(16 * var(--u)); }
.pi-words .pi-opt { padding: calc(13 * var(--u)) calc(8 * var(--u)); text-align: center; }

/* ── Exit: the card leaves in the direction of the rating, then the overlay
   lets go and the app shows through. ─────────────────────────────────── */
.device.is-exit-up .pi-card { opacity: 0; transform: translateY(calc(-14 * var(--u))) scale(0.96); }
.device.is-exit-down .pi-card { opacity: 0; transform: translateY(calc(14 * var(--u))) scale(0.96); }
.device.is-app-open .pi { opacity: 0; pointer-events: none; }

/* Reduced motion: the app's own fallback is an 80ms opacity change. */
@media (prefers-reduced-motion: reduce) {
  .pi-card.is-entering,
  .pi-card.is-revealed .pi-answer,
  .pi-card.is-revealed .pi-rate { animation-duration: 80ms; }
  .is-pressed::after { display: none; }
}
html[data-motion='off'] .is-pressed::after { display: none; }

/* ==========================================================================
   App screens — the hero's feature tour
   ==========================================================================

   Three of the app's own light screens, on ScreenScaffold's #F5F5F5 with its
   20dp gutters, drawn from (popcue-app/src/…):

     1. screens/onboarding/ConnectorPreviewScreen.tsx  "Notion connected."
        — a real card, made from the reader's own notes
     2. screens/onboarding/ConnectorsScreen.tsx, Talk to AI tab
        — Claude, ChatGPT or Grok writing cards in, over MCP
     3. screens/goals/GenerateCardsScreen.tsx           "Generate with AI"
        — a deck written from the goal, ending in the app's toast

   with the onboarding chrome (navigation/OnboardingChrome.tsx and
   components/StepProgressHeader.tsx) above the first two, as in the app.
   ========================================================================== */

.device.is-light .device-status { color: var(--ink); }
.device.is-light .device-nav { background: rgba(20, 16, 31, 0.55); }

.app-tour { position: absolute; inset: 0; background: #F5F5F5; color: var(--ink); }

.app-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: calc(30 * var(--u));
  background: #F5F5F5;
  opacity: 0;
  transform: translateX(calc(28 * var(--u)));
  pointer-events: none;
  transition:
    opacity 280ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.app-screen.is-active { opacity: 1; transform: none; }
.app-screen.is-leaving { opacity: 0; transform: translateX(calc(-28 * var(--u))); }

/* Onboarding chrome: back circle, five segments, the step count. */
.as-chrome { display: flex; align-items: center; gap: calc(14 * var(--u)); padding: calc(24 * var(--u)) calc(20 * var(--u)) calc(16 * var(--u)); }
.as-back,
.as-circle {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  border-radius: 50%;
  background: #FFFFFF;
  border: max(1px, calc(1 * var(--u))) solid #E8E6EE;
  color: var(--ink);
}
.as-back svg { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }
.as-circle { width: calc(34 * var(--u)); height: calc(34 * var(--u)); }
.as-circle svg { width: calc(14 * var(--u)); height: calc(14 * var(--u)); }
.as-segments { flex: 1 1 auto; display: flex; gap: calc(6 * var(--u)); min-width: 0; }
.as-segments i { flex: 1 1 0; height: calc(6 * var(--u)); border-radius: calc(3 * var(--u)); background: #E8E6EE; }
.as-segments i.on { background: var(--indigo); }
.as-step { flex-shrink: 0; font-size: calc(14 * var(--u)); font-weight: 700; line-height: 1.3; color: var(--ink-faint); }

.as-body { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 0 calc(20 * var(--u)); }
.as-body.as-top { padding-top: calc(24 * var(--u)); }
.as-footer { padding: calc(12 * var(--u)) calc(20 * var(--u)) calc((22 + 20) * var(--u)); }

.as-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(54 * var(--u));
  padding: calc(16 * var(--u)) calc(22 * var(--u));
  border-radius: 999px;
  font-size: calc(16 * var(--u));
  font-weight: 700;
  line-height: calc(20 * var(--u));
  text-align: center;
  transition: opacity 120ms ease-out;
}
.as-btn-primary { background: var(--indigo); color: #FFFFFF; }
.as-link { display: block; margin-top: calc(14 * var(--u)); font-size: calc(14 * var(--u)); font-weight: 600; line-height: 1.35; text-align: center; color: var(--ink-soft); }

.as-h1 {
  margin-top: calc(18 * var(--u));
  font-size: calc(36 * var(--u));
  font-weight: 800;
  line-height: calc(42 * var(--u));
  letter-spacing: -0.02em;
  color: var(--ink);
}
.as-text { margin-top: calc(10 * var(--u)); font-size: calc(15 * var(--u)); font-weight: 500; line-height: calc(22 * var(--u)); color: var(--ink-soft); }
.as-center { text-align: center; }

/* 1 · Connector preview */
.as-check {
  display: grid;
  place-items: center;
  width: calc(64 * var(--u));
  height: calc(64 * var(--u));
  margin: calc(22 * var(--u)) auto 0;
  border-radius: 50%;
  background: var(--sage-tint);
  color: var(--sage-strong);
}
.as-check svg { width: calc(28 * var(--u)); height: calc(28 * var(--u)); }
.as-h1.as-center { margin-top: calc(16 * var(--u)); font-size: calc(32 * var(--u)); line-height: calc(37 * var(--u)); }
.as-preview {
  margin-top: calc(22 * var(--u));
  padding: calc(22 * var(--u)) calc(20 * var(--u));
  border-radius: calc(26 * var(--u));
  background: #FFFFFF;
  box-shadow: 0 calc(10 * var(--u)) calc(30 * var(--u)) rgba(75, 58, 192, 0.1), 0 calc(2 * var(--u)) calc(8 * var(--u)) rgba(20, 16, 31, 0.05);
}
.as-pills { display: flex; flex-wrap: wrap; align-items: center; gap: calc(8 * var(--u)); }
.as-goal,
.as-source {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--u));
  border-radius: 999px;
  font-size: calc(12 * var(--u));
  font-weight: 700;
  line-height: 1.3;
}
.as-goal { padding: calc(6 * var(--u)) calc(13 * var(--u)); background: var(--indigo-tint); color: var(--indigo-deep); }
.as-goal i { width: calc(6 * var(--u)); height: calc(6 * var(--u)); border-radius: 50%; background: var(--indigo); }
.as-source { padding: calc(6 * var(--u)) calc(12 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u)); background: #F1EFF6; color: var(--ink-soft); }
.as-source b {
  display: grid;
  place-items: center;
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
  border-radius: calc(6 * var(--u));
  background: var(--charcoal);
  color: #FFFFFF;
  font-size: calc(10 * var(--u));
  font-weight: 800;
}
.as-eyebrow { margin-top: calc(18 * var(--u)); font-size: calc(11 * var(--u)); font-weight: 800; letter-spacing: 0.08em; line-height: 1.3; color: var(--ink-faint); }
.as-pq { margin-top: calc(6 * var(--u)); font-family: var(--font-serif); font-size: calc(23 * var(--u)); font-weight: 600; line-height: calc(30 * var(--u)); color: var(--ink); }
.as-panswer { margin-top: calc(16 * var(--u)); padding-top: calc(16 * var(--u)); border-top: max(1px, calc(1 * var(--u))) solid #E8E6EE; }
.as-panswer .as-eyebrow { margin-top: 0; color: var(--sage-strong); }
.as-pa { margin-top: calc(5 * var(--u)); font-family: var(--font-serif); font-size: calc(18 * var(--u)); font-weight: 600; line-height: calc(25 * var(--u)); color: var(--ink); }
.as-cap { margin-top: calc(6 * var(--u)); font-size: calc(12 * var(--u)); font-style: italic; line-height: 1.35; color: var(--ink-faint); }
.as-note { margin-top: calc(14 * var(--u)); font-size: calc(13 * var(--u)); line-height: 1.35; text-align: center; color: var(--ink-faint); }

/* 2 · Talk to AI */
.as-tabs { display: flex; gap: calc(8 * var(--u)); margin-top: calc(18 * var(--u)); }
.as-tabs span {
  flex: 1 1 0;
  padding: calc(12 * var(--u));
  border-radius: 999px;
  border: max(1px, calc(1 * var(--u))) solid #E8E6EE;
  background: #FFFFFF;
  font-size: calc(14 * var(--u));
  font-weight: 700;
  line-height: calc(18 * var(--u));
  text-align: center;
  color: var(--ink);
}
.as-tabs span.is-on { background: var(--charcoal); border-color: var(--charcoal); color: #FFFFFF; }
.as-aibanner {
  margin-top: calc(14 * var(--u));
  padding: calc(15 * var(--u)) calc(16 * var(--u));
  border-radius: calc(18 * var(--u));
  background: var(--indigo-tint);
  font-size: calc(13.5 * var(--u));
  line-height: calc(20 * var(--u));
  color: var(--indigo-deep);
}
.as-aibanner i { font-style: italic; }
.as-assistants {
  margin-top: calc(12 * var(--u));
  padding: 0 calc(16 * var(--u));
  border-radius: calc(20 * var(--u));
  border: max(1px, calc(1 * var(--u))) solid #E8E6EE;
  background: #FFFFFF;
}
.as-arow { display: flex; align-items: center; gap: calc(12 * var(--u)); padding: calc(10 * var(--u)) 0; }
.as-arow + .as-arow { border-top: max(1px, calc(1 * var(--u))) solid #E8E6EE; }
.as-arow b {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: calc(28 * var(--u));
  height: calc(28 * var(--u));
  border-radius: calc(8 * var(--u));
  color: #FFFFFF;
  font-size: calc(12 * var(--u));
  font-weight: 800;
}
.as-aname { font-size: calc(14.5 * var(--u)); font-weight: 700; line-height: 1.3; color: var(--ink); }
.as-asub { margin-top: calc(1 * var(--u)); font-size: calc(12 * var(--u)); line-height: 1.3; color: var(--ink-soft); }
.as-linkrow {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(14 * var(--u));
  margin-top: calc(12 * var(--u));
  padding: calc(14 * var(--u)) calc(16 * var(--u));
  border-radius: calc(20 * var(--u));
  background: var(--charcoal);
  color: #FFFFFF;
  font-size: calc(15 * var(--u));
  font-weight: 700;
  line-height: 1.3;
}
.as-linkrow span { flex: 1 1 auto; }
.as-linkrow svg { width: calc(15 * var(--u)); height: calc(15 * var(--u)); flex-shrink: 0; }

/* 3 · Generate with AI */
.as-header { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.as-title { font-size: calc(16 * var(--u)); font-weight: 800; line-height: calc(21 * var(--u)); color: var(--ink); }
.as-label { margin-top: calc(22 * var(--u)); font-size: calc(14 * var(--u)); font-weight: 700; line-height: 1.3; color: var(--ink); }
.as-field {
  margin-top: calc(8 * var(--u));
  min-height: calc(50 * var(--u));
  padding: calc(14 * var(--u)) calc(16 * var(--u));
  border-radius: calc(16 * var(--u));
  border: max(1px, calc(1 * var(--u))) solid #E8E6EE;
  background: #FFFFFF;
  font-size: calc(15 * var(--u));
  line-height: calc(20 * var(--u));
  color: var(--ink);
  transition: border-color 150ms ease-out;
}
.as-field.as-notes { min-height: calc(110 * var(--u)); }
.as-field.is-typing { border-color: var(--indigo); }
.as-placeholder { color: var(--ink-faint); }
.as-field.has-text .as-placeholder { display: none; }
.as-field.is-typing .as-typed::after {
  content: '';
  display: inline-block;
  width: max(1px, calc(1.5 * var(--u)));
  height: calc(18 * var(--u));
  margin-left: calc(1 * var(--u));
  vertical-align: text-bottom;
  background: var(--indigo);
  animation: asCaret 900ms steps(1) infinite;
}
@keyframes asCaret { 50% { opacity: 0; } }
.as-counts { display: flex; gap: calc(8 * var(--u)); margin-top: calc(8 * var(--u)); }
.as-counts span {
  position: relative;
  flex: 1 1 0;
  padding: calc(12 * var(--u)) 0;
  border-radius: 999px;
  border: max(1px, calc(1 * var(--u))) solid #E8E6EE;
  background: #FFFFFF;
  font-size: calc(15 * var(--u));
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: var(--ink);
  transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}
.as-counts span.is-on { background: var(--charcoal); border-color: var(--charcoal); color: #FFFFFF; }
.as-hint { margin-top: calc(12 * var(--u)); font-size: calc(12.5 * var(--u)); line-height: calc(17 * var(--u)); color: var(--ink-soft); }
.as-hint u { color: var(--indigo); }

/* The app's toast: a charcoal pill 24dp above the bottom inset. */
.as-toast {
  position: absolute;
  left: calc(24 * var(--u));
  right: calc(24 * var(--u));
  bottom: calc((22 + 24) * var(--u));
  padding: calc(14 * var(--u)) calc(20 * var(--u));
  border-radius: 999px;
  background: var(--charcoal);
  color: #FFFFFF;
  font-size: calc(14 * var(--u));
  font-weight: 700;
  line-height: calc(19 * var(--u));
  text-align: center;
  opacity: 0;
  transform: translateY(calc(8 * var(--u)));
  transition: opacity 260ms ease-out, transform 260ms ease-out;
}
.as-toast.is-shown { opacity: 1; transform: none; }

/* Each screen's content settles in after the screen itself lands. */
.app-screen.is-active .as-rise { animation: piFadeUp 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--rise, 120ms); }

/* The three steps under the phone, the active one filling as it plays. */
.tour-steps {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  margin-top: var(--sp-4);
  list-style: none;
  padding: 0;
}
.tour-steps li {
  position: relative;
  overflow: hidden;
  padding: 0.4rem 0.8rem 0.5rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-micro);
  font-weight: 700;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.tour-steps li.is-active { color: var(--ink); background: var(--surface); box-shadow: var(--sh-sm); }
.tour-steps li::after {
  content: '';
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.25rem;
  height: 2px;
  border-radius: 2px;
  background: var(--indigo);
  transform: scaleX(0);
  transform-origin: left;
}
.tour-steps li.is-active::after { animation: tourFill var(--scene-ms, 5000ms) linear both; }
html[data-motion='off'] .tour-steps li.is-active::after,
html:not(.js) .tour-steps li.is-active::after { animation: none; transform: scaleX(1); }
@keyframes tourFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* In a narrow column the three labels do not fit side by side: the active
   step keeps its label and the other two become dots. */
@container (max-width: 360px) {
  .tour-steps { align-items: center; gap: var(--sp-2); }
  .tour-steps li:not(.is-active) {
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    background: var(--line-strong);
    font-size: 0;
    color: transparent;
  }
  .tour-steps li:not(.is-active)::after { display: none; }
}
