/* Pote — iOS-native chat UI (Apple HIG). Light/dark, translucent chrome, spring motion.
 * genre: modern-minimal · chat-as-page · WhatsApp-style voice notes with karaoke transcript
 */
@import url("tokens.css");

* , *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; height: 100%; -webkit-text-size-adjust: 100%; }
body.app {
  margin: 0;
  height: 100dvh;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
p { margin: 0; }
a { color: var(--tint); text-decoration: none; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 4px; }

/* ---------- Top bar (translucent, iOS large-title-ish) ---------- */
.bar {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding-block: var(--space-sm);
  padding-top: max(var(--space-sm), env(safe-area-inset-top));
  /* content aligned to the chat column; background stays full-width for the blur */
  padding-inline: max(var(--page-gutter), calc((100% - var(--convo-max)) / 2));
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--chrome-border);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: var(--text-md);
  letter-spacing: -0.02em;
  color: var(--label);
  text-decoration: none;
}
.wordmark .logo { width: 1.7em; height: 1.7em; display: block; flex: none; }
.wordmark .logo.spin { animation: motor-spin 0.6s cubic-bezier(0.25, 0.1, 0.25, 1); }
@keyframes motor-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.bar__meta { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.bar__price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Buttons (iOS filled / plain) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 40px;
  padding: var(--space-2xs) var(--space-lg);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--tint);
  color: #fff;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-micro) var(--ease-pop), background-color var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out);
}
.btn:hover { background: var(--tint-press); }
.btn:active { transform: scale(0.95); }
.btn--ghost {
  background: transparent;
  color: var(--tint);
  min-height: 36px;
}
.btn--ghost:hover { background: color-mix(in srgb, var(--tint) 12%, transparent); }

/* ---------- Chat surface ---------- */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat__log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-block: var(--space-md);
  padding-inline: max(var(--page-gutter), calc((100% - var(--convo-max)) / 2));
  scroll-behavior: smooth;
}

/* ---------- Message bubbles (iMessage) ---------- */
.msg {
  display: block;
  width: fit-content;
  max-width: 82%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-bubble);
  font-size: var(--text-base);
  line-height: 1.35;
  overflow-wrap: anywhere;
  margin-block: 2px;
  animation: bubble-in var(--dur-short) var(--ease-spring) both;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.msg + .msg { margin-top: var(--space-2xs); }
.msg--bot {
  background: var(--bubble-in);
  color: var(--bubble-in-label);
  border-bottom-left-radius: var(--radius-sm);
  margin-right: auto;
}
.msg--user {
  background: var(--bubble-out);
  color: var(--bubble-out-label);
  border-bottom-right-radius: var(--radius-sm);
  margin-left: auto;
}
.msg--user a { color: #fff; text-decoration: underline; }
.msg p { margin: 0 0 0.3em; }
.msg p:last-child { margin-bottom: 0; }
.msg--error {
  background: color-mix(in srgb, var(--danger) 12%, var(--bg-elevated));
  color: var(--danger);
  border: 0.5px solid color-mix(in srgb, var(--danger) 40%, transparent);
  margin-right: auto;
}
.msg--error button {
  display: block;
  margin-top: var(--space-xs);
  min-height: 40px;
  padding: var(--space-2xs) var(--space-md);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* typing indicator */
.typing { display: inline-flex; gap: 4px; padding: 0.15rem 0; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--label-3);
  animation: typing 1.2s var(--ease-in-out, ease) infinite;
}
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

/* ---------- Voice note (WhatsApp-style) ---------- */
.vnote {
  width: min(17.5rem, 72vw); /* bubble is exactly the player's width */
  max-width: 82%;
  padding: 0.5rem 0.6rem 0.55rem;
  /* A voice note is audio, not copy — don't let it select/highlight like a text bubble. */
  user-select: none;
  -webkit-user-select: none;
}
.vnote__row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
}
.vnote__play {
  flex: none;
  width: 30px; height: 34px;
  border: none;
  border-radius: var(--radius-pill); /* invisible (no bg) but keeps focus/glow rings round */
  background: none;            /* no circle wrap — the glyph itself is the control */
  color: var(--tint);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 22px;            /* prominent, bare glyph */
  line-height: 1;
  transition: transform var(--dur-micro) var(--ease-pop), color var(--dur-short) var(--ease-out);
}
.vnote__play:hover { color: var(--tint-press); }
.vnote__play:active { transform: scale(0.86); }
.vnote.is-loading .vnote__play { pointer-events: none; }
/* Loading = spinner ONLY. Hide the play/pause glyph so states never overlap. */
.vnote.is-loading .vnote__icon {
  font-size: 0;              /* hide the ▶ / ❚❚ glyph entirely */
  color: transparent;
  box-sizing: border-box;
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(10,132,255,0.3);
  border-top-color: var(--tint);
  border-radius: 50%;
  animation: vnote-spin 0.6s linear infinite;
}
@keyframes vnote-spin { to { transform: rotate(360deg); } }
.vnote__icon { pointer-events: none; display: block; white-space: nowrap; line-height: 1; }

