/* Comparison pages on Polar Night (page type T7), on top of the section library in
   /products/products.css and the tokens in /vendor/polar-tokens@<version>.css.
   One stylesheet for every page under /comparisons/: the on-page links, the
   "choose" cards, the comparison table, the use-case links, the data-flow
   diagram, the migration steps, the FAQ accordion, the customer quote band
   and the closing band.
   Tokens only, scoped to cmp- classes under .cmp-page. */

.cmp-page :is(section, details)[id] {
  scroll-margin-top: calc(var(--pn-nav-height) + var(--pn-space-6));
}
.cmp-page :where(p, li, th, td) {
  text-wrap: pretty;
}

/* Sections follow each other at one section's padding, not two */
.cmp-page .cmp-sec + .cmp-sec {
  padding-top: 0;
}

/* S1 hero: Display, centred over Polar sky, the short answer under the h1 */
.cmp-hero {
  padding-bottom: clamp(var(--pn-space-12), 6vw, var(--pn-space-24));
}
.cmp-hero .pn-in {
  gap: var(--pn-space-6);
}
.cmp-hero .pn-crumb {
  padding-top: 0;
}
.cmp-hero .pn-crumb ol {
  justify-content: center;
}
.cmp-hero .pn-sub {
  max-width: 40em;
}
.cmp-hero .pn-sub + .pn-sub {
  margin-top: calc(-1 * var(--pn-space-2));
}
.cmp-hero .pn-sub a {
  color: var(--pn-text-link);
}

/* On this page: the jump links from the Ecommerce Analytics page, a quiet row
   between two hairlines under the hero. Centred with the hero on wider screens,
   left-aligned on phones where the hero is. */
.cmp-toc ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 var(--pn-space-8);
  margin: 0;
  padding: var(--pn-space-2) 0;
  list-style: none;
  border-block: 1px solid var(--pn-border-hairline);
}
.cmp-toc li {
  display: flex;
}
.cmp-toc a {
  display: inline-flex;
  align-items: center;
  min-height: var(--pn-space-12);
  font: var(--pn-font-weight-medium) var(--pn-type-ui-size) / 1.4
    var(--pn-font-family-sans);
  color: var(--pn-text-body);
  text-decoration: none;
}
.cmp-toc a:hover {
  color: var(--pn-text-head);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.cmp-toc a:focus-visible {
  outline: 2px solid var(--pn-focus);
  outline-offset: 2px;
  border-radius: var(--pn-radius-xs);
}
@media (max-width: 639px) {
  .cmp-toc ul {
    justify-content: flex-start;
    gap: 0 var(--pn-space-6);
  }
}

/* Section heads and running text */
.cmp-sec .pn-head {
  margin-bottom: var(--pn-space-10);
}
.cmp-sec .pn-head > p {
  max-width: var(--pn-layout-measure-prose);
}
.cmp-sec :where(.pn-lede, .cmp-prose) a {
  color: var(--pn-text-link);
}
.cmp-prose {
  display: grid;
  gap: var(--pn-space-4);
  max-width: var(--pn-layout-measure-prose);
  font-size: var(--pn-type-prose-size);
  line-height: var(--pn-type-prose-line);
  color: var(--pn-text-body);
}
.cmp-prose + .cmp-pills {
  margin-top: var(--pn-space-6);
}

/* Ticked lists, in the "choose" cards and under a question */
.cmp-list {
  display: grid;
  gap: var(--pn-space-3);
  margin: var(--pn-space-2) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--pn-type-body-size);
  line-height: var(--pn-type-body-line);
  color: var(--pn-text-body);
}
.cmp-list li {
  position: relative;
  padding-left: var(--pn-space-8);
}
.cmp-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  width: var(--pn-icon-md);
  height: var(--pn-icon-md);
  background: var(--pn-text-head);
  -webkit-mask: var(--pn-glyph-ok) center / 70% no-repeat;
  mask: var(--pn-glyph-ok) center / 70% no-repeat;
}

/* S7 "when each is the better fit": two equal panels */
.cmp-fit .pn-card {
  gap: var(--pn-space-4);
}

