/* =========================================================================
   ANALYTICS PANELS: what is really the Heatmaps, VSL video and Ads tabs' own
   (features/analytics/heatmaps.js, video.js, ads.js, adViewer.js).
   Everything else on those tabs is the page's shared grammar: .stat-strip,
   .stat-band / .stat-section, .bar-list and .lsel (components.css), the line
   chart (.anc-*, views/analytics.css), .stat-table, .stat-note, .segmented,
   .tone-pill, emptyState / errorState and drawerShell with the lead drawer's
   .dw-* parts. This file holds the heatmap's page frame and its overlay, the
   VSL's player and drops list, the Ads table's thumbnail button and the ad viewer (its
   stage, caption, transcript and Meta's feed preview), and the Ask tab's chat.
   Linked right after analytics.css. Prefixes: anh- heatmaps, anv- video,
   ana- ads, anq- ask.
   ========================================================================= */

/* ---------- the tab's own select in the toolbar (Video, Ad account) ---------- */
/* the row is already full on the widest screens: the pick ellipses sooner than the shared 22ch (its title has it all) */
.an-scope-slot .lsel-v > span { max-width: 16ch; }
/* the same video on two pages: its page leads and never shrinks; the title after it is what ellipses */
.lsel .lsel-v > .anv-pick { display: inline-flex; align-items: baseline; gap: var(--space-1-5); max-width: none; overflow: visible; }
.anv-pick-page { flex: none; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; }   /* (only a path past any real one is cut) */
.anv-pick-sep { flex: none; color: var(--text-soft); }
.anv-pick-title { min-width: 0; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Heatmaps ---------- */
/* the heat ramp, cool to hot (heatmaps.js reads these six off .anh for the canvas; the semantic tokens carry
   their own dark twins, so the overlay brightens with the theme) */
.anh {
  --anh-heat-1: var(--info-600);
  --anh-heat-2: var(--avatar-7);
  --anh-heat-3: var(--success-600);
  --anh-heat-4: var(--brand-gold);
  --anh-heat-5: var(--warning-600);
  --anh-heat-6: var(--danger-600);
}
/* the band follows the strip straight away here: the strip's hairline is the only one */
.stat-strip + .anh-band { border-top: 0; }
/* the map's own switches share a row with its title */
.anh .stat-section-tools { gap: var(--space-2); }

/* the live page, framed like the Site Builder canvas: one faint hairline, scaled to the section */
.anh-page { position: relative; width: min(376px, 100%); margin: 0 auto; border: 1px solid var(--border-faint); border-radius: var(--radius-lg); overflow: hidden; }
.anh-page.is-desktop { width: min(760px, 100%); }
.anh-page:has(> .anh-scroll:focus-visible) { box-shadow: var(--ring-primary); }   /* (the frame clips the scroller's own ring) */
.anh-page-sk { display: block; margin: 0 auto; border-radius: var(--radius-lg); }
.anh-scroll { position: relative; height: min(720px, 72vh); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.anh-page.is-desktop .anh-scroll { height: min(640px, 70vh); }
.anh-scroll:focus-visible { outline: none; }
.anh-sheet { position: relative; margin: 0 auto; overflow: hidden; background: var(--surface-2); }
.anh-frame { position: absolute; top: 0; left: 0; display: block; border: 0; transform-origin: 0 0; pointer-events: none; background: transparent; }
.anh-loading { position: absolute; top: var(--space-10); left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.anh-dim { position: absolute; inset: 0; background: color-mix(in srgb, var(--overlay-media) 70%, transparent); pointer-events: none; }
.anh-canvas { position: absolute; top: 0; left: 0; pointer-events: none; }
.anh-marks { position: absolute; inset: 0; pointer-events: none; }

/* the map's own annotations over the dimmed page (theme-constant: white on ink, ink on white) */
.anh-fold, .anh-reach { position: absolute; left: var(--space-2); right: var(--space-2); display: flex; align-items: center; gap: var(--space-1-5); transform: translateY(-50%); }
.anh-fold > span, .anh-reach > span, .anh-spot { display: inline-flex; align-items: center; flex: none; border-radius: var(--radius-full); white-space: nowrap; font-variant-numeric: tabular-nums; }
.anh-fold > span { height: 20px; padding: 0 var(--space-2); background: var(--text-invert); color: var(--on-light); font-size: var(--text-2xs); font-weight: var(--fw-bold); }
.anh-fold::after { content: ""; flex: 1; border-top: 2px solid var(--text-invert); }
.anh-reach > span { height: 24px; padding: 0 var(--space-2); background: var(--on-light); color: var(--text-invert); font-size: var(--text-xs); font-weight: var(--fw-semibold); }
.anh-reach::after { content: ""; flex: 1; border-top: 1px dashed color-mix(in srgb, var(--text-invert) 80%, transparent); }
.anh-spot { position: absolute; justify-content: center; min-width: 22px; height: 22px; padding: 0 var(--space-1-5); background: var(--text-invert); color: var(--on-light); font-size: var(--text-xs); font-weight: var(--fw-bold); box-shadow: var(--shadow-md); }

/* Fewer [ramp] More, then the scroll hint (its own line when the section is narrow) */
.anh-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-1-5) var(--space-5); margin-top: var(--space-3); font-size: var(--text-xs); color: var(--text-soft); }
.anh-legend-key { display: inline-flex; align-items: center; gap: var(--space-2); }
.anh-ramp { width: 120px; height: 6px; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--anh-heat-1), var(--anh-heat-2), var(--anh-heat-3), var(--anh-heat-4), var(--anh-heat-5), var(--anh-heat-6)); }