.vnote__wave {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between; /* spread bars edge-to-edge — no gap before the time */
  gap: 0;
  height: 28px;
  cursor: pointer; /* click to scrub */
}
.vnote { cursor: pointer; } /* click the bubble to toggle play/pause */
.vnote__wave > span {
  flex: none;
  width: 2.5px;
  border-radius: 2px;
  background: var(--label-3);
  transition: background-color var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out);
}
/* played state — bars stay softly tinted so a heard note reads as different from an unheard one */
.vnote.is-played .vnote__wave > span { background: var(--tint); opacity: 0.4; }
.vnote.is-playing .vnote__wave > span { background: var(--tint); opacity: 0.55; }
.vnote__time {
  flex: none;
  font-size: var(--text-xs);
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
  min-width: 2.6em;
  text-align: right;
}
/* transcript — hidden until played, then one subtitle line at a time, synced to audio */
.vnote__text {
  font-size: var(--text-sm);
  line-height: 1.35;
  color: var(--label);
  min-height: 0;
  transition: margin-top var(--dur-short) var(--ease-out);
}
.vnote__text:not(:empty) { margin-top: var(--space-xs); }
.vnote__line {
  display: block;
  animation: sub-in var(--dur-short) var(--ease-out);
}
@keyframes sub-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}
.vnote--noaudio .vnote__row { display: none; }
.vnote__toggle {
  font-size: var(--text-xs);
  color: var(--label-3);
  cursor: pointer;
  display: inline-block;
}
.vnote__toggle:hover { color: var(--tint); }

/* User voice note — right-aligned, tint bubble, white controls */
.msg--user.vnote {
  background: var(--bubble-out);
  color: var(--bubble-out-label);
  border-bottom-right-radius: var(--radius-sm);
  margin-left: auto;
  margin-right: 0;
}
.msg--user.vnote .vnote__play { background: none; color: #fff; }
.msg--user.vnote .vnote__play:hover { color: rgba(255,255,255,0.8); }
.msg--user.vnote .vnote__wave > span:not(.vnote__fill) { background: rgba(255,255,255,0.5); }
.msg--user.vnote.is-played .vnote__wave > span:not(.vnote__fill) { background: rgba(255,255,255,0.7); }
.msg--user.vnote .vnote__fill { background: #fff; opacity: 0.15; }
.msg--user.vnote .vnote__time { color: var(--bubble-out-label); }
.vnote--noaudio .vnote__text { color: var(--bubble-in-label); font-size: var(--text-base); margin-top: 0; }
@media (prefers-reduced-motion: reduce) {
  .vnote__line { animation: none; }
}

/* ---------- Quick-reply chips ---------- */
.chips[hidden] { display: none; }
.chips {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-md) max(var(--page-gutter), calc((100% - var(--convo-max)) / 2)) var(--space-xs);
  /* Fade from the page bg up to transparent so chat content scrolling behind reads clean, not a hard block. */
  background: linear-gradient(to top, var(--bg) 55%, transparent);
  pointer-events: none; /* only the chips themselves are clickable, not the gradient gutter */
}
.chips > * { pointer-events: auto; }
.chip {
  min-height: 38px;
  padding: var(--space-2xs) var(--space-md);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--tint);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-micro) var(--ease-pop), background-color var(--dur-short) var(--ease-out);
}
.chip:hover { background: color-mix(in srgb, var(--tint) 8%, var(--bg-elevated)); }
.chip:active { transform: scale(0.95); }
/* Secondary, muted opt-out — reads as the quieter choice next to "Listen". */
.chip--muted {
  background: none;
  border-color: transparent;
  color: var(--label-2);
  font-weight: 400;
}
.chip--muted:hover { background: color-mix(in srgb, var(--label) 6%, transparent); }
/* Quiet legal links — plain text, no pill, sit after the opt-out on the first step. */
.chip-link {
  align-self: center;
  padding: var(--space-2xs) var(--space-xs);
  color: var(--label-3);
  font-size: var(--text-xs);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.chip-link:hover { color: var(--label-2); }

/* ---------- Cards (review, lead, offer) ---------- */
.psi, .lead, .offer-card {
  width: fit-content;
  max-width: 82%;
  -webkit-user-select: none;
  user-select: none;
  margin-right: auto;
  margin-block: var(--space-xs);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-1);
  animation: bubble-in var(--dur-short) var(--ease-spring) both;
}
.psi, .lead { padding: var(--space-md); border: 0.5px solid var(--separator); }

