/* ==========================================================================
   Pyrexia site: the comparison page (/compare), classes cm-
   Loaded after site.css by the page's front matter (css: /css/pages-compare.css).
   Written 20 November 2026 with the page (ledger F20-14).

   The table speaks the ruled rows' language (.flow-spec, the article tables
   in pages-company-news.css): hairlines, no fills, no boxes. Each cell is a
   short status in words with a small glyph beside it (the word carries the
   meaning; the glyph is decoration), then one line of detail in ink.
   Narrow (below 75em) the table scrolls sideways inside its own box, which a
   keyboard can focus, with the row names held at the left; the page never
   scrolls sideways. Wide, the table fits the column, and the product names
   stay in view under the capsule while the rows pass.
   Second review (20 November 2026): each cell carries its product's name for
   a phone (data-p), the key is one line per status, the table fits from
   about 1180px, hyphenated words do not split, and while the product names
   are held under the capsule the strip above them is paper to the top of
   the window (the page's script sets .is-stuck).
   3 December 2026 (the founder): the page is the table, its key and one note,
   and Pyrexia's column is raised: a white card with a violet edge, from its
   name to its last row. "Coming soon" (early 2027) has a dashed ring.
   ========================================================================== */

/* The hint shows only while the table scrolls. Text, never a gesture icon. */
.cm-hint {
  margin-block-end: var(--sp-3);
  font-size: var(--fz-caption);
  line-height: 1.45;
  color: var(--fg-2);
}

.cm-scroll {
  container-type: inline-size;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.cm-scroll:focus-visible { outline: 2px solid var(--mark); outline-offset: 4px; border-radius: 4px; }

.cm-table {
  width: 100%;
  min-width: 63rem;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: var(--fz-small);
  line-height: 1.45;
  letter-spacing: 0;
}
.cm-table caption {
  position: sticky;
  inset-inline-start: 0;
  max-width: min(100cqi, 52rem);
  padding-block-end: 1rem;
  caption-side: top;
  font-size: var(--fz-caption);
  font-weight: 500;
  line-height: 1.45;
  text-align: start;
  color: var(--fg-2);
}
.cm-table :is(th, td) {
  padding: 1rem 1.25rem 1.05rem 0;
  border-block-end: 1px solid var(--hair);
  text-align: start;
  vertical-align: top;
  overflow-wrap: break-word;
}
.cm-table :is(th, td):last-child { padding-inline-end: 0; }
/* Column widths: the competitors' cells are a few words each (3 December 2026), so their columns are
   narrow and Pyrexia's card is wider. The sum (63rem) is the table's min-width, so from about 1040px
   the table fits without scrolling. */
.cm-table thead th { width: 12rem; }
.cm-table thead th:first-child { width: 9.5rem; }
.cm-table thead th.cm-us { width: 13.5rem; }   /* the card is wider: it has padding on both sides and says more */
.cm-table thead th:not(:first-child):not(.cm-us) { width: 10rem; }

.cm-table thead th {
  padding-block: 0.85rem;
  border-block-start: 1px solid var(--hair);
  font-size: var(--fz-small);
  font-weight: 700;
  line-height: 1.3;
  color: var(--fg);
  vertical-align: bottom;
  background: var(--c-paper);
}
.cm-table thead th.cm-corner { font-weight: 500; color: var(--fg-2); }
/* Pyrexia's column, raised (the founder, 3 December 2026: "elevate Pyrexia in that table with a border
   or something else"): one white card with a 2px violet edge, rounded at its name and at its last row.
   The edge is drawn with inset shadows, so the card adds no width and the columns stay even. */
.cm-table .cm-us {
  padding-inline: 1.1rem;
  background: var(--c-white);
  box-shadow: inset 2px 0 0 var(--c-violet), inset -2px 0 0 var(--c-violet);
}
.cm-table thead th.cm-us {
  border-block-start-color: transparent;
  border-start-start-radius: 14px;
  border-start-end-radius: 14px;
  background: var(--c-white);
  box-shadow: inset 2px 0 0 var(--c-violet), inset -2px 0 0 var(--c-violet), inset 0 2px 0 var(--c-violet);
}
.cm-table tbody tr:last-child td.cm-us {
  border-block-end-color: transparent;
  border-end-start-radius: 14px;
  border-end-end-radius: 14px;
  box-shadow: inset 2px 0 0 var(--c-violet), inset -2px 0 0 var(--c-violet), inset 0 -2px 0 var(--c-violet);
}
/* The column after the card keeps clear of its edge. */
.cm-table .cm-us + :is(th, td) { padding-inline-start: 1.25rem; }

.cm-table tbody th {
  font-weight: 500;
  color: var(--fg);
  hyphens: auto; /* a long row name (communication) breaks at a syllable in the phone's narrow column, not mid-letter */
}
.cm-rq {
  display: block;
  margin-block-start: 0.3rem;
  font-size: var(--fz-caption);
  font-weight: 400;
  line-height: 1.4;
  color: var(--fg-2);
  hyphens: manual;
}

/* The status: a few words, weight 500, with its glyph. */
.cm-s {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: var(--fz-small);
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg);
}
.cm-s::before {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-block-start: 0.12em;
  background: var(--fg-2);
  -webkit-mask: var(--cm-glyph, var(--fi-ring)) center / contain no-repeat;
          mask: var(--cm-glyph, var(--fi-ring)) center / contain no-repeat;
}
.cm-s--yes { --cm-glyph: var(--fi-tick); }
.cm-s--yes::before { background: var(--mark); }
.cm-s--part { --cm-glyph: var(--fi-half); }
.cm-s--no { --cm-glyph: var(--fi-ring); }
/* Coming soon: a dashed ring in violet, planned for early 2027 and not available today. */
.cm-s--soon { --cm-glyph: var(--fi-ring-dashed); }
.cm-s--soon::before { background: var(--mark); }
.cm-s--plain::before { display: none; }
.cm-d {
  display: block;
  margin-block-start: 0.4rem;
  font-size: var(--fz-caption);
  line-height: 1.45;
  color: var(--fg);
}
.cm-s--plain + .cm-d { margin-block-start: 0.3rem; }
/* The glyph's column: detail lines sit under the status words, not under the glyph. */
.cm-table td .cm-d { padding-inline-start: 1.5rem; }
.cm-table td .cm-s--plain + .cm-d { padding-inline-start: 0; }

