/* Buyer analytics demo page (analytics/index.html). Builds on landing.css. */

.ad-page { padding-top: 76px; }

/* ---------- Intro ---------- */
.ad-intro { padding-top: 40px; padding-bottom: 40px; }
.ad-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--muted); }
.ad-back:hover { color: var(--accent); }
.ad-intro-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 64px; margin-top: 16px; }
.ad-intro-copy { flex: 1 1 560px; min-width: 0; }
.ad-intro-copy .h2 { margin-top: 20px; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.04; letter-spacing: -0.03em; }
.ad-intro-row .lede { flex: 0 1 440px; }

/* ---------- App frame ---------- */
.app { overflow: hidden; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-grey); box-shadow: var(--shadow); }
.app-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; }
.app-crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.app-crumbs img { height: 20px; width: auto; margin-right: 4px; }
.app-crumbs strong { color: var(--ink); font-weight: 500; }
.app-crumbs .sep { color: var(--line-2); }
.app-meta { display: flex; align-items: center; gap: 10px; }
.app-range { color: var(--muted); }
.app-badge { border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 8px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.kpi { background: #fff; padding: 18px 22px; }
.kpi strong { display: block; font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.kpi span { font-size: 13px; color: var(--muted); }

.app-body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; padding: 20px; }
.app-main { flex: 1.6 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.app-side { flex: 1 1 340px; min-width: 0; align-self: stretch; }

.card { border-radius: 12px; background: #fff; border: 1px solid var(--line); padding: 22px 24px 24px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.card-head h2 { font-size: 18px; font-weight: 500; }
.card-head p { margin-top: 2px; font-size: 13px; color: var(--muted); }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-reg { background: var(--gold); }
.dot-anon { background: #cfcac3; }

/* ---------- Heatmap ---------- */
/* Six shading bands, as in the app; text colours keep 4.5:1 on each */
.b0 { background: #f1efec; color: var(--muted); box-shadow: inset 0 0 0 1px #e2ded8; }
.b1 { background: rgba(28, 27, 25, 0.14); color: #2e2b28; }
.b2 { background: rgba(28, 27, 25, 0.3); color: var(--ink); }
.b3 { background: rgba(28, 27, 25, 0.48); color: var(--ink); }
.b4 { background: rgba(28, 27, 25, 0.68); color: #fff; }
.b5 { background: rgba(28, 27, 25, 0.86); color: #fff; }

.heatmap { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.hm-row { display: flex; align-items: center; gap: 16px; }
.hm-level { flex: none; width: 64px; font-size: 13px; color: var(--muted); }
.hm-lots { display: flex; flex-wrap: wrap; gap: 8px; }
.lot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.lot:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(28, 27, 25, 0.16); }
.lot.is-selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.lot-no { font-size: 14px; font-weight: 600; line-height: 1.1; }

/* ---------- Intent scatter ---------- */
.scatter { margin-top: 12px; }
.scatter svg { display: block; width: 100%; height: auto; overflow: visible; }
.sc-grid { stroke: #ebe7e1; stroke-width: 1; }
.sc-tick, .sc-axis { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.sc-dot { cursor: pointer; stroke: #fff; stroke-width: 1.5; transition: r .15s; }
.sc-dot.reg { fill: var(--gold); }
.sc-dot.anon { fill: #cfcac3; }
.sc-dot:hover { stroke: var(--ink); }
.sc-dot:focus { outline: none; }
.sc-dot:focus-visible { stroke: var(--accent); stroke-width: 3; }
.sc-dot.is-selected { fill: var(--ink); stroke: #fff; stroke-width: 2; }

/* ---------- Side panel ---------- */
.panel { position: sticky; top: 96px; scroll-margin-top: 84px; border-radius: 12px; background: #fff; border: 1px solid var(--line); padding: 24px; }
.pn-kicker { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pn-head h3 { margin-top: 4px; font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.band-pill { display: inline-block; margin-top: 10px; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 500; }
.band-pill.b0 { box-shadow: inset 0 0 0 1px #e2ded8; }

.pn-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pn-stats div { padding: 12px 0; }
.pn-stats div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.pn-stats strong { display: block; font-size: 22px; font-weight: 500; line-height: 1.2; }
.pn-stats span { font-size: 12px; color: var(--muted); }

.pn-label { margin: 22px 0 10px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pn-empty, .pn-hint { margin-top: 16px; font-size: 13px; color: var(--muted); }
.pn-anon { margin-top: 8px; border-radius: 8px; padding: 10px 12px; border: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); }

.buyer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.buyer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.buyer-row:hover { border-color: #cfc9c0; background: #faf9f7; }
.buyer-row > svg { flex: none; color: var(--faint); }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.avatar.anon { background: #e4e0da; color: var(--ink-2); }
.buyer-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.buyer-id strong { font-size: 14px; font-weight: 500; }
.buyer-id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.buyer-visits { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.buyer-visits strong { font-size: 13px; font-weight: 500; color: var(--ink); }

.pn-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.pn-back:hover { color: var(--accent); }
.pn-person { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.pn-person h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.pn-person p { font-size: 13px; color: var(--muted); }

.intent { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 13px; color: var(--muted); }
.meter { flex: 1; height: 8px; overflow: hidden; border-radius: 999px; background: #ebe7e1; }
.meter i { display: block; height: 100%; background: var(--accent); }
.intent strong { color: var(--ink); font-weight: 500; }

.lot-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lot-bars li { display: grid; grid-template-columns: 76px minmax(0, 1fr) 28px; align-items: center; gap: 10px; }
.lot-bars button { min-height: 32px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; text-align: left; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; cursor: pointer; }
.lot-bars button:hover { color: var(--accent); text-decoration-color: currentColor; }
.bar { height: 8px; overflow: hidden; border-radius: 999px; background: #ebe7e1; }
.bar i { display: block; height: 100%; background: var(--ink); }
.bar-n { font-size: 13px; text-align: right; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #f1efec; color: var(--ink-2); }
.tl-ic.favourite { background: #f4ecdb; color: var(--accent); }
.timeline p { font-size: 14px; }
.timeline strong { font-weight: 500; }
.timeline time { font-size: 12px; color: var(--muted); }

.ad-note { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* ---------- Below the demo ---------- */
.ad-points { padding-top: 72px; }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); column-gap: 32px; margin-top: 0; }
.ad-cta { margin-top: 96px; padding: 88px 0; background: var(--bg-grey-2); }
.ad-cta-inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; }
.ad-cta .lede { margin-top: 14px; max-width: 560px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .app-side { flex-basis: 100%; }
  .panel { position: static; }
}
/* Phones: the demo as three numbered steps (lot → who's looking → the buyer),
   without the app frame or the intent chart */
@media (max-width: 820px) {
  .ad-page { padding-top: 56px; }
  .ad-intro { padding-top: 4px; padding-bottom: 16px; }
  .ad-intro-row { gap: 8px; margin-top: 6px; }
  .ad-intro-copy .h2 { margin-top: 12px; font-size: 28px; line-height: 1.1; }
  .ad-intro-row .lede { font-size: 14px; }

  .app { overflow: visible; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .app-bar { display: none; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; background: none; border-top: 1px solid var(--line); }
  .kpi { padding: 10px 0; background: none; }
  .kpi + .kpi { padding-left: 12px; border-left: 1px solid var(--line); }
  .kpi:nth-child(3) { display: none; } /* registered buyers: step 2 shows them */
  .kpi strong { font-size: 20px; }
  .kpi span { font-size: 12px; }
  .app-body { padding: 16px 0 0; gap: 12px; }
  .app-main { gap: 12px; }

  .step-label { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 12px 14px; background: var(--bg-grey); border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 500; }
  .step-label .n { font-size: 13px; font-weight: 400; }
  .step-label .muted { margin-left: auto; font-size: 12px; font-weight: 400; }
  .step-attached { border: 1px solid var(--line-2); border-radius: 12px 12px 0 0; }
  .step-attached + .panel { border-top: 0; border-radius: 0 0 12px 12px; }
  .step-dark { background: var(--dark); border-color: var(--dark); color: #fff; }
  .step-dark .n { color: var(--gold-light); }
  .step-dark .muted { color: rgba(255, 255, 255, 0.72); }
  .focus-wrap { margin-top: 12px; }

  .card { overflow: hidden; padding: 0 12px 14px; border-color: var(--line-2); }
  .card-head { display: block; margin: 0 -12px 12px; }
  .panel { padding: 14px; }
  .pn-head h3 { font-size: 22px; }
  #panel .buyer-list li:nth-child(n+4), #focus .timeline li:nth-child(n+4) { display: none; }
  .pn-more { margin-top: 8px; font-size: 12px; color: var(--muted); }

  .heatmap { margin-top: 0; gap: 6px; }
  .hm-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px; }
  .hm-level { width: auto; font-size: 12px; }
  .hm-lots { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
  .lot { width: auto; height: 34px; }
  .lot-no { font-size: 12px; }

  .ad-crm { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
  .ad-crm svg { flex: none; margin-top: 2px; color: var(--accent); }
  .ad-crm strong { font-weight: 500; color: var(--ink); }
  .ad-note { margin-top: 8px; }
  .ad-cta { margin-top: 24px; padding: 32px 0; }
  .ad-cta-inner { gap: 16px; }
  .ad-cta .lede { margin-top: 8px; }
  .ad-cta .btn { width: 100%; }
}
