/* =========================================================================
   GianOS — Messages app styles
   Thread, bubbles, msg, profile/panel/glance, badges, tile, forces, agentviz,
   punch, setback, payoff, timeline, kit, contact/cta, composer chips/suggest,
   typing indicator, story-progress (chat elements), notif/cascade/poster/
   focus feature CSS, AI beat CSS.
   ========================================================================= */

/* ---------------------------------------------------------------- thread */

.thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: 1.6rem 1.15rem 2rem;
  overflow: visible;
}

.msg { display: flex; flex-direction: column; gap: 0.4rem; max-width: 100%; }
.msg--in  { align-items: flex-start; }
.msg--out { align-items: flex-end; }

.msg__meta {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-family: var(--font-label);
  font-size: 0.68rem;
  color: var(--text-faint);
  padding-left: 0.25rem;
}
.msg__meta .sep { opacity: 0.5; }

.bubble {
  border-radius: 1.25rem;
  padding: 0.95rem 1.1rem;
  font-size: 1.03rem;
  line-height: 1.62;
  max-width: 92%;
}
.bubble--in {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-top-left-radius: 0.35rem;
}
.bubble--out {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  line-height: 1.5;
  border-top-right-radius: 0.35rem;
  /* outgoing-bubble shadow tints to the accent: clay fallback, seed-following second */
  box-shadow: 0 0.6rem 1.4rem -0.7rem oklch(0.45 0.13 33 / 0.5);
  box-shadow: 0 0.6rem 1.4rem -0.7rem oklch(from var(--seed) 0.45 0.13 h / 0.5);
  /* light text on the deep accent fill: keep the smoothing */
  -webkit-font-smoothing: antialiased;
}
.bubble p + p { margin-top: 0.7rem; }

.answer-lead { font-size: 1.09rem; }
.answer-aside { color: var(--text-muted); font-size: 0.95rem; font-style: italic; }

.hl { color: var(--text); font-weight: 600; box-shadow: inset 0 -0.42em 0 var(--accent-soft); padding: 0 0.04em; }
strong { font-weight: 600; color: var(--text); }

/* streaming cursor */
.stream-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.04em;
  vertical-align: -0.16em;
  background: var(--accent);
  border-radius: 1px;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* typing indicator */
.typing { display: inline-flex; gap: 0.28rem; padding: 0.3rem 0.1rem; }
.typing span {
  width: 0.42rem; height: 0.42rem; border-radius: 50%;
  background: var(--text-faint);
  animation: typing 1.2s var(--ease) infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-0.3rem); opacity: 1; } }

/* ------------------------------------------------------- knowledge panel */

.bubble--panel { width: 100%; max-width: 100%; }

.profile {
  display: flex;
  align-items: center;
  gap: 0.88rem;
  padding: 0.12rem 0 1rem;
  margin: 0.02rem 0 0.95rem;
  border-bottom: 1px solid var(--line-soft);
}
.profile__ava {
  position: relative;
  flex: 0 0 auto;
  width: 3.9rem;
  height: 3.9rem;
}
.profile__avaframe {
  display: block;            /* span defaults to inline, which ignores sizing */
  width: 100%;
  aspect-ratio: 1;            /* robust square -> clean circle in the flex row */
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 0.4rem 1.2rem -0.4rem oklch(0 0 0 / 0.6);
}
.profile__avaframe img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;       /* show the face, no head-crop */
  transform: scaleX(-1);          /* mirror only: face turns toward the card */
}
/* dot lives outside the clipped frame so it is never cut off */
.profile__ava .dot--live {
  position: absolute;
  right: 0.04rem;
  bottom: 0.04rem;
  width: 0.84rem;
  height: 0.84rem;
  outline: 2.5px solid var(--surface-2);
  z-index: 2;
}
.profile__id { display: flex; flex-direction: column; gap: 0.16rem; min-width: 0; }
.profile__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.14rem;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.profile__role { font-size: 0.82rem; line-height: 1.25; color: var(--text-muted); }
.profile__link {
  align-self: flex-start;
  margin-top: 0.38rem;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  font-family: var(--font-label);
  font-size: 0.73rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--accent-line);
  border-radius: 1.5rem;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.profile__link:hover { background: var(--accent-soft); transform: translateY(-0.08rem); }