/* Scroll depth: the shared line chart, shorter in the 340px side column (heatmaps.js DEPTH_H; its skeleton matches) */
.anh-depth-chart { --anc-h: 160px; }

/* the side column's notes: laid on the page like the sections above them, a faint hairline between */
.anh-notes > .stat-note { margin: 0; padding: var(--space-4) 0; border: 0; border-top: 1px solid var(--border-faint); border-radius: 0; background: none; box-shadow: none; }

/* ---------- VSL video ---------- */
/* Still watching: the video (360px) beside its retention curve; one column when the main column is narrow
   (the tablet rail and a phone), the player on top */
.anv-watch { display: grid; grid-template-columns: 360px minmax(0, 1fr); align-items: start; gap: var(--space-8); }
.anv-curve { min-width: 0; }
@container main-col (max-width: 860px) {
  .anv-watch { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .anv-player { max-width: 520px; }
}

/* the player: a 16:9 sunk well (a vertical video sits in it whole), one faint hairline drawn over its edge */
.anv-player { display: flex; flex-direction: column; gap: var(--space-2-5); min-width: 0; margin: 0; }
.anv-screen { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-sunk); }
.anv-screen::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--border-faint); pointer-events: none; }
.anv-screen-sk { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); }
.anv-video { display: block; width: 100%; height: 100%; object-fit: contain; }
.anv-video:focus-visible { outline: none; }
/* the play button covers the still; its disc is media chrome, theme-constant (white on a dark veil) */
.anv-play { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; padding: 0; border: 0; border-radius: inherit; background: none; cursor: pointer; }
.anv-play[hidden] { display: none; }
.anv-play:focus-visible { outline: none; }
.anv-disc { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius-full); background: var(--overlay-media); color: var(--text-invert); transition: background var(--dur) var(--ease), transform var(--dur) var(--ease); }
.anv-disc > svg { width: 22px; height: 22px; }
.anv-play .anv-disc > svg { margin-left: var(--space-0-5); }   /* the triangle's weight sits left of its box */
@media (hover: hover) and (pointer: fine) {
  .anv-play:hover .anv-disc, a.anv-embed:hover .anv-disc { background: var(--overlay-media-strong); transform: scale(1.06); }
  a.anv-embed:hover .anv-still-txt { text-decoration: underline; text-underline-offset: 3px; }
}
/* the well takes the focus ring (it clips its children's) */
.anv-screen:has(> .anv-play:focus-visible), .anv-screen:has(> .anv-video:focus-visible), .anv-screen:has(> .anv-embed:focus-visible) { box-shadow: var(--ring-primary); }