/* review card */
.psi__label { font-size: var(--text-sm); font-weight: 600; color: var(--tint); }
.psi__host {
  margin-top: var(--space-3xs);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.psi__btn { margin-top: var(--space-sm); width: 100%; }
.psi__note { margin-top: var(--space-xs); font-size: var(--text-xs); color: var(--label-2); }

/* Human handoff card — a warm "connecting you" state, distinct from the offer (no blue push). */
.handoff-card { border: 0.5px solid var(--separator); }
.handoff-card .psi__label { color: var(--label); }
.handoff-card__body { margin-top: var(--space-2xs); font-size: var(--text-sm); color: var(--label-2); line-height: 1.5; }
.psi__link { display: inline-block; margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--tint); }
.psi--pending .psi__label { color: var(--label-2); }
.psi__dots { display: inline-flex; gap: 4px; margin-top: var(--space-sm); }
.psi__dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--tint);
  animation: typing 1.2s ease infinite;
}
.psi__dots i:nth-child(2) { animation-delay: 0.18s; }
.psi__dots i:nth-child(3) { animation-delay: 0.36s; }

/* lead / Google Business card */
.lead__label { font-size: var(--text-sm); font-weight: 600; color: var(--tint); }
.lead__name {
  margin-top: var(--space-3xs);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.lead__meta {
  margin-top: var(--space-2xs);
  font-size: var(--text-sm);
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}

/* Offer card — iMessage link-preview: hero image area on top, text block below, one tap target. */
.offer-card {
  width: min(21rem, 88%);
  max-width: 88%;
  padding: 0;
  overflow: hidden;
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-bubble);
  box-shadow: var(--shadow-2);
}
/* Hero — a mini preview of the preview: tap to open the full mockup sheet. */
.offer-card__hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  width: 100%;
  aspect-ratio: 1.91 / 1;               /* OG-image ratio, same as iMessage previews */
  padding: var(--space-md);
  border: none;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  text-align: center;
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(135deg, var(--tint), #003f8a);
}
.offer-card__hero:active { opacity: 0.85; }
.offer-card__wordmark {
  font-family: var(--font-rounded);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.offer-card__tag {
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.offer-card__pill {
  margin-top: var(--space-xs);
  padding: var(--space-2xs) var(--space-md);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.92);
  color: var(--tint);
  font-size: var(--text-sm);
  font-weight: 600;
}
/* Body — the sell. */
.offer-card__body { padding: var(--space-sm) var(--space-md) var(--space-md); }
.offer-card__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--label);
}
.offer-card__price {
  margin-top: var(--space-2xs);
  font-size: var(--text-2xl);            /* the $999 is the headline number */
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--label);
  line-height: 1.1;
}
.offer-card__once {
  margin-left: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--label-2);
}
/* Monthly fee on its own row — clearly separate from the build price. */
.offer-card__monthly {
  margin-top: var(--space-2xs);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}
.offer-card__deal {
  display: inline-block;
  margin-left: var(--space-xs);
  padding: 1px var(--space-xs);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}