/* S8 comparison table: the row headers stay in view while the table scrolls on phones */
.cmp-table:focus-visible {
  outline: var(--pn-focus-width) solid var(--pn-focus);
  outline-offset: var(--pn-focus-offset);
}
.cmp-table .pn-tbl {
  min-width: 680px;
}
.cmp-table .pn-tbl thead th {
  padding-block: var(--pn-space-5);
}
/* the library's last-row rule also clears the header row's rule; put it back */
.cmp-table .pn-tbl thead tr th {
  border-bottom: 1px solid var(--pn-border-strong);
}
.cmp-table .pn-tbl tbody th {
  width: 24%;
}
.cmp-table .pn-tbl td {
  width: 38%;
}
/* A fourth column, for a second product from the same vendor: even shares */
.cmp-table .pn-tbl:has(thead th:nth-child(4)) tbody th {
  width: 22%;
}
.cmp-table .pn-tbl:has(thead th:nth-child(4)) td {
  width: 26%;
}
.cmp-table .pn-tbl a {
  color: var(--pn-text-link);
}
/* The fixed first column paints over the wrapper's inset frame, so its cells
   redraw the frame's left, top and bottom edges in the same color. */
.cmp-table {
  --cmp-frame: var(--pn-color-ink-800);
  --cmp-edge: inset 1px 0 0 var(--cmp-frame);
}
.cmp-table :is(thead th:first-child, tbody th) {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--pn-surface-panel);
  box-shadow: var(--cmp-edge);
}
.cmp-table thead th:first-child {
  --cmp-edge: inset 1px 1px 0 var(--cmp-frame);
  border-top-left-radius: var(--pn-radius-xl);
}
.cmp-table tbody tr:last-child th {
  --cmp-edge: inset 1px -1px 0 var(--cmp-frame);
  border-bottom-left-radius: var(--pn-radius-xl);
}
@media (max-width: 639px) {
  .cmp-table .pn-tbl {
    min-width: 600px;
  }
  .cmp-table .pn-tbl:has(thead th:nth-child(4)) {
    min-width: 760px;
  }
  .cmp-table .pn-tbl tbody th,
  .cmp-table .pn-tbl:has(thead th:nth-child(4)) tbody th {
    width: 128px;
  }
  .cmp-table .pn-tbl:has(thead th:nth-child(4)) td {
    width: 28%;
  }
  .cmp-table .pn-tbl :is(th, td) {
    padding: var(--pn-space-4);
  }
  .cmp-table :is(thead th:first-child, tbody th) {
    box-shadow:
      var(--cmp-edge),
      1px 0 0 var(--pn-border-hairline);
  }
}

/* Use-case links: frosted chips */
.cmp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pn-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cmp-pills a {
  display: inline-flex;
  align-items: center;
  height: var(--pn-rail-item-height);
  padding: 0 var(--pn-space-4);
  border-radius: var(--pn-radius-pill);
  font: var(--pn-font-weight-medium) var(--pn-type-ui-size)/1
    var(--pn-font-family-sans);
  color: var(--pn-text-head);
  text-decoration: none;
  background: var(--pn-color-alpha-snow-10);
  box-shadow:
    inset 0 1px 0 var(--pn-color-alpha-white-16),
    inset 0 0 0 1px var(--pn-color-alpha-white-12);
  transition: background-color 0.18s var(--pn-easing-out);
}
.cmp-pills a:hover {
  background: var(--pn-color-alpha-snow-17);
}

/* S4 data-flow diagram: one row per product, laid out by its own width */
.cmp-flow {
  container-type: inline-size;
  display: grid;
  gap: var(--pn-space-4);
  margin: var(--pn-space-12) 0 0;
}
.cmp-flow-row {
  padding: var(--pn-space-5);
  border-radius: var(--pn-radius-2xl);
  background: var(--pn-surface-panel);
  box-shadow: inset 0 0 0 1px var(--pn-border-hairline);
}
.cmp-flow-label {
  margin: 0 0 var(--pn-space-4);
  font: var(--pn-font-weight-medium)
    var(--pn-type-label-size)/var(--pn-type-label-line)
    var(--pn-font-family-mono);
  letter-spacing: var(--pn-type-label-tracking);
  text-transform: uppercase;
  color: var(--pn-text-subtle);
}
.cmp-flow-steps {
  display: grid;
}
.cmp-node {
  position: relative;
  display: grid;
  align-content: center;
  margin: 0;
  padding: var(--pn-space-3) var(--pn-space-4);
  border-radius: var(--pn-radius-lg);
  background: var(--pn-color-ink-850);
  box-shadow: inset 0 0 0 1px var(--pn-color-ink-750);
  text-align: center;
  list-style: none;
}
.cmp-node p {
  margin: 0;
}
.cmp-node-title {
  font-size: var(--pn-type-ui-size);
  font-weight: var(--pn-font-weight-semibold);
  line-height: 1.35;
  color: var(--pn-text-head);
}
.cmp-node-sub {
  margin-top: var(--pn-space-1) !important;
  font-size: var(--pn-type-small-size);
  line-height: 1.4;
  color: var(--pn-text-subtle);
}
/* Lilac (mark) is Snowplow's color: only Snowplow's products carry it.
   The competitor's hub gets a light neutral outline at the same weight. */