.profile__link:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

.glance { display: flex; flex-direction: column; gap: 0.9rem; }

.panel { display: flex; flex-direction: column; }
.panel__row {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.8rem;
  padding: 0.5rem 0;
  align-items: baseline;
}
.panel__row + .panel__row { border-top: 1px solid var(--line-soft); }
.panel__row dt {
  font-family: var(--font-label);
  font-size: 0.74rem;
  color: var(--text-faint);
  text-transform: lowercase;
}
.panel__row dd { color: var(--text-muted); font-size: 0.95rem; }
.panel__row dd strong { color: var(--text); font-weight: 600; }
.panel__row--bg dt, .panel__row--bg dd { color: var(--text-faint); }
.flags { font-size: 1.1rem; letter-spacing: 0.12em; }

/* ------------------------------------------------------------ break-outs */
/* Big display lines that punctuate the thread. */

.breakout {
  position: relative;
  align-self: center;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.25rem 0;
}
.breakout__kicker {
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.breakout__line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 9vw, 2.7rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-top: 0.2rem;
  color: var(--text);
}
.breakout__line em { font-style: italic; color: var(--accent); }

/* -------------------------------------------- pop: staggered answer reveal */
/* Visual modules held back during text streaming, then revealed as units. */
.pop { opacity: 0; transform: translateY(0.9rem) scale(0.975); }
.pop.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease);
}

/* ============================================================ storytelling */

/* chapter kicker: a small label that opens each story beat */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.kicker::before {
  content: "";
  width: 1.3rem;
  height: 1px;
  background: var(--accent-line);
}
.kicker__n { color: var(--text-faint); letter-spacing: 0.04em; }

/* hero cliffhanger tail */
.hook-tail { margin-top: 0.7rem; color: var(--text-muted); }
.hook-tail strong { color: var(--accent); font-weight: 600; }

/* open-loop tail lines inside an answer */
.tail { margin-top: 0.8rem; color: var(--text-faint); font-size: 0.92rem; }
.aside-quiet { margin-top: 0.75rem; color: var(--text-faint); font-size: 0.92rem; font-style: italic; }

/* the cliffhanger "continue" button: the dopamine pull to the next beat */
.next-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.85rem 1.1rem;
  font-family: var(--font-ui);
  font-size: 1.02rem;
  font-weight: 600;
  text-align: left;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 1.1rem;
  cursor: pointer;
  /* next-CTA shadow tints to the accent: clay fallback, seed-following second */
  box-shadow: 0 0.7rem 1.6rem -0.7rem oklch(0.45 0.13 33 / 0.5);
  box-shadow: 0 0.7rem 1.6rem -0.7rem oklch(from var(--seed) 0.45 0.13 h / 0.5);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.25s var(--ease);
}
.next-cta:hover { transform: translateY(-0.14rem); background: var(--accent-strong); box-shadow: 0 1rem 2.2rem -0.6rem var(--accent-strong); }
.next-cta:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.next-cta:active { transform: translateY(0); }
.next-cta:disabled { cursor: default; opacity: 0.72; transform: none; }
.next-cta__go {
  flex: 0 0 auto;
  font-size: 1.2rem;
  font-weight: 700;
  transition: transform 0.3s var(--ease);
}
.next-cta:hover .next-cta__go { transform: translateX(0.3rem); }
.next-cta--out { background: var(--surface-3); color: var(--text); box-shadow: none; border: 1px solid var(--accent-line); }
.next-cta--out:hover { background: var(--surface-2); }

/* the continue button morphs into the question bubble it becomes.
   Only the shared element animates; the rest of the page swaps instantly. */
::view-transition-group(q-morph) {
  animation-duration: 0.5s;
  animation-timing-function: var(--ease);
}
::view-transition-old(root),
::view-transition-new(root) { animation: none; }

/* challenge: two forces in tension */
.forces { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.7rem; }
.force {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 1rem;
  padding: 0.8rem 0.9rem;
}
.force__k {
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.force p { margin-top: 0.2rem; font-size: 0.95rem; color: var(--text-muted); }
.force strong { color: var(--text); }
.forces__plus {
  align-self: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--accent);
  line-height: 0.6;
}
.stakes { margin-top: 0.8rem; font-size: 1.02rem; color: var(--text); }
.stakes strong { color: var(--accent); font-weight: 700; }