/* a still: an embedded player (Vimeo, YouTube) or a file that won't load; the poster under it when there is one */
.anv-still { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.anv-embed { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2-5); text-decoration: none; }
.anv-embed:focus-visible { outline: none; }
.anv-still-txt { display: inline-flex; align-items: center; gap: var(--space-1-5); font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.anv-still-txt > svg { width: 14px; height: 14px; flex: none; }
.anv-screen.is-dim .anv-still-txt > svg { width: 16px; height: 16px; color: var(--text-soft); }
.anv-screen.has-img .anv-still-txt { padding: var(--space-1) var(--space-2-5); border-radius: var(--radius-full); background: var(--overlay-media); color: var(--text-invert); }
.anv-screen.has-img .anv-still-txt > svg { color: currentColor; }
/* a file that won't load (or a src with nothing to play): its poster faded back, as the ad viewer's */
.anv-screen.is-dim > .anv-still { opacity: 0.35; }

/* the title and length under it */
.anv-cap { display: flex; flex-direction: column; gap: var(--space-0-5); min-width: 0; }
.anv-cap-title { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anv-cap-sub { font-size: var(--text-xs); color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* the biggest drops, under the retention curve: when (a jump in the player) · how many left · what to do */
.anv-drops { display: flex; flex-direction: column; margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.anv-drop { display: grid; grid-template-columns: 64px 72px minmax(0, 1fr); align-items: center; gap: var(--space-3); min-height: 40px; padding: var(--space-1) 0; border-top: 1px solid var(--border-faint); font-size: var(--text-sm); }
.anv-drop-at { display: inline-flex; align-items: center; gap: var(--space-1-5); justify-self: start; height: 28px; margin-left: calc(-1 * var(--space-2)); padding: 0 var(--space-2); border: 0; border-radius: var(--radius-sm); background: none; font: inherit; font-weight: var(--fw-medium); color: var(--text-soft); font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap; }
button.anv-drop-at, a.anv-drop-at { color: var(--text-strong); cursor: pointer; transition: background var(--dur) var(--ease); }
.anv-drop-at > svg { width: 10px; height: 10px; flex: none; color: var(--text-soft); }
a.anv-drop-at > svg { width: 12px; height: 12px; }
@media (hover: hover) and (pointer: fine) {
  button.anv-drop-at:hover, a.anv-drop-at:hover { background: var(--surface-hover); }
}
.anv-drop-at:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.anv-drop-lost { font-weight: var(--fw-medium); color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.anv-drop-what { min-width: 0; color: var(--text-muted); }

/* ---------- Ads ---------- */
/* (the table's insets are the page's own row-table rule, .an .stat-table--rows in analytics.css, shared with Leads)
   the Ad column takes what the numbers leave; its name ellipses before the status chips */
.ana-td-ad { width: 100%; max-width: 0; }
.ana-title { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.ana-title > .tone-pill { flex: none; }
/* the figures get room to breathe on a wide screen (the Ad column still takes the rest) */
@media (min-width: 1100px) { .ana-table th.num { width: 84px; } }

/* the creative, 4:5 like the feed, is the button that opens the viewer; a video shows a play glyph on hover
   and focus (always on touch). A naked format icon when Meta sent no image. */
.ana-thumb { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 50px; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--gray-100); color: var(--text-soft); cursor: pointer; }
.ana-thumb.is-sk { cursor: default; }
/* the ad a lead came from, in the lead journey (a picture, not a button) */
.ana-thumb.is-still { width: 28px; height: 28px; cursor: default; }
.ana-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ana-thumb > svg { width: 16px; height: 16px; }
.ana-thumb-play { position: absolute; inset: 0; display: grid; place-items: center; background: var(--overlay-media); color: var(--on-primary-static); opacity: 0; transition: opacity var(--dur) var(--ease); }
.ana-thumb-play svg { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) {
  .ana-thumb:hover .ana-thumb-play,
  .ana-table tbody tr:hover .ana-thumb-play { opacity: 1; }
}
@media (hover: none) { .ana-thumb-play { opacity: 1; background: color-mix(in srgb, var(--overlay-media) 40%, transparent); } }
.ana-thumb:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.ana-thumb:focus-visible .ana-thumb-play { opacity: 1; }

/* ---------- the ad viewer (adViewer.js) ---------- */
.drawer.ana-viewer { --dw-w: clamp(440px, 36vw, 560px); }
.ana-head-pills { display: inline-flex; align-items: center; gap: var(--space-1-5); }

/* the stage: the ad itself in a sunk well (its parts swap with [hidden], which their display rules would beat) */
.ana-media { display: flex; flex-direction: column; gap: var(--space-2); }
.ana-media > [hidden], .ana-stage-link[hidden] { display: none; }
.ana-stage { position: relative; display: flex; justify-content: center; align-items: center; min-height: 200px; border-radius: var(--radius-lg); background: var(--surface-sunk); overflow: hidden; }
.ana-video { display: block; width: 100%; height: auto; max-height: min(56vh, 560px); object-fit: contain; }
.ana-image { display: block; max-width: 100%; max-height: min(56vh, 560px); width: auto; height: auto; object-fit: contain; }
.ana-stage-sk { display: block; width: 100%; aspect-ratio: 4 / 5; max-height: 56vh; border-radius: var(--radius-lg); }
.ana-stage.is-dim > .ana-image { opacity: 0.35; }
.ana-stage-fill { display: block; width: 100%; aspect-ratio: 4 / 5; max-height: 40vh; }
.ana-stage-note { position: absolute; top: 50%; left: var(--space-4); right: var(--space-4); transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: var(--space-2-5); padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); font-size: var(--text-sm); color: var(--text-muted); text-align: center; }
.ana-stage-note .src-ico { width: 16px; height: 16px; }
.ana-stage-cap { margin: 0; font-size: var(--text-xs); color: var(--text-soft); text-align: center; }
.ana-stage-link { display: flex; justify-content: center; margin-top: calc(-1 * var(--space-4)); }
.ana-stage-link .btn { gap: var(--space-1-5); }
.ana-stage-link .src-ico { width: 16px; height: 16px; }

/* See it in the feed: the placement tabs (each with its app's mark), then Meta's preview, scaled to the drawer */
.ana-feed { display: flex; flex-direction: column; gap: var(--space-3); }
.ana-places button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1-5); }
.ana-places .src-ico { width: 15px; height: 15px; }
.ana-pv-stage { display: flex; flex: none; justify-content: center; min-height: 320px; }   /* (flex: none, or the drawer body squeezes it to its min-height under a tall preview) */
.ana-pv-stage > .stat-empty { width: 100%; margin: 0; }
.ana-pv-box { position: relative; overflow: hidden; border: 1px solid var(--border-faint); border-radius: var(--radius-lg); background: var(--logo-well); }
.ana-pv-spin { position: absolute; top: var(--space-10); left: 50%; margin-left: calc(-1 * var(--space-2)); }
.ana-pv-frame { position: relative; display: block; border: 0; transform-origin: 0 0; }   /* (after the spinner in the DOM, so it paints over it) */
.ana-pv-inline { display: inline-block; margin-right: var(--space-2); vertical-align: -3px; }

/* Caption: the primary text clamped to four lines, then the headline, the CTA and the link */
.ana-caption { margin: 0; white-space: pre-line; font-size: var(--text-md); color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.ana-caption.is-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ana-more { align-self: flex-start; margin-top: calc(-1 * var(--space-1-5)); padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); cursor: pointer; border-radius: var(--radius-xs); }
@media (hover: hover) and (pointer: fine) { .ana-more:hover { color: var(--text); text-decoration-color: currentColor; } }
.ana-more:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.ana-copy [data-ana-copy] { display: flex; flex-direction: column; gap: var(--space-3); }
.ana-headline { display: flex; flex-direction: column; gap: var(--space-0-5); }
.ana-headline b { font-weight: var(--fw-semibold); color: var(--text-strong); }
.ana-headline span { font-size: var(--text-sm); color: var(--text-soft); }
.ana-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--text-sm); }
.ana-link { display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; color: var(--text-muted); font-weight: var(--fw-medium); text-decoration: none; border-radius: var(--radius-xs); }
.ana-link > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-link svg, .ana-post svg { width: 14px; height: 14px; flex: none; color: var(--text-soft); }
@media (hover: hover) and (pointer: fine) { .ana-link:hover { color: var(--text-strong); text-decoration: underline; text-underline-offset: 3px; } }
.ana-link:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.ana-post { margin-left: auto; gap: var(--space-1-5); }
.ana-quiet { margin: 0; font-size: var(--text-sm); color: var(--text-soft); }
.ana-line-sk { display: block; height: 12px; margin: var(--space-1) 0; }