.cmp-node-us {
  box-shadow: inset 0 0 0 var(--pn-diagram-highlight-width) var(--pn-mark);
}
.cmp-node-them {
  box-shadow: inset 0 0 0 var(--pn-diagram-highlight-width)
    var(--pn-color-ink-300);
}
/* A destination fed on a schedule, not as events arrive: the box stays solid
   and the connector into it is dashed. The selector outranks the connector
   rules in the container queries below. */
.cmp-flow .cmp-outputs li.cmp-node-sync::before,
.cmp-fork:has(+ .cmp-outputs > .cmp-node-sync:only-child)::before {
  border-style: dashed;
}
/* One output: the fork draws the whole connector, so a dashed one has even
   dashes from end to end, and the output draws none */
.cmp-outputs li:only-child::before {
  content: none;
}
/* A part of a product shown inside its box, such as Analysis Workspace in
   Adobe's cloud */
.cmp-node-part {
  margin-top: var(--pn-space-3);
  padding: var(--pn-space-2) var(--pn-space-3);
  background: var(--pn-color-ink-900);
  box-shadow: inset 0 0 0 1px var(--pn-color-ink-750);
}
.cmp-arrow,
.cmp-fork {
  position: relative;
  height: var(--pn-space-8);
}
/* Every side starts at width 0, so turning the line dashed draws no other side */
.cmp-arrow::before,
.cmp-fork::before {
  content: '';
  position: absolute;
  left: calc(50% - 1px);
  top: 0;
  bottom: 0;
  border: 0 solid var(--pn-diagram-connector);
  border-left-width: 2px;
}
.cmp-arrow::before {
  bottom: 7px;
}
.cmp-fork {
  height: 14px;
}
.cmp-arrow::after,
.cmp-outputs li::after {
  content: '';
  position: absolute;
  border: 6px solid transparent;
}
.cmp-arrow::after {
  left: calc(50% - 6px);
  bottom: -5px;
  border-top: 8px solid var(--pn-diagram-connector);
}
.cmp-outputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pn-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cmp-outputs li {
  margin-top: 20px;
}
.cmp-outputs li::before {
  content: '';
  position: absolute;
  top: -21.5px;
  width: calc(50% + 7.5px);
  height: 13px;
  border: 0 solid var(--pn-diagram-connector);
  border-top-width: 2px;
}
.cmp-outputs li:first-child::before {
  left: calc(50% - 1px);
  border-left: 2px solid var(--pn-diagram-connector);
}
.cmp-outputs li:last-child::before {
  right: calc(50% - 1px);
  border-right: 2px solid var(--pn-diagram-connector);
}
.cmp-outputs li::after {
  top: -10px;
  left: calc(50% - 6px);
  border-top: 8px solid var(--pn-diagram-connector);
}
@container (width < 720px) {
  .cmp-fork:has(+ .cmp-outputs > :nth-child(3))::before {
    content: none;
  }
  .cmp-outputs:has(> :nth-child(3)) {
    grid-template-columns: 1fr;
  }
  .cmp-outputs:has(> :nth-child(3)) li {
    margin: 0 0 0 40px;
  }
  .cmp-outputs:has(> :nth-child(3)) li::before {
    top: -7.5px;
    bottom: -7.5px;
    left: -21.5px;
    right: auto;
    width: 13px;
    height: auto;
    border: 0 solid var(--pn-diagram-connector);
    border-left-width: 2px;
    background: linear-gradient(var(--pn-diagram-connector) 0 0) 0 50% / 100%
      2px no-repeat;
  }
  .cmp-outputs:has(> :nth-child(3)) li:first-child::before {
    top: -15.5px;
    bottom: -15.5px;
  }
  .cmp-outputs:has(> :nth-child(3)) li:last-child::before {
    bottom: calc(50% - 1px);
    border-bottom-width: 2px;
    background: none;
  }
  .cmp-outputs:has(> :nth-child(3)) li::after {
    top: calc(50% - 6px);
    left: -10px;
    border: 6px solid transparent;
    border-left: 8px solid var(--pn-diagram-connector);
  }
  /* one output: a straight connector down into it. The fork's line runs on
     through the output's 20px top margin to 1.5px under the arrowhead, which
     starts 10px above the box: 20 - 10 + 1.5 = 11.5px */
  .cmp-outputs:has(> :only-child) {
    grid-template-columns: 1fr;
  }
  .cmp-fork:has(+ .cmp-outputs > :only-child)::before {
    bottom: -11.5px;
  }
}
@container (min-width: 720px) {
  .cmp-flow-row {
    padding: var(--pn-space-6) var(--pn-space-8) var(--pn-space-8);
  }
  .cmp-flow-steps {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1.15fr) 24px minmax(
        0,
        1.25fr
      );
    align-items: center;
  }
  .cmp-node {
    padding: var(--pn-space-4);
  }
  .cmp-arrow,
  .cmp-fork {
    height: 2px;
  }
  .cmp-arrow::before,
  .cmp-fork::before {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    border-left: 0;
    border-top: 2px solid var(--pn-diagram-connector);
  }
  .cmp-arrow::before {
    left: 6px;
    right: 12px;
  }
  .cmp-arrow::after {
    left: auto;
    right: 4px;
    top: -5px;
    bottom: auto;
    border: 6px solid transparent;
    border-left: 8px solid var(--pn-diagram-connector);
  }
  .cmp-outputs {
    grid-template-columns: 1fr;
  }
  .cmp-outputs li {
    margin: 0 0 0 20px;
  }
  .cmp-outputs li::before {
    top: auto;
    left: -21.5px;
    right: auto;
    width: 13px;
    height: calc(50% + 7.5px);
    border: 0 solid var(--pn-diagram-connector);
    border-left-width: 2px;
  }
  .cmp-outputs li:first-child::before {
    top: calc(50% - 1px);
    left: -21.5px;
    border-top-width: 2px;
  }
  .cmp-outputs li:last-child::before {
    bottom: calc(50% - 1px);
    right: auto;
    border-right: 0;
    border-bottom-width: 2px;
  }
  .cmp-outputs li::after {
    top: calc(50% - 6px);
    left: -10px;
    border: 6px solid transparent;
    border-left: 8px solid var(--pn-diagram-connector);
  }
  .cmp-outputs:has(> :nth-child(3)) {
    grid-auto-rows: 1fr;
  }
  .cmp-outputs li:not(:first-child, :last-child)::before {
    top: -7.5px;
    bottom: -7.5px;
    height: auto;
    background: linear-gradient(var(--pn-diagram-connector) 0 0) 0 50% / 100%
      2px no-repeat;
  }
  /* one output: a straight connector across into it, the same 11.5px past
     the fork's column as below 720px */
  .cmp-fork:has(+ .cmp-outputs > :only-child)::before {
    right: -11.5px;
  }
}