/* setback: the quiet, honest dip (oxytocin) */
.setback-block {
  margin-top: 0.7rem;
  padding: 0.95rem 1rem;
  background: var(--stage);
  border: 1px solid var(--line-soft);
  border-radius: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.setback-block p + p { margin-top: 0.6rem; }
.setback-block strong { color: var(--text); font-weight: 600; }

/* conclusion: the warm payoff */
.payoff { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.7rem; }
.payoff__chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 0.8rem;
}
.payoff__chip::before {
  content: "✓";
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}
.punchline {
  margin-top: 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
}
.punchline strong { color: var(--accent); }

/* --------------------------------------------------------------- badges */

.badges { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.65rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.42rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.36rem 0.72rem;
  border-radius: 0.7rem;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
}
.badge--lead {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  font-weight: 600;
}
.badge--ghost { background: transparent; color: var(--text-muted); border-style: dashed; }
.badge--flag { background: var(--surface); }
.badge__dot {
  width: 0.46rem; height: 0.46rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0.5rem var(--accent);
}

/* ------------------------------------------- agentviz: AI mini-diagram */

.agentviz {
  margin-top: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 1.05rem;
  padding: 1rem 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.agentviz__agent {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.24rem 0.72rem;
  border-radius: 1rem;
  box-shadow: 0 0.4rem 1.3rem -0.3rem var(--accent-strong);
}
.agentviz__beam {
  width: 2px; height: 0.9rem;
  background: linear-gradient(var(--accent), transparent);
}
.agentviz__mods { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.mod {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 0.5rem;
  padding: 0.3rem 0.55rem;
}
.mod--hot {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.agentviz__cap { font-size: 0.8rem; color: var(--text-faint); margin-top: 0.15rem; text-align: center; }
.agentviz__cap strong { color: var(--text-muted); }

/* ------------------------------------------------ punch: tag + bold line */

.punch {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  margin-top: 0.7rem;
}
.punch__k {
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 0.24rem 0.5rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  margin-top: 0.12rem;
}
.punch p { font-size: 0.96rem; color: var(--text-muted); }
.punch strong { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------- work tiles */

.tile {
  margin-top: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 1.05rem;
  padding: 0.9rem 0.95rem;
}
.tile__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem;
  margin-bottom: 0.45rem;
}
.tile__org { font-family: var(--font-label); font-size: 0.7rem; color: var(--accent); }
.tile__when { font-family: var(--font-label); font-size: 0.68rem; color: var(--text-faint); white-space: nowrap; }
.tile__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.tile__title strong { color: var(--accent); }
.tile__sub { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.35rem; }
.tile__sub strong { color: var(--text); font-weight: 600; }

.flow { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.2rem; }
.flow__step {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.42rem 0.7rem;
  border-radius: 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.flow__step--ai { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.flow__step--out { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.flow__arrow { color: var(--text-faint); font-weight: 700; }

/* ----------------------------------------------------------- toolkit */

.kit { display: flex; flex-direction: column; gap: 0.95rem; }
.kit__row { display: flex; flex-direction: column; gap: 0.45rem; }
.kit__k {
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.kit__row--lead .kit__k { color: var(--accent); }

/* -------------------------------------------------------------- timeline */

.timeline { list-style: none; display: flex; flex-direction: column; }
.timeline__item {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 0.9rem;
  padding: 0.6rem 0 0.6rem 0.9rem;
  position: relative;
  align-items: baseline;
}
.timeline__item::before {
  content: ""; position: absolute; left: 0; top: 0.95em;
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--accent); outline: 3px solid var(--surface-2);
}
.timeline__item::after {
  content: ""; position: absolute; left: 0.245rem; top: 1.4em; bottom: -0.6em;
  width: 1.5px; background: var(--line);
}
.timeline__item:last-child::after { display: none; }
.timeline__item--edu::before { background: var(--text-faint); }
.timeline__when { font-family: var(--font-label); font-size: 0.74rem; color: var(--text-faint); }
.timeline__what { font-size: 0.96rem; color: var(--text-muted); }

/* --------------------------------------------------------------- contact */

.contact { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.65rem; }
.cta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  text-decoration: none;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}
.cta:hover { border-color: var(--accent-line); background: var(--surface-3); transform: translateY(-0.12rem); }
.cta:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.cta:active { transform: translateY(0); }
.cta__icon { flex: 0 0 auto; color: var(--accent); }
.cta__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cta__k { font-family: var(--font-label); font-size: 0.68rem; color: var(--text-faint); text-transform: lowercase; }
.cta__v { font-weight: 600; color: var(--text); }
.cta__go { color: var(--accent); font-weight: 700; font-size: 1.15rem; transition: transform 0.3s var(--ease); }
.cta:hover .cta__go { transform: translateX(0.28rem); }

/* -------------------------------------------------------------- composer */

.composer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  /* extra bottom room so the chips clear the navind home bar (z40) that floats
     over the device bottom edge, plus the iOS/Android safe-area inset */
  padding: 0.7rem 1.0rem calc(1.5rem + max(0.3rem, env(safe-area-inset-bottom)));
  background: linear-gradient(to top, var(--surface) 62%, transparent);
  -webkit-backdrop-filter: blur(2px);
}

.suggest {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.3rem 0.1rem 0.7rem;
  margin: 0 -0.2rem;
  scroll-padding: 0.2rem;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 0.6rem, #000 calc(100% - 1.4rem), transparent);
          mask-image: linear-gradient(to right, transparent, #000 0.6rem, #000 calc(100% - 1.4rem), transparent);
}
.suggest::-webkit-scrollbar { display: none; }
.suggest--dragging { cursor: grabbing; scroll-snap-type: none; }

.chip {
  flex: 0 0 auto;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 2.75rem;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.chip:hover { border-color: var(--accent-line); transform: translateY(-0.1rem); }
.chip:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.chip:active { transform: translateY(0); }
.chip--done { color: var(--text-faint); opacity: 0.55; }
.chip--done::before { content: "✓ "; color: var(--accent); }

/* =========================================================================
   Notifications: conclusion cascade (MARQUEE) + setback silenced
   ========================================================================= */
.notif-stack { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.75rem; }
.notif {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.72rem 0.85rem;
  border-radius: 1.2rem;
  opacity: 0;
  transform: translateY(1rem) scale(0.97);
}
.notif.in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.notif__icon { width: 1.95rem; height: 1.95rem; border-radius: 0.55rem; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.notif__icon svg { width: 1.05rem; height: 1.05rem; }
.notif__main { min-width: 0; display: flex; flex-direction: column; gap: 0.04rem; }
.notif__app { font-family: var(--font-label); font-size: 0.64rem; color: var(--text-faint); }
.notif__title { font-weight: 600; font-size: 0.9rem; color: var(--text); line-height: 1.25; }
.notif__body { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.12rem; }
.notif__time { font-family: var(--font-label); font-size: 0.62rem; color: var(--text-faint); white-space: nowrap; }
body[data-os="ios"] .notif { background: color-mix(in oklch, var(--surface) 84%, transparent); border: 1px solid var(--line-soft); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); box-shadow: 0 0.6rem 1.7rem -0.9rem oklch(0.3 0.03 50 / 0.45); border-radius: 1.35rem; }
body[data-os="android"] .notif { background: var(--m3-surface-container); border-radius: 1.6rem; }
body[data-os="android"] .notif__icon { background: var(--m3-primary-container); color: var(--m3-on-primary-container); border-radius: 50%; }
.notif--silenced { opacity: 0.62; }
.notif--silenced .notif__icon { background: var(--surface-3); color: var(--text-faint); }
.notif--silenced .notif__title { color: var(--text-muted); }
.notif__hushed { font-family: var(--font-label); font-size: 0.62rem; color: var(--text-faint); display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.25rem; }
.notif__hushed svg { width: 0.85rem; height: 0.85rem; }

/* =========================================================================
   AI beat: Apple Intelligence edge glow (iOS) / Gemini + lasso (Android)
   ========================================================================= */
@property --ai-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.ai-glow {
  position: absolute; inset: -2px; z-index: 25;
  border-radius: inherit;
  padding: 2.5px;
  pointer-events: none;
  background: conic-gradient(from var(--ai-angle),
    oklch(0.72 0.17 30), oklch(0.70 0.16 310), oklch(0.70 0.17 250),
    oklch(0.78 0.16 150), oklch(0.74 0.17 60), oklch(0.72 0.17 30));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
  animation: ai-spin 1.6s linear, ai-fade 1.9s var(--ease);
}
@keyframes ai-spin { to { --ai-angle: 360deg; } }
@keyframes ai-fade { 0%, 100% { opacity: 0; } 18%, 72% { opacity: 0.95; } }
.ai-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 26; pointer-events: none;
  font-family: var(--font-label); font-size: 0.82rem; font-weight: 600; color: var(--text);
  background: color-mix(in oklch, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  padding: 0.55rem 0.95rem; border-radius: 1rem; border: 1px solid var(--line-soft);
  display: inline-flex; align-items: center; gap: 0.45rem;
  opacity: 0; animation: ai-fade 1.9s var(--ease);
}
.ai-label__spark { width: 1rem; height: 1rem; fill: var(--accent); }

/* Android Gemini sheet + circle-to-search lasso */
.gemini {
  position: relative; margin-top: 0.7rem;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.8rem; border-radius: 1.4rem;
  background: var(--m3-surface-container); border: 1px solid var(--m3-outline);
  opacity: 0; transform: translateY(0.9rem);
}
.gemini.in { opacity: 1; transform: none; transition: opacity 0.4s var(--ease), transform 0.5s var(--ease); }
.gemini__spark { flex: 0 0 auto; width: 1.5rem; height: 1.5rem; }
.gemini__txt { font-size: 0.82rem; color: var(--text); line-height: 1.3; }
.gemini__txt b { font-weight: 600; }
.cts-lasso { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: visible; }
.cts-lasso ellipse { fill: oklch(0.6 0.16 250 / 0.07); stroke: oklch(0.6 0.17 250); stroke-width: 2.4; stroke-dasharray: 1; stroke-dashoffset: 1; }
.cts-lasso.draw ellipse { animation: cts-draw 0.85s var(--ease) forwards; }
@keyframes cts-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* =========================================================================
   Contact: iOS Contact Poster / Android Quick Share sheet
   ========================================================================= */
.poster {
  position: relative; overflow: hidden;
  margin-bottom: 0.85rem;
  min-height: 11.5rem;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.1rem;
  border-radius: 1.5rem;
  background: oklch(0.2 0.01 55);
  opacity: 0; transform: translateY(0.9rem) scale(0.985);
}
.poster.in { opacity: 1; transform: none; transition: opacity 0.55s var(--ease), transform 0.65s var(--ease); }
.poster__photo { position: absolute; inset: 0; z-index: 0; }
.poster__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transform: scale(-1.18, 1.18); transform-origin: 50% 22%; }
.poster__scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, oklch(0.15 0.02 40 / 0.88), oklch(0.15 0.02 40 / 0.12) 56%, transparent); }
.poster__id { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 0.1rem; }
.poster__name { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 12vw, 2.9rem); line-height: 0.88; letter-spacing: -0.03em; color: oklch(0.98 0.01 80); }
.poster__full { font-size: 0.85rem; color: oklch(0.9 0.012 80); margin-top: 0.25rem; }
/* Android Quick Share: a Material You bottom sheet header */
body[data-os="android"] .poster {
  min-height: auto; flex-direction: row; align-items: center; gap: 0.85rem;
  justify-content: flex-start;
  background: var(--m3-surface-container);
  border-radius: 1.8rem 1.8rem 1.3rem 1.3rem;
  padding-top: 1.45rem;
}
body[data-os="android"] .poster::before { content: ""; position: absolute; top: 0.6rem; left: 50%; transform: translateX(-50%); width: 2.1rem; height: 0.28rem; border-radius: 1rem; background: var(--m3-outline); z-index: 3; }
body[data-os="android"] .poster__photo { position: relative; width: 3.1rem; height: 3.1rem; border-radius: 50%; overflow: hidden; flex: 0 0 auto; }
body[data-os="android"] .poster__scrim { display: none; }
body[data-os="android"] .poster__name { font-size: 1.35rem; color: var(--text); }
body[data-os="android"] .poster__full { color: var(--text-muted); }
body[data-os="android"] .poster__sub { font-family: var(--font-label); font-size: 0.66rem; color: var(--text-faint); display: block; margin-bottom: 0.1rem; }
.poster__sub { display: none; }