/* Words that must not break at their hyphen (e-signature, re-checked). */
.cm-nw { white-space: nowrap; }

/* Narrow: the row names stay at the left while the products scroll past them. */
@media (max-width: 74.99em) {
  .cm-table :is(tbody th, thead th:first-child) {
    position: sticky;
    inset-inline-start: 0;
    z-index: 1;
    padding-inline-end: 1rem;
    background: var(--c-paper);
    box-shadow: inset -1px 0 0 var(--hair);
  }
  .cm-table :is(tbody th, thead th:first-child) + :is(th, td):not(.cm-us) { padding-inline-start: 1rem; }
}
/* A phone: the row names and Pyrexia fill the first screen; the other four are a swipe away. */
@media (max-width: 37.5em) {
  .cm-table { width: 60.25rem; min-width: 0; }
  .cm-table thead th { width: 13rem; }
  .cm-table thead th:first-child { width: 7.5rem; }
  /* The row names and Pyrexia's whole card fit the first screen of a 375px phone (20.25rem), so the
     card's right edge shows and the next product peeks in. */
  .cm-table thead th.cm-us { width: 12.75rem; }
  .cm-table thead th:not(:first-child):not(.cm-us) { width: 10rem; }
  /* The product's name above each cell, so a cell read mid-table still says whose it is. */
  .cm-table td[data-p]::before {
    content: attr(data-p);
    display: block;
    margin-block-end: 0.35rem;
    font-size: var(--fz-caption);
    font-weight: 700;
    line-height: 1.3;
    color: var(--fg-2);
  }
}

/* Wide: the table fits the column and the product names follow the reader down it. */
@media (min-width: 75em) {
  .cm-hint { display: none; }
  .cm-scroll { overflow: visible; container-type: normal; }
  .cm-table { min-width: 0; }
  .cm-table caption { max-width: 52rem; }
  .cm-table thead th {
    position: sticky;
    inset-block-start: calc(var(--nav-top) + var(--nav-h) + 0.5rem);
    z-index: 2;
    /* Paper over the strip between the capsule and the names, so no row is seen cut in half there. */
    box-shadow: 0 -0.75rem 0 var(--c-paper);
  }
  .cm-table thead th.cm-us { box-shadow: inset 2px 0 0 var(--c-violet), inset -2px 0 0 var(--c-violet), inset 0 2px 0 var(--c-violet), 0 -0.75rem 0 var(--c-paper); }
  /* Held under the capsule: paper from the names to the top of the window, so no row shows beside
     the capsule. Only while held (.is-stuck, set by the page's script); at rest it would cover the caption. */
  .cm-table.is-stuck thead th::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 100%;
    height: calc(var(--nav-top) + var(--nav-h) + 0.5rem);
    background: var(--c-paper);
    pointer-events: none;
  }
  .cm-table thead th:first-child { width: 14%; }
  .cm-table thead th.cm-us { width: 24%; }
  .cm-table thead th:not(:first-child):not(.cm-us) { width: 15.5%; }
}

/* The key under the table, and its one note. */
.cm-key {
  display: grid;
  gap: 0.5rem;
  max-width: 52rem;
  margin-block-start: 1.5rem;
  font-size: var(--fz-caption);
  line-height: 1.45;
  color: var(--fg-2);
}
.cm-key li { display: block; }
.cm-key .cm-s {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.2em;
  margin-inline-end: 0.5rem;
  font-size: var(--fz-caption);
}
.cm-key .cm-s::before { margin-block-start: 0; }
.cm-note { max-width: 52rem; margin-block-start: 1.5rem; font-size: var(--fz-caption); line-height: 1.45; }

@media print {
  .cm-scroll { overflow: visible; }
  .cm-table { min-width: 0; }
  .cm-table :is(tbody th, thead th) { position: static; }
  .cm-hint { display: none; }
}