/* Transcript */
.ana-tx-head { display: flex; align-items: center; gap: var(--space-2); min-height: 24px; }
.ana-tx-meta { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--text-soft); }
.ana-tx-meta > svg { width: 13px; height: 13px; color: var(--success-600); }
.ana-tx-meta .icon-ghost { margin-left: var(--space-1); }
.ana-tx-go { align-self: flex-start; gap: var(--space-1-5); }
.ana-tx [data-ana-tx-body] { display: flex; flex-direction: column; align-items: stretch; }
.ana-tx-hint { margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--text-soft); }
.ana-tx-sk { display: flex; flex-direction: column; gap: var(--space-2-5); padding: var(--space-1) var(--space-2); }
.ana-tx-sk-row { display: grid; grid-template-columns: 3ch minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.ana-tx-sk-row .skel { display: block; height: 10px; }
.ana-tx-step { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--text-muted); }
.ana-tx-step > svg { width: 15px; height: 15px; flex: none; color: var(--text-soft); }
.ana-tx-step [data-ana-tx-step] { transition: opacity var(--dur-slow) var(--ease); }
.ana-tx-step [data-ana-tx-step].is-swapping { opacity: 0; }
.ana-tx-step + .ana-tx-go { margin-top: var(--space-3); }
.ana-tx-lines { display: flex; flex-direction: column; gap: var(--space-0-5); margin: 0 calc(-1 * var(--space-2)); padding: 0; list-style: none; }
.ana-tx-line { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--space-2); width: 100%; padding: var(--space-1-5) var(--space-2); border: 0; border-radius: var(--radius-sm); background: none; font: inherit; text-align: left; cursor: pointer; transition: background var(--dur) var(--ease); }
.ana-tx-at { padding-top: var(--space-0-5); font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-soft); font-variant-numeric: tabular-nums; }
.ana-tx-text { font-size: var(--text-md); color: var(--text); line-height: 1.5; }
@media (hover: hover) and (pointer: fine) { .ana-tx-line:hover { background: var(--surface-hover); } }
.ana-tx-line:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.ana-tx-line.is-now { background: var(--surface-hover); }
.ana-tx-line.is-now .ana-tx-at { color: var(--text-strong); }
.ana-tx-lines.is-revealing > li { animation: ana-tx-in var(--dur-slow) var(--ease-enter) both; animation-delay: calc(min(var(--i, 0), 15) * 30ms); }
@keyframes ana-tx-in { from { opacity: 0; transform: translateY(4px); } }
.ana-tx-fail { display: flex; gap: var(--space-2); align-items: flex-start; margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--text-muted); }
.ana-tx-fail svg { width: 16px; height: 16px; flex: none; margin-top: var(--space-0-5); color: var(--danger-600); }

