/* ===== Analytics page — the few pieces the shared stylesheet does not already have.
   Everything below is built from the tokens in styles.css (:root); no new colours,
   no new radii, no new easing. Same pattern as use-cases/use-case.css. ===== */

/* ---------- the answer card in the hero ---------- */
.an-answer{width:var(--composer-w);max-width:100%;margin-top:28px;padding:0;overflow:hidden;text-align:left}
.an-answer-head{display:flex;align-items:center;gap:10px;padding:14px 20px;border-bottom:1px solid var(--gray-100)}
.an-answer-who{font-size:13px;font-weight:600;color:var(--ink-600);flex:1}
.an-flag{font-family:var(--mono);font-size:11px;color:var(--ink-600);background:var(--gray-100);padding:4px 8px;border-radius:var(--r-pill)}
.an-thread{padding:20px;display:flex;flex-direction:column;gap:16px}
.an-q{align-self:flex-end;max-width:440px;background:var(--peach);color:var(--ink);font-size:15px;line-height:23px;padding:11px 15px;border-radius:16px 16px 4px 16px}
.an-a{display:flex;flex-direction:column;gap:12px}
.an-a-lead{font-size:15px;line-height:24px;color:var(--ink)}
.an-rows{display:flex;flex-direction:column;gap:9px}
.an-row{display:flex;align-items:center;gap:12px;font-size:14px}
.an-row-name{flex:1;color:var(--ink-600)}
.an-bar{width:150px;height:8px;border-radius:var(--r-pill);background:var(--gray-100);overflow:hidden;flex:none}
.an-bar i{display:block;height:8px;border-radius:var(--r-pill);background:var(--orange)}
.an-row-val{font-family:var(--mono);font-weight:500;width:72px;text-align:right}
.an-follow{display:flex;flex-wrap:wrap;gap:8px}
.an-follow button{font:inherit;font-size:13px;color:var(--ink-600);background:transparent;border:1px solid var(--gray-300);border-radius:var(--r-pill);padding:11px 16px;cursor:pointer;min-height:44px}
.an-follow button:hover{border-color:var(--ink-400);color:var(--ink)}

/* ---------- the three real campaign examples ----------
   Each card shows the popup as the agent produced it, on the store page it was made for.
   `contain` rather than `cover`: the mockup is a whole screen, and cropping it would clip
   the popup's own edges. The grey ground is the same one the af-fig box sits on. */
.an-pop-shot-img{width:100%;height:auto;object-fit:contain;border-radius:10px;
  box-shadow:0 1px 2px rgba(16,24,40,.08),0 10px 24px -12px rgba(16,24,40,.35)}

/* ---------- "one click and it's live" ---------- */
.an-live-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:stretch;margin-top:40px}
.an-live-card{display:flex;flex-direction:column;gap:14px;justify-content:flex-start}

/* ---------- "after you say yes": the approval flow and the campaign overview ---------- */
.an-flow{display:flex;flex-direction:column;gap:8px;background:var(--paper);border-radius:14px;padding:10px}
.an-flow-row{display:flex;align-items:center;gap:12px;background:var(--white);border:1px solid var(--gray-200);
  border-radius:12px;padding:12px 14px;transition:border-color .3s var(--ease)}
.an-flow-ico{width:30px;height:30px;flex:none;border-radius:9px;background:var(--gray-100);color:var(--ink-600);
  display:inline-flex;align-items:center;justify-content:center}