.offer-card__perks {
  margin: var(--space-xs) 0 0;
  padding: 0;
  list-style: none;
}
.offer-card__perks li {
  position: relative;
  padding-left: 1.4em;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--label-2);
}
.offer-card__perks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.offer-card__addons {
  margin: var(--space-xs) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.offer-card__addon {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--tint) 10%, var(--bg-elevated));
  border: 0.5px solid color-mix(in srgb, var(--tint) 20%, var(--separator));
  color: var(--label-2);
  font-size: var(--text-xs);
  line-height: 1.6;
  white-space: nowrap;
}
.offer-card__cta { margin-top: var(--space-sm); width: 100%; font-weight: 600; }
.offer-card__source {
  margin-top: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--label-3);
}
@media (hover: hover) {
  .offer-card__hero:hover .offer-card__pill { background: #fff; }
}

/* Live hero thumbnail — a real site, scaled down like a link-preview screenshot */
.offer-card__hero--live { padding: 0; overflow: hidden; background: #101012; }
.offer-card__scale {
  position: absolute;
  top: 0; left: 0;
  transform-origin: top left;
  pointer-events: none; /* taps land on the hero button, not the page inside */
}
.offer-card__frame {
  display: block;
  width: 390px;   /* phone-width render, scaled to the card by JS (390 → card width) */
  height: 1400px; /* tall enough to show hero + services + form in the thumbnail */
  border: 0;
  background: #fff;
}
.offer-card__badge {
  position: absolute;
  top: var(--space-xs); left: var(--space-xs);
  z-index: 2;
  padding: 2px var(--space-xs);
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 500;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.offer-card__hero--live .offer-card__pill {
  position: absolute;
  bottom: var(--space-sm); left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  box-shadow: var(--shadow-2);
}

/* ---------- Preview sheet — iOS bottom sheet with the future-homepage mockup ---------- */
.preview-sheet {
  margin: auto auto 0;
  width: 100%;
  max-width: 26rem;
  border: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-sm) var(--space-md) calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-elevated);
  color: var(--label);
  box-shadow: var(--shadow-2);
  -webkit-user-select: none;
  user-select: none;
}
.preview-sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
.preview-sheet[open] { animation: sheet-up var(--dur-long) var(--ease-spring) both; }
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@media (min-width: 480px) {
  .preview-sheet { margin: auto; border-radius: var(--radius-lg); }
}
.preview-sheet__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xs);
  margin-bottom: var(--space-sm);
}
.preview-sheet__grabber {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 5px;
  border-radius: var(--radius-pill);
  background: var(--label-3);
}
.preview-sheet__title { font-size: var(--text-base); font-weight: 600; }
/* Collapsible legal disclaimer — a quiet "Learn more" that expands the cover-our-asses copy. */
.preview-legal {
  margin-top: var(--space-sm);
  border-top: 0.5px solid var(--separator);
  padding-top: var(--space-xs);
}
.preview-legal > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--label-2);
  user-select: none;
}
.preview-legal > summary::-webkit-details-marker { display: none; }
.preview-legal > summary::after {
  content: "";
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;   /* crisp down-caret, clearly visible */
  transition: transform var(--dur-short) var(--ease-out);
}
.preview-legal[open] > summary::after { transform: rotate(180deg); }
.preview-legal__body {
  margin-top: var(--space-xs);
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--label-3);
}
.preview-sheet__buy { margin-top: var(--space-sm); width: 100%; font-weight: 600; }

/* Live showcase — real Factory sites in iframes */
.preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin-bottom: var(--space-xs);
}
.preview-tabs .chip.is-active {
  background: var(--tint);
  border-color: transparent;
  color: #fff;
}
.preview-frame {
  height: 55vh;
  overflow: hidden;
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-md);
  background: var(--bg);
}
.preview-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.preview-sheet__note {
  margin-top: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--label-2);
}

/* ---------- Composer ---------- */
.chat__form {
  flex: none;
  display: flex;
  gap: var(--space-xs);
  align-items: flex-end;
  padding: var(--space-xs) max(var(--page-gutter), calc((100% - var(--convo-max)) / 2));
  padding-bottom: max(var(--space-xs), env(safe-area-inset-bottom));
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--chrome-border);
}
/* The field wraps the textarea + the mic, which floats inside on the right (iOS-style). */
.chat__field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}
.chat__input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 7.5rem;
  padding: 0.5rem 2.7rem 0.5rem 0.9rem; /* right padding leaves room for the mic */
  border: 0.5px solid var(--field-border);
  border-radius: var(--radius-lg);
  background: var(--field);
  color: var(--label);
  font: inherit;
  line-height: 1.35;
  resize: none;
  transition: border-color var(--dur-short) var(--ease-out);
}
.chat__input::placeholder { color: var(--label-3); }
.chat__input:focus-visible { outline: none; border-color: var(--tint); }
.chat__send {
  flex: none;
  width: 40px; height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
}
.chat__send svg { display: block; }
.chat__send[disabled] {
  background: var(--label-3);
  cursor: not-allowed;
  transform: none;
}
.chat__mic {
  position: absolute;
  right: 5px;
  bottom: 3px;              /* sits at the bottom-right, aligned with a growing textarea */
  flex: none;
  width: 34px; height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--tint);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform var(--dur-micro) var(--ease-pop), background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.chat__mic:hover { background: color-mix(in srgb, var(--tint) 12%, transparent); }