@media (prefers-reduced-motion: reduce) {
  .ana-tx-lines.is-revealing > li { animation: none; }
  .ana-tx-step [data-ana-tx-step] { transition: none; }
  .ana-thumb-play, .ana-tx-line { transition: none; }
  .anv-disc, .anv-drop-at { transition: none; }
  .anv-play:hover .anv-disc, a.anv-embed:hover .anv-disc { transform: none; }
}

/* ---------- a narrow window ---------- */
@media (max-width: 640px) {
  /* the two map switches share a row at 390px */
  .anh .stat-section-head { flex-wrap: wrap; }
  .anh .stat-section-tools { margin-left: 0; }
  .anh .stat-section-tools .segmented button { padding: 0 var(--space-2-5); }
  /* the Ads head: Running ⌄ and the Ads Manager link stay on one line, the meta wraps under the title */
  .ana-ads .stat-section-tools { flex-wrap: nowrap; }
  .ana-ads .stat-section-head { align-items: flex-start; }
  .ana-video, .ana-image { max-height: 50vh; }
  .anv-drop { grid-template-columns: 60px 64px minmax(0, 1fr); gap: var(--space-2); min-height: 44px; }
  .anv-drop-at { height: 36px; }   /* a thumb-sized jump */
}


/* ---------- Ask (features/analytics/ask.js): the chat about the ads, pages and leads ----------
   After ChatGPT (Mobbin references, 2 Nov 2026): one centred column, the question in a grey bubble on the right, the
   answer as plain text in the page's type, the composer held to the bottom of the view (in the middle while the chat
   is empty, the examples under it). The answer's blocks: ad and page cards (a thumbnail, the name, a line of numbers),
   the side-by-side comparison (thumbnails on top, a row per measure, the best of each in bold), the Analytics line
   chart, tables. The reads fold into "Read N things" once it has answered; while it works, the running read shimmers.
   One border level (Attio): a card or a comparison has one hairline, rows inside it divide with --border-faint.
   Prefix anq-. */
/* (Ask fills the view: the box sits on the window's bottom edge, never above a blank strip under a short chat) */
.an:has(> .an-body > .an-pane > .anq) { display: flex; flex-direction: column; min-height: 100%; padding-bottom: var(--space-3); }
.an:has(> .an-body > .an-pane > .anq) > .an-body { flex: 1; display: flex; flex-direction: column; }
.an-pane:has(> .anq) { flex: 1; display: flex; flex-direction: column; }
.anq { display: flex; flex-direction: column; flex: 1; width: 100%; max-width: 768px; margin: 0 auto; padding-top: var(--space-6); }
.anq-thread { flex: 1; display: flex; flex-direction: column; gap: var(--space-8); padding-bottom: var(--space-6); }
.anq.is-empty { justify-content: center; }
.anq-hero-wrap[hidden], .anq-thread[hidden] { display: none; }
.anq.is-empty .anq-dock { display: none; }

/* empty: one question in the middle, the box under it, short pills under that (ChatGPT, WRITER: Mobbin) */
.anq-hero { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-5); width: 100%; max-width: 680px; margin: 0 auto; padding: var(--space-6) 0 var(--space-12); }
.anq-hero h3 { margin: 0; text-align: center; font-size: var(--text-xl); font-weight: var(--fw-semibold); letter-spacing: -0.02em; color: var(--text-strong); }
/* the mark: a trend line drawn in once, its last point in the magnet's gold, a small spark (naked strokes) */
.anq-mark { display: block; width: 44px; height: 44px; margin: 0 auto calc(-1 * var(--space-2)); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.anq-mark-base { stroke: var(--border-strong); stroke-width: 2; }
.anq-mark-line { stroke: var(--text-strong); stroke-width: 2.5; stroke-dasharray: 1; stroke-dashoffset: 0; animation: anq-draw 700ms var(--ease-enter, var(--ease)) both; }
.anq-mark-dot { fill: var(--brand-gold); stroke: var(--text-strong); stroke-width: 1.5; animation: anq-pop 260ms var(--ease) 600ms both; }
.anq-mark-spark { stroke: var(--brand-gold-deep); stroke-width: 2; animation: anq-pop 260ms var(--ease) 720ms both; }
@keyframes anq-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes anq-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
.anq-mark-dot, .anq-mark-spark { transform-box: fill-box; transform-origin: center; }
.anq-hero > .anq-note { justify-content: center; }
.anq-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.anq-pill { display: inline-flex; align-items: center; gap: var(--space-1-5); height: var(--control-sm); padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--text-muted); font: inherit; font-size: var(--text-sm); white-space: nowrap; cursor: pointer; }
.anq-pill svg { width: 14px; height: 14px; flex: none; color: var(--text-soft); }
@media (hover: hover) and (pointer: fine) { .anq-pill:hover { background: var(--surface-hover); color: var(--text-strong); } }
.anq-pill:active { box-shadow: var(--press-inset-ghost); }
.anq-follow { display: flex; flex-direction: column; }
.anq-try-q { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--control-md); padding: var(--space-1-5) var(--space-2); border: 0; border-top: 1px solid var(--border-faint); border-radius: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--text-sm); line-height: var(--leading-snug); text-align: left; cursor: pointer; }
.anq-try-q:first-of-type { border-top: 0; }
.anq-try-q svg { width: 14px; height: 14px; flex: none; color: var(--text-soft); }
@media (hover: hover) and (pointer: fine) { .anq-try-q:hover { background: var(--nav-hover-bg); border-radius: var(--radius-sm); } }
.anq-try-q:focus-visible { border-radius: var(--radius-sm); }