/* S16 FAQ: the questions not in the body, as the product pages' accordion */
.cmp-page .pn-qa summary > .cmp-qh {
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
.cmp-page .pn-qa .pn-ans a {
  color: var(--pn-text-link);
}
.cmp-page .pn-qa .pn-ans .cmp-list {
  margin-top: 0;
}
/* the four Signals points under the AI agents question */
.cmp-points {
  display: grid;
  gap: var(--pn-space-5) var(--pn-space-8);
  margin: var(--pn-space-2) 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .cmp-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.cmp-points li {
  display: grid;
  gap: var(--pn-space-1);
  align-content: start;
  padding-top: var(--pn-space-4);
  border-top: 1px solid var(--pn-border-hairline);
}
.cmp-points h4 {
  margin: 0;
  font-size: var(--pn-type-body-size);
  font-weight: var(--pn-font-weight-medium);
  line-height: 1.35;
  color: var(--pn-text-head);
}

/* S11 migration steps, the note and the guide link */
.cmp-steps {
  margin: var(--pn-space-12) 0 0;
  padding: 0;
}
.cmp-steps li {
  padding-bottom: var(--pn-space-6);
}
.cmp-note {
  max-width: var(--pn-layout-measure-prose);
  margin-top: var(--pn-space-8);
}
.cmp-sec .cmp-more {
  margin-top: var(--pn-space-8);
}

/* S9 quote band (.pn-sband): a customer quote and its attribution, with the
   story link under them. The Webflow stylesheet styles blockquote, p and
   figcaption on its own, so these rules clear its bar, padding, type and
   centring. */
.cmp-quote {
  display: grid;
  gap: var(--pn-space-4);
  margin: 0;
}
.cmp-quote blockquote {
  padding: 0;
  border: 0;
}
.cmp-quote blockquote p {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}
.cmp-quote figcaption {
  margin: 0;
  text-align: left;
  font-size: var(--pn-type-ui-size);
  color: var(--pn-color-ink-100);
}

/* S20 closing band */
.cmp-close .pn-h2 {
  max-width: 18em;
}
.cmp-close p.pn-line a {
  color: var(--pn-text-link);
}