.chat__mic:active { transform: scale(0.9); }
.chat__mic svg { display: block; }
.chat__mic.is-recording {
  background: var(--danger);
  color: #fff;
  animation: mic-pulse 1.2s ease infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 55%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 0%, transparent), 0 0 16px 2px color-mix(in srgb, var(--danger) 45%, transparent); }
}
.chat__mic[hidden] { display: none; }
/* No mic (speech unsupported) → reclaim the reserved right padding. */
.chat__field:has(.chat__mic[hidden]) .chat__input { padding-right: 0.9rem; }

/* Idle nudge — attention glow on the next action */
.glow { animation: nudge-glow 1.5s var(--ease-in-out, ease-in-out) infinite; }
@keyframes nudge-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tint) 65%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--tint) 0%, transparent), 0 0 18px 3px color-mix(in srgb, var(--tint) 60%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--tint) 45%, transparent); }
}

/* ---------- Info / Buy-now dialog ---------- */
.info {
  width: min(42rem, calc(100% - 2 * var(--page-gutter)));
  max-height: min(88dvh, 52rem);
  overflow-y: auto;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--page-gutter) var(--space-xl);
  background: var(--bg-elevated);
  color: var(--label);
  box-shadow: var(--shadow-2);
  overscroll-behavior: contain;
}
.info::backdrop { background: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.info[open] { animation: sheet-in var(--dur-long) var(--ease-spring); }
@keyframes sheet-in { from { opacity: 0; transform: scale(0.96) translateY(12px); } to { opacity: 1; transform: none; } }
.info__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-lg); }
.info h2 { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 var(--space-sm); }
.info h3 { font-size: var(--text-md); font-weight: 600; margin: var(--space-xl) 0 var(--space-md); }
.info__lede { color: var(--label-2); }
.info__lede strong { color: var(--label); }
.info__foot { margin-top: var(--space-xl); padding-top: var(--space-md); border-top: 0.5px solid var(--separator); font-size: var(--text-sm); color: var(--label-2); }
.info__foot a { color: var(--label-2); }

.buy { border: 0.5px solid var(--tint); border-radius: var(--radius-md); padding: var(--space-md); margin-bottom: var(--space-xl); background: color-mix(in srgb, var(--tint) 6%, var(--bg-elevated)); }
.buy__price { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.buy__sub { margin-top: var(--space-3xs); color: var(--label-2); font-size: var(--text-sm); }
.buy .btn { margin-top: var(--space-md); width: 100%; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-lg); }
.steps .stage { font-variant-numeric: tabular-nums; font-size: var(--text-sm); color: var(--tint); font-weight: 700; }
.steps h4 { font-size: var(--text-base); font-weight: 600; margin: var(--space-3xs) 0 var(--space-2xs); }
.steps p { color: var(--label-2); }

.spec { width: 100%; border-collapse: collapse; }
.spec tr { border-bottom: 0.5px solid var(--separator); }
.spec tr:first-child { border-top: 0.5px solid var(--separator); }
.spec th { text-align: left; font-weight: 400; padding: var(--space-sm) var(--space-md) var(--space-sm) 0; width: 62%; }
.spec td { text-align: right; color: var(--label-2); padding: var(--space-sm) 0; font-variant-numeric: tabular-nums; white-space: nowrap; }

.faq details { border-bottom: 0.5px solid var(--separator); }
.faq details:first-of-type { border-top: 0.5px solid var(--separator); }
.faq summary {
  padding: var(--space-sm) 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  min-height: 40px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--label-3); font-weight: 400; flex-shrink: 0; }
.faq details[open] summary::after { content: "−"; }
.faq .faq__body { padding: 0 0 var(--space-md); color: var(--label-2); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .typing i, .psi__dots i, .vnote.is-loading .vnote__icon { animation-iteration-count: infinite !important; animation-duration: 1.2s !important; }
}