/* messages */
.anq-msg { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.anq-msg--user { align-items: flex-end; }
.anq-bubble { max-width: 75%; padding: var(--space-2-5) var(--space-4); border-radius: var(--radius-2xl); background: var(--surface-field); color: var(--text-strong); font-size: var(--text-md); line-height: var(--leading-normal); white-space: pre-wrap; overflow-wrap: anywhere; }

/* while it works: the reads as they run, the running one shimmering */
.anq-thinking { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-soft); }
.anq-spark { display: inline-flex; color: var(--text-soft); animation: anq-pulse 1.6s var(--ease) infinite; }
.anq-spark svg { width: 16px; height: 16px; }
.anq-shimmer { background: linear-gradient(90deg, var(--text-soft) 0%, var(--text-soft) 35%, var(--text-strong) 50%, var(--text-soft) 65%, var(--text-soft) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: anq-shimmer 1.8s linear infinite; }
@keyframes anq-shimmer { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@keyframes anq-pulse { 0%, 100% { opacity: 0.45; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1); } }
.anq-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1-5); }
.anq-step { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.anq-step.is-done { color: var(--text-soft); }
.anq-step-ico { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: none; }
.anq-step-ico .spinner { width: 12px; height: 12px; }
.anq-step-ico svg { width: 14px; height: 14px; }
.anq-read > summary { display: inline-flex; align-items: center; gap: var(--space-1); list-style: none; padding: var(--space-0-5) var(--space-1-5) var(--space-0-5) var(--space-1); margin-left: calc(-1 * var(--space-1)); border-radius: var(--radius-sm); font-size: var(--text-xs); color: var(--text-soft); cursor: pointer; }
.anq-read > summary::-webkit-details-marker { display: none; }
.anq-read > summary svg { width: 12px; height: 12px; transition: transform var(--dur) var(--ease); }
.anq-read[open] > summary svg { transform: rotate(90deg); }
.anq-read > .anq-steps { margin: var(--space-1-5) 0 var(--space-1); }
@media (hover: hover) and (pointer: fine) { .anq-read > summary:hover { background: var(--nav-hover-bg); color: var(--text-muted); } }

/* the answer: the page's type with a reader's air (ChatGPT's 16/1.7, a size down for this app) */
.anq-answer { font-size: var(--text-base); line-height: 1.7; color: var(--text-strong); overflow-wrap: anywhere; }
.anq-answer > * { margin: 0; }
.anq-answer > * + * { margin-top: var(--space-3-5); }
.anq-answer h4 { margin-top: var(--space-6); font-size: var(--text-base); font-weight: var(--fw-semibold); line-height: var(--leading-snug); }
.anq-answer > h4:first-child { margin-top: 0; }
.anq-answer > h4 + * { margin-top: var(--space-2); }
.anq-answer ul, .anq-answer ol { padding-left: var(--space-5); }
.anq-answer ul { list-style: disc; }
.anq-answer ol { list-style: decimal; }
.anq-answer li { padding-left: var(--space-1); }
.anq-answer li::marker { color: var(--text-soft); }
.anq-answer li + li { margin-top: var(--space-1-5); }
.anq-answer strong { font-weight: var(--fw-semibold); }
.anq-answer code { padding: 0 var(--space-1); border-radius: var(--radius-xs); background: var(--surface-field); font-size: 0.9em; }
.anq-answer hr { height: 0; margin: var(--space-6) 0; border: 0; border-top: 1px solid var(--border-faint); }

/* a markdown table: a header line, faint rows, figures to the right only when the whole column is figures */
.anq-table { overflow-x: auto; }
.anq-table table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: var(--leading-snug); }
.anq-table th { text-align: left; padding: var(--space-2) var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--border); font-weight: var(--fw-semibold); color: var(--text-strong); white-space: nowrap; vertical-align: bottom; }
.anq-table td { padding: var(--space-2-5) var(--space-4) var(--space-2-5) 0; border-bottom: 1px solid var(--border-faint); vertical-align: top; color: var(--text); }
.anq-table tr:last-child td { border-bottom: 0; }
.anq-table th:last-child, .anq-table td:last-child { padding-right: 0; }
.anq-table .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* a page named in the words (/new-offer): a quiet badge; hovered or focused, the live page peeks above it */
.anq-path { display: inline-flex; align-items: center; gap: var(--space-1); height: 22px; padding: 0 var(--space-1-5) 0 var(--space-1); margin: 0 1px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface-field); color: var(--text-strong); font: inherit; font-size: 0.86em; font-weight: var(--fw-medium); line-height: 1; white-space: nowrap; vertical-align: 1px; cursor: pointer; }
.anq-path svg { width: 12px; height: 12px; flex: none; color: var(--text-soft); }
@media (hover: hover) and (pointer: fine) { .anq-path:hover { background: var(--surface-hover); border-color: var(--border-strong); } }
.anq-path:active { box-shadow: var(--press-inset-ghost); }
.anq-peek { position: fixed; z-index: var(--z-popover); width: 322px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(4px); pointer-events: none; transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility 0s linear var(--dur-fast); }
.anq-peek.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.anq-peek-frame { position: relative; width: 320px; height: 200px; overflow: hidden; background: var(--surface-sunk); }
.anq-peek-sk { position: absolute; inset: 0; border-radius: 0; }
.anq-peek-page { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform: scale(var(--anq-peek-scale, 0.25)); transform-origin: 0 0; opacity: 0; transition: opacity var(--dur) var(--ease); }
.anq-peek-page.is-in { opacity: 1; }
.anq-peek-cap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border-faint); font-size: var(--text-xs); color: var(--text-muted); }
.anq-peek-cap > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anq-peek-hint { flex: none; color: var(--text-soft); }