.an-flow-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:14px;line-height:20px}
.an-flow-txt b{font-weight:600;color:var(--ink)}
.an-flow-txt span{font-size:13px;color:var(--ink-600);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.an-flow-btn{flex:none;font-size:13px;font-weight:600;color:var(--ink);background:var(--white);
  border:1px solid var(--gray-300);border-radius:var(--r-btn);padding:8px 14px;min-height:34px;display:inline-flex;align-items:center}
.an-flow-btn.is-primary{background:var(--orange);border-color:var(--orange);color:#fff}
.an-flow-done{flex:none;display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;
  color:var(--success-fg);background:var(--success-bg);border-radius:var(--r-pill);padding:7px 13px;min-height:34px}
.an-flow-dot{width:7px;height:7px;border-radius:var(--r-pill);background:currentColor}
/* the finished state is what ships; the script rewinds it and plays the approvals through */
.an-flow-btn{display:none}
.an-flow.is-anim .an-flow-row .an-flow-btn{display:inline-flex}
.an-flow.is-anim .an-flow-row .an-flow-done{display:none}
.an-flow.is-anim .an-flow-row.is-done .an-flow-btn{display:none}
.an-flow.is-anim .an-flow-row.is-done .an-flow-done{display:inline-flex;animation:an-rise .3s var(--ease) both}
.an-flow.is-anim .an-flow-row.is-done{border-color:#BBE7CC}

.an-dash{border:1px solid var(--gray-200);border-radius:14px;overflow:hidden;background:var(--white)}
.an-dash-top{display:flex;align-items:center;gap:12px;padding:14px 16px}
.an-dash-id{flex:1;min-width:0}
.an-dash-name{font-size:15px;font-weight:600;line-height:22px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.an-dash-dom{font-size:12px;color:var(--ink-600)}
.an-dash-active{flex:none;display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;
  color:var(--success-fg);background:var(--success-bg);border-radius:var(--r-pill);padding:5px 11px}
.an-dash-tabs{display:flex;gap:18px;padding:0 16px;border-bottom:1px solid var(--gray-200);font-size:13px;color:var(--ink-600)}
.an-dash-tabs span{padding:0 0 10px;position:relative}
.an-dash-tabs .is-on{color:var(--orange);font-weight:600}
.an-dash-tabs .is-on::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--orange);border-radius:2px}
.an-dash-panel{display:flex;gap:20px;padding:18px 16px;align-items:center}
.an-dash-uplift{flex:none;padding-right:20px;border-right:1px solid var(--gray-200)}
.an-dash-k{font-size:12px;color:var(--ink-600);line-height:18px}
.an-dash-v{font-size:30px;line-height:38px;font-weight:700;letter-spacing:-.02em;color:var(--success-fg);font-variant-numeric:tabular-nums}
.an-dash-sub{font-size:11px;line-height:16px;color:var(--ink-600);max-width:150px}
.an-dash-metrics{flex:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.an-dash-m{font-size:20px;line-height:28px;font-weight:700;font-variant-numeric:tabular-nums}
.an-dash-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 16px;
  border-top:1px solid var(--gray-100);background:var(--paper);font-size:12px;color:var(--ink-600)}

@media (max-width:1200px){
  .an-dash-panel{flex-direction:column;align-items:flex-start;gap:14px}
  .an-dash-uplift{border-right:0;padding-right:0}
  .an-dash-metrics{width:100%}
}
@media (max-width:640px){
  .an-flow-row{flex-wrap:wrap}
  .an-flow-txt{flex-basis:calc(100% - 42px)}
  .an-flow-btn,.an-flow-done{margin-left:42px}
  .an-dash-v{font-size:26px;line-height:34px}
}
@media (prefers-reduced-motion:reduce){
  .an-flow.is-anim .an-flow-row .an-flow-btn{display:none}
  .an-flow.is-anim .an-flow-row .an-flow-done{display:inline-flex;animation:none}
}

/* ---------- the reports: six tabs, one panel ----------
   The tags are real buttons over real tabpanels, so the report can be opened with a click
   or from the keyboard. Without JS the first panel is the one that shows. */
.an-reports{margin-top:40px;position:relative;z-index:1}
.an-rep-tabs{display:flex;flex-wrap:wrap;gap:8px}
.an-tag{font:inherit;font-size:14px;line-height:20px;color:var(--ink);background:var(--white);
  border:1px solid var(--gray-200);border-radius:var(--r-pill);padding:11px 16px;min-height:44px;cursor:pointer;
  transition:background .2s var(--ease),border-color .2s var(--ease),color .2s var(--ease)}
.an-tag:hover{border-color:var(--gray-300);background:#FAFAFA}
.an-tag.is-on{background:var(--ink);border-color:var(--ink);color:#fff}
.an-tag.is-on:hover{background:var(--ink)}

.an-rep-stage{margin-top:20px;background:var(--white);border:1px solid var(--gray-200);border-radius:var(--r-window);
  padding:24px 26px;box-shadow:var(--shadow)}
.an-rep-panel[hidden]{display:none}
.an-rep-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:16px}
.an-rep-title{font-size:19px;font-weight:700;letter-spacing:-.01em}
.an-rep-all{font-size:14px;font-weight:600;color:var(--orange)}
.an-rep-table{display:flex;flex-direction:column;gap:4px}
.an-rep-row{display:grid;grid-template-columns:minmax(0,1fr) 110px 110px;align-items:center;gap:12px;
  font-size:15px;line-height:22px;min-height:40px}
.an-rep-th{font-size:13px;color:var(--ink-600);min-height:32px;border-bottom:1px solid var(--gray-100);padding-bottom:6px}
.an-rep-label{position:relative;display:flex;align-items:center;min-width:0;height:36px;padding:0 12px}
.an-rep-label i{position:absolute;left:0;top:0;bottom:0;background:var(--orange-100);border-radius:8px;z-index:0}
.an-rep-row.is-top .an-rep-label i{background:var(--peach)}
.an-rep-th .an-rep-label{height:auto;padding:0}
.an-rep-label span{position:relative;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.an-rep-v{text-align:right;font-weight:600;font-variant-numeric:tabular-nums}
.an-rep-r{text-align:right;color:var(--ink-600);font-variant-numeric:tabular-nums}
.an-rep-th .an-rep-v,.an-rep-th .an-rep-r{font-weight:400}

.an-rep-split{margin-top:22px;padding-top:18px;border-top:1px solid var(--gray-100)}
.an-rep-split-t{font-size:15px;font-weight:600}
.an-rep-bar{display:flex;height:10px;border-radius:var(--r-pill);overflow:hidden;background:var(--peach);margin-top:12px}
.an-rep-bar i{display:block;height:10px;background:var(--orange)}
.an-rep-legend{display:flex;flex-wrap:wrap;gap:8px 28px;margin-top:10px;font-size:14px;color:var(--ink-600)}
.an-rep-legend span{display:inline-flex;align-items:center;gap:8px}
.an-rep-legend em{width:10px;height:10px;border-radius:3px;background:var(--peach);display:inline-block}
.an-rep-legend em.is-new{background:var(--orange)}

.an-rep-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;
  font-size:13px;color:var(--ink-600)}

@media (max-width:767px){
  .an-reports{margin-top:28px}
  .an-rep-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none;padding-bottom:4px}
  .an-rep-tabs::-webkit-scrollbar{display:none}
  .an-tag{white-space:nowrap}
  .an-rep-stage{padding:18px 16px}
  .an-rep-row{grid-template-columns:minmax(0,1fr) 72px 68px;gap:8px;font-size:14px}
  .an-rep-title{font-size:17px}
  .an-rep-foot{flex-direction:column;align-items:flex-start;gap:6px}
}

/* ---------- the reports section, two columns ----------
   Copy on the left, the tabs and the open report on the right. The panel is narrower here
   than a full-width block, so the table's number columns tighten with it. */
.an-rep-grid{display:grid;grid-template-columns:minmax(0,.74fr) minmax(0,1.26fr);gap:48px;align-items:center}
.an-rep-grid .sec-head{max-width:420px}
.an-rep-grid .an-reports{margin-top:0}
.an-rep-grid .an-rep-tabs{flex-wrap:nowrap}
.an-rep-grid .an-tag{padding:11px 14px;white-space:nowrap}
.an-rep-grid .an-rep-row{grid-template-columns:minmax(0,1fr) 84px 92px;gap:10px}
.an-rep-grid .an-rep-stage{padding:20px 22px}
.an-rep-grid .an-rep-title{font-size:17px}

@media (max-width:1023px){
  .an-rep-grid{grid-template-columns:minmax(0,1fr);gap:28px}
  .an-rep-grid .sec-head{max-width:640px}
  .an-rep-grid .an-rep-row{grid-template-columns:minmax(0,1fr) 110px 110px}
}
@media (max-width:767px){
  .an-rep-grid .an-rep-row{grid-template-columns:minmax(0,1fr) 72px 68px;gap:8px}
}

/* ---------- the quote, without the homepage's curtain ----------
   On the homepage .quote-sec is pulled up under the dark #dev band (margin-top:-100svh)
   and pinned inside a 300svh runway, so the band scrolling away is what uncovers it.
   This page has no dark band, so the pull-up would drag the quote over the section above
   it. Same end state as the stylesheet's own reduced-motion fallback: an ordinary
   section, every word already inked (main.js sees pinLength <= 0 and inks them all). */
.quote-sec{margin-top:0;padding:var(--section-gap) 0}
.quote-track{height:auto}
.quote-pin{position:static;height:auto;overflow:visible}

/* ---------- the hero, two columns ----------
   Copy on the left, the conversation on the right. The homepage centres its hero (#hero
   .wrap is a centred flex column in the base stylesheet), so this has to out-specify it. */
#hero .wrap.an-hero-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.08fr);gap:56px;
  align-items:center;text-align:left}
.an-hero-copy{display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.an-hero-copy h1{margin-top:0}
.an-hero-copy .hero-lead{max-width:520px;margin-top:20px}
.an-hero-cta{margin-top:32px;justify-content:flex-start}
.an-hero-copy .hero-note{margin-top:14px}
.an-hero-demo{min-width:0}
.an-hero-demo .an-chat{width:100%;margin-top:0}

@media (max-width:1023px){
  #hero .wrap.an-hero-grid{grid-template-columns:minmax(0,1fr);gap:40px}
  .an-hero-copy .hero-lead{max-width:640px}
}
@media (max-width:767px){
  #hero .wrap.an-hero-grid{gap:28px}
  .an-hero-cta{width:100%;flex-direction:column;align-items:stretch}
  .an-hero-cta .btn{width:100%}
}

/* ---------- the hero conversation ----------
   One card: the thread and the composer bar that feeds it. The composer is a picture of
   one, not an input — outside the admin there is no store to answer about. hero-chat.js
   adds `is-anim`, which is what hides the steps; without it (no JS, reduced motion) the
   finished conversation is simply there. The body keeps a fixed height while animating, so
   nothing under the hero can move as the thread fills. */
.an-chat{width:var(--composer-w);max-width:100%;margin-top:36px;padding:0;overflow:hidden;text-align:left}
.an-chat-head{display:flex;align-items:center;gap:10px;padding:14px 20px;border-bottom:1px solid var(--gray-100)}
.an-chat-body{position:relative;display:flex;flex-direction:column;justify-content:flex-end;padding:18px 20px 10px}
.an-chat.is-anim .an-chat-body{height:440px;overflow:hidden}
.an-chat-body::before{content:"";position:absolute;left:0;right:0;top:0;height:26px;z-index:2;pointer-events:none;
  background:linear-gradient(180deg,var(--white) 0,rgba(255,255,255,0) 100%)}
.an-chat .an-thread{padding:0;gap:14px}
.an-chat.is-anim .an-step{display:none}
.an-chat.is-anim .an-step.is-on{display:block;animation:an-rise .38s var(--ease) both}
@keyframes an-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.an-typing{display:none;align-items:center;gap:5px;padding:2px 0}
.an-chat.is-anim .an-typing.is-on{display:flex}
.an-typing i{width:7px;height:7px;border-radius:var(--r-pill);background:var(--orange);animation:an-dot 1.2s var(--ease) infinite}
.an-typing i:nth-child(2){animation-delay:.15s}
.an-typing i:nth-child(3){animation-delay:.3s}
@keyframes an-dot{0%,100%{opacity:.25}50%{opacity:1}}
.an-chat-bar{display:flex;align-items:center;gap:4px;border-top:1px solid var(--gray-100);padding:12px 14px 12px 20px;min-height:60px}
.an-chat-typed{flex:1;min-width:0;font-size:15px;line-height:24px;color:var(--ink);word-break:break-word}
.an-chat-bar .caret{margin-right:10px}
.an-chat-send{width:36px;height:36px;border-radius:var(--r-btn);background:var(--gray-300);display:inline-flex;align-items:center;justify-content:center;flex:none;transition:background 160ms ease}
.an-chat-send.is-armed{background:var(--orange)}

@media (max-width:767px){
  .an-chat{margin-top:28px}
  .an-chat.is-anim .an-chat-body{height:500px}
  .an-chat-body{padding:16px 16px 8px}
  .an-chat-bar{padding:10px 12px 10px 16px}
}

/* the bar rests with a placeholder; the caret only blinks while it is being typed into */
.an-chat-typed{color:var(--ink-400)}
.an-chat.is-typing .an-chat-typed{color:var(--ink)}
.an-chat .caret{display:none}
.an-chat.is-typing .caret{display:inline-block}

/* ---------- "Ask it anything": centred head + six little conversations ----------
   Each card is a still of the same chat the hero plays: the question asked, the agent
   about to answer. Three to a row, two rows. They are illustrations, not controls —
   there is nothing to click and nothing to type. */
.an-head-center{max-width:720px;margin-left:auto;margin-right:auto;text-align:center;align-items:center}
.an-asks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin-top:40px;position:relative;z-index:1}
.an-ask-card{padding:18px 20px;display:flex;flex-direction:column;gap:14px}
.an-ask-head{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--ink-600)}
.an-ask-mark{width:20px;height:20px;border-radius:6px}
.an-ask-q{align-self:flex-end;max-width:94%;background:var(--peach);color:var(--ink);font-size:15px;line-height:23px;
  padding:11px 15px;border-radius:16px 16px 4px 16px}
.an-ask-wait{display:flex;align-items:center;gap:9px;font-size:15px;line-height:22px;color:var(--ink-600)}
.an-ask-spin{width:15px;height:15px;flex:none;border-radius:50%;border:2px solid var(--gray-200);border-top-color:var(--orange);
  animation:sc-spin .9s linear infinite}

@media (max-width:1023px){
  .an-asks{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
}
@media (max-width:767px){
  .an-asks{grid-template-columns:minmax(0,1fr);gap:14px;margin-top:28px}
  .an-head-center{text-align:left;align-items:flex-start}
  .an-ask-q{font-size:14px;line-height:22px}
}
@media (prefers-reduced-motion:reduce){
  .an-ask-spin{animation:none}
}