/* cards: an ad (its thumbnail, a play mark on a video) or a page; a click opens it here */
.anq-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-2); }
.anq-ad, .anq-page { display: flex; align-items: center; gap: var(--space-3); min-width: 0; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
/* (an ad card's thumbnail runs edge to edge: flush to its top, bottom and left, in the card's own corners) */
.anq-ad { width: 100%; align-items: stretch; padding: 0 var(--space-3) 0 0; overflow: hidden; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.anq-ad > .anq-thumb { width: 76px; height: auto; min-height: 68px; align-self: stretch; border-radius: 0; }
.anq-ad > .anq-ad-text { justify-content: center; padding: var(--space-2-5) 0; }
.anq-ad > .anq-ad-go { align-self: center; }
.anq-page { padding: var(--space-1) var(--space-1) var(--space-1) 0; }
.anq-page-main { display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0; padding: var(--space-1) var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .anq-ad:hover { background: var(--surface-hover); } .anq-page-main:hover { background: var(--nav-hover-bg); } }
.anq-ad:active, .anq-page-main:active { box-shadow: var(--press-inset-ghost); }
.anq-thumb { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; flex: none; overflow: hidden; border-radius: var(--radius-md); background: var(--surface-sunk); color: var(--text-soft); }
.anq-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.anq-thumb-ico { display: none; }
.anq-thumb.is-empty .anq-thumb-ico { display: inline-flex; }
.anq-thumb-ico svg { width: 18px; height: 18px; }
.anq-thumb-play { position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--radius-full); background: var(--overlay-media); color: var(--on-primary-static); }
.anq-thumb.is-empty .anq-thumb-play { display: none; }
.anq-thumb-play svg { width: 12px; height: 12px; margin-left: 1px; }
.anq-thumb--lg { width: 100%; height: auto; aspect-ratio: 4 / 5; max-height: 168px; border-radius: var(--radius-lg); }
.anq-thumb--lg .anq-thumb-play { width: 32px; height: 32px; }
.anq-thumb--lg .anq-thumb-play svg { width: 14px; height: 14px; }
.anq-ad-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.anq-ad-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.anq-ad-sub, .anq-ad-stats { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); color: var(--text-soft); }
.anq-ad-stats { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.anq-ad-go { display: inline-flex; flex: none; color: var(--text-soft); }
.anq-ad-go svg { width: 14px; height: 14px; }
.anq-page-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; color: var(--text-soft); }
.anq-page-ico svg { width: 16px; height: 16px; }
.anq-page-go { display: inline-flex; align-items: center; gap: var(--space-0-5); flex: none; font-size: var(--text-xs); color: var(--text-soft); }
.anq-page-go svg { width: 12px; height: 12px; }
.anq-page > .icon-ghost { flex: none; }

/* the comparison: thumbnails on top, a row per measure, the best of each row in bold */
.anq-cmp { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.anq-cmp-scroll { overflow-x: auto; }
.anq-cmp table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--text-sm); line-height: var(--leading-snug); }
.anq-cmp th, .anq-cmp td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-faint); text-align: left; vertical-align: middle; }
.anq-cmp thead th { padding: var(--space-3); vertical-align: top; }
.anq-cmp th.anq-cmp-k { width: 32%; }
.anq-cmp tbody th { font-weight: var(--fw-regular); color: var(--text-muted); }
.anq-cmp tbody td { font-variant-numeric: tabular-nums; color: var(--text); }
.anq-cmp tbody td.is-best { font-weight: var(--fw-semibold); color: var(--text-strong); }
.anq-cmp tbody tr:last-child th, .anq-cmp tbody tr:last-child td { border-bottom: 0; }
.anq-cmp-head { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-1-5); width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.anq-cmp-head--page { flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--space-1); }
.anq-cmp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.anq-cmp-sub { font-size: var(--text-xs); font-weight: var(--fw-regular); color: var(--text-soft); }
@media (hover: hover) and (pointer: fine) { .anq-cmp-head:hover .anq-cmp-name { text-decoration: underline; text-underline-offset: 3px; } }
.anq-cmp-head:focus-visible { border-radius: var(--radius-sm); }
.anq-cmp-note { margin: 0; padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border-faint); font-size: var(--text-xs); color: var(--text-soft); }

/* a chart: the Analytics line chart under its title */
.anq-chart { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.anq-chart figcaption { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.anq-chart-plot + .anq-chart-plot { margin-top: var(--space-3); }

/* under the answer: Copy, the ads it named, the questions to ask next */
.anq-acts { display: flex; gap: var(--space-0-5); margin-left: calc(-1 * var(--space-1-5)); }
.anq-named { display: flex; flex-direction: column; gap: var(--space-1-5); }
.anq-named-k { font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-soft); }
.anq-follow { margin-top: calc(-1 * var(--space-1)); }

.anq-note { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
.anq-note.is-error { color: var(--danger-700); }

/* the composer: a raised well held to the bottom of the view, the period under the words */
.anq-dock { position: sticky; bottom: 0; z-index: var(--z-sticky); padding-bottom: var(--space-2); background: linear-gradient(to bottom, transparent, var(--surface) var(--space-4)); }
.anq-compose { margin: 0; padding: var(--space-2-5) var(--space-2-5) var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-2xl); background: var(--surface); box-shadow: var(--shadow-sm); transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.anq-compose:focus-within { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.anq-input { display: block; width: 100%; min-height: 26px; max-height: 200px; padding: var(--space-1) 0; border: 0; outline: none; resize: none; background: transparent; color: var(--text-strong); font: inherit; font-size: var(--text-base); line-height: var(--leading-normal); }
.anq-input::placeholder { color: var(--text-placeholder); }
.anq-bar { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
/* the period, a quiet chip in the box: its menu opens where it is (up from the box held at the bottom) */
.anq-period-dd { min-width: 0; }
.anq-dock .anq-period-dd > .filter-menu { top: auto; bottom: calc(100% + 6px); }
.anq-period { display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; height: 26px; padding: 0 var(--space-2); margin-left: calc(-1 * var(--space-0-5)); border: 1px solid var(--border-faint); border-radius: var(--radius-full); background: transparent; color: var(--text-muted); font: inherit; font-size: var(--text-xs); white-space: nowrap; cursor: pointer; }
.anq-period svg { width: 12px; height: 12px; flex: none; color: var(--text-soft); }
.anq-period span { overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine) { .anq-period:hover { background: var(--nav-hover-bg); color: var(--text-strong); } }
.anq-bar-gap { flex: 1; }
.anq-send { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border: 0; border-radius: var(--radius-full); background: var(--btn-primary-bg); color: var(--btn-primary-fg); box-shadow: var(--btn-primary-shadow); cursor: pointer; }
.anq-send svg { width: 16px; height: 16px; }
.anq-send:disabled { background: var(--surface-field); color: var(--text-placeholder); box-shadow: none; cursor: default; }
.anq-send:active:not(:disabled) { box-shadow: var(--btn-primary-press); }
.anq-send.is-stop { background: var(--surface-field); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--border); }

@media (prefers-reduced-motion: reduce) {
  .anq-read > summary svg, .anq-compose { transition: none; }
  .anq-shimmer { animation: none; background: none; color: var(--text-soft); }
  .anq-spark { animation: none; opacity: 1; transform: none; }
  .anq-peek, .anq-peek-page { transition: none; }
  .anq-mark-line, .anq-mark-dot, .anq-mark-spark { animation: none; }
}
@media (max-width: 640px) {
  .anq { padding-top: var(--space-4); }
  .anq-hero { gap: var(--space-4); padding-bottom: var(--space-6); }
  .anq-hero h3 { font-size: var(--text-lg); }
  .anq-pill { height: 30px; padding: 0 var(--space-2-5); }
  .anq-bubble { max-width: 88%; }
  .anq-answer { font-size: var(--text-md); }
  .anq-cards { grid-template-columns: minmax(0, 1fr); }
  .anq-cmp th.anq-cmp-k { width: 30%; }
  .anq-cmp table { min-width: 460px; }
  /* the view's bottom padding (the floating nav's room) sits under the composer: the answer never shows through it */
  .anq-dock::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: var(--space-6); background: var(--surface); }
}
