/* ================================================================================================
   UI rules (DESIGN.md, "UI rules"). One way to do each recurring thing, loaded on every inner page
   after the page families and before light.css. Page CSS may place things; it does not invent a
   second label, action row, card, table header or long-section behaviour.
   ================================================================================================ */

/* ---- Labels: one quiet style, never a bordered chip ---- */
/* Small labels (a kind, a status, "Most common", "Preparing") are mono, uppercase and borderless.
   Bordered chips are kept only for things you can press (filters) and files inside product views. */
:is(.ev-tag, .kit-tag, .docs-badge) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}
:is(.ev-tag, .kit-tag)::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
:is(.ev-customer, .kit-tag) {
  color: var(--color-accent);
}
.kit-tag {
  margin-top: 12px;
}

/* ---- Actions: on a row of their own, under what they follow ---- */
.ui-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-md);
}
.ui-closing {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-rule);
}
body.page-inner main .ui-closing p {
  margin: 0;
  font-size: 18px;
  /* Whole-pixel line boxes keep everything below on whole pixels (the product views are compared
     pixel by pixel). */
  line-height: 28px;
  color: var(--color-ink);
}

/* ---- Facts about a document or a case: label over value, in a row ---- */
.ui-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
  margin: var(--space-lg) 0 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-rule);
}
.ui-meta > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ui-meta dt {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.ui-meta dd {
  margin: 0;
  font-size: 15px;
  color: var(--color-ink);
}
.ui-meta a {
  color: var(--color-ink);
}

/* ---- Points: an icon, a title and two short labelled lines per card ---- */
/* Points are ruled columns, as the homepage sets them: a line above and below the row and a thin
   rule between columns, never a box per point (design system, "Ruled lists"). */
.ui-points {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
}
.ui-points > li {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: 30px 28px 32px;
}
.ui-points > li:first-child {
  padding-left: 0;
}
.ui-points > li:last-child {
  padding-right: 0;
}
.ui-points > li + li {
  border-left: 1px solid var(--color-rule);
}
.ui-points-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-rule-strong);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-accent);
}
body.page-inner main .ui-points h3 {
  min-height: 2.6em;
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  color: var(--color-ink);
}
.ui-points dl {
  display: grid;
  gap: var(--space-sm);
  margin: auto 0 0;
}
.ui-points dl > div {
  display: grid;
  gap: 4px;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-rule);
}
.ui-points dt {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.ui-points dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-body);
}
@media (max-width: 1100px) {
  .ui-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ui-points > li,
  .ui-points > li:first-child,
  .ui-points > li:last-child {
    padding: 28px 24px 30px;
  }
  .ui-points > li:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
  .ui-points > li:nth-child(even) {
    padding-right: 0;
  }
  .ui-points > li:nth-child(n + 3) {
    border-top: 1px solid var(--color-rule);
  }
}
@media (max-width: 600px) {
  .ui-points {
    grid-template-columns: minmax(0, 1fr);
  }
  .ui-points > li,
  .ui-points > li:nth-child(odd),
  .ui-points > li:nth-child(even) {
    padding: 24px 0 26px;
    border-left: 0;
  }
  .ui-points > li + li {
    border-top: 1px solid var(--color-rule);
  }
}

/* ---- Long content: the title stays in view ---- */
/* A section marked `ui-pin` that runs past one screen keeps its heading under the site header
   (client/pin.js). Stuck, the heading is one line on the page's ground with a rule under it;
   a table's column headers stick under it. Without JavaScript nothing sticks. */
.ui-pin-ready .ui-pin.is-pinnable > :is(.story-heading, .case-heading) {
  position: sticky;
  top: var(--ui-header-h, 69px);
  z-index: 6;
  max-width: none;
  background: var(--ui-pin-ground, var(--color-paper));
  transition:
    padding var(--dur-feedback) var(--ease-out),
    box-shadow var(--dur-feedback) var(--ease-out);
}
.ind-band {
  --ui-pin-ground: var(--color-surface);
}
.ui-pin-ready .ui-pin.is-pinnable > :is(.story-heading, .case-heading)[data-stuck] {
  padding-block: 14px;
  box-shadow: 0 1px 0 var(--color-rule);
}
.ui-pin-ready .ui-pin.is-pinnable > [data-stuck] :is(h2) {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.ui-pin-ready .ui-pin.is-pinnable > [data-stuck] h2 > br {
  display: none;
}
.ui-pin-ready .ui-pin.is-pinnable > [data-stuck] h2 > br + :is(em, span) {
  display: inline;
}
.ui-pin-ready .ui-pin.is-pinnable > [data-stuck] h2 > br + :is(em, span)::before {
  content: ' ';
}
.ui-pin-ready .ui-pin.is-pinnable > [data-stuck] > :not(h2) {
  display: none;
}
/* Column headers of a long table stick under the stuck title. */
@media (min-width: 768px) {
  .ui-pin-ready .ui-pin.is-pinnable :is(.ind-why-table, .kit-ticks, .md-table) {
    overflow: visible;
  }
  .ui-pin-ready .ui-pin.is-pinnable :is(.ind-why-table, .kit-ticks) thead :is(th, td) {
    position: sticky;
    top: calc(var(--ui-header-h, 69px) + var(--ui-pin-h, 56px));
    z-index: 7;
    background: var(--ui-pin-ground, var(--color-paper));
    box-shadow: 0 1px 0 var(--color-rule);
  }
  .ui-pin-ready .ui-pin.is-pinnable .ind-why-table thead .is-matrix {
    background: color-mix(
      in srgb,
      var(--color-accent) 8%,
      var(--ui-pin-ground, var(--color-paper))
    );
  }
}
@media (prefers-reduced-motion: reduce) {
  .ui-pin-ready .ui-pin.is-pinnable > :is(.story-heading, .case-heading) {
    transition: none;
  }
}

/* ---- Walkthrough task panels: one hierarchy ---- */
/* The task's number and role sit above its title as one eyebrow; inside the panel each part is a
   small label over its text, never a heading larger than the task's own. */
.case-panel::before {
  content: none;
}
body.page-inner main .case-heading .case-role {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lp-eyebrow);
}
.case-heading .case-role > span {
  color: var(--color-muted);
}
body.page-inner main :is(.case-narrative, .case-outcomes) h3 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
body.page-inner main .case-narrative h3:not(:first-child) {
  margin-top: var(--space-lg);
}
body.page-inner main :is(.case-narrative, .case-outcomes) p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-body);
}
.case-section {
  border-top: 1px solid var(--color-rule);
  border-bottom: 0;
}
.case-acceptance {
  border-top: 0;
}
body .case-inputs {
  margin: 0;
  padding-left: 18px;
  color: var(--color-body);
}
body .case-inputs li {
  padding: 3px 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 16px;
}
.case-outcomes > div {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-rule);
}

/* ---- A picture beside a list: equal height, aligned tops ---- */
/* Hardware, "How we size it": the picture and the four factors start on the same line and end on
   the same line; the picture is cropped to the list's height and its note sits inside it. */
@media (min-width: 1024px) {
  .pd-sizing-row.has-picture {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: var(--space-xl);
  }
  .pd-sizing-row.has-picture .matrix-in-place {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--color-rule-strong);
  }
  .pd-sizing-row.has-picture .matrix-in-place img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    object-position: 40% 60%;
  }
  .pd-sizing-row.has-picture .pd-sizing-list {
    display: flex;
    flex-direction: column;
  }
  .pd-sizing-row.has-picture .pd-sizing-list ul {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .pd-sizing-row.has-picture .pd-sizing-list li:last-child {
    border-bottom: 1px solid var(--color-rule);
  }
}
.pd-sizing-row.has-picture .matrix-in-place figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  margin: 0;
  padding: 4px 8px;
  background: rgba(10, 13, 20, 0.62);
  font-size: 12px;
  color: #e6e8ec;
}
body.page-inner main .pd-sizing-row.has-picture .matrix-in-place figcaption {
  margin: 0;
  font-size: 12px;
  color: #e6e8ec;
}
body main .pd-sizing-list > p.mono {
  margin: 0;
}
@media (max-width: 1023px) {
  .pd-sizing-row.has-picture .matrix-in-place {
    position: relative;
  }
}
.kit-faq + .ui-closing {
  margin-top: var(--space-lg);
  padding-top: 0;
  border-top: 0;
}

/* ---- Card eyebrows: one case ---- */
:is(.ind-overview-card, .dl-card) > .lp-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- The design system on the inner pages (Xinyu, October 6, 2026; DESIGN.md) ----
   The same frame as the homepage and the Product pages: one page colour, a blue eyebrow over each
   two-tone title with its lead beside it, ruled columns instead of boxes, steps on a timeline. */

/* Section head: eyebrow and title on the left, the lead beside them, bottom-aligned. */
body.page-inner main .story-heading:not(.story-heading-split) {
  max-width: none;
}
body.page-inner main .story-heading:has(> p):not([data-stuck]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  column-gap: 80px;
  align-items: end;
}
body.page-inner main .story-heading:has(> p):not([data-stuck]) > :not(p) {
  grid-column: 1;
}
body.page-inner main .story-heading:has(> p):not([data-stuck]) > p {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: end;
  max-width: none;
  margin: 0;
  padding-bottom: 8px;
  font-size: 18px;
  line-height: 1.55;
}
body.page-inner main .story-heading h2 {
  margin-bottom: 0;
}
.story-eyebrow {
  display: block;
  margin-bottom: 22px;
  font-size: 13px;
}

/* One page colour: the bands keep their rules, not a second ground. */
.ind-band {
  --ui-pin-ground: var(--color-paper);
  background: transparent;
  border-top: 0;
  border-bottom: 0;
}

/* Proof facts under a hero read as text, each after a small azure mark. */
body.page-inner main .ind-proof {
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-body);
}
.ind-proof-list > span::before {
  color: var(--color-accent);
  opacity: 1;
}

/* Columns of a title and its text are ruled, as the homepage sets its points. */
body.page-inner main .ind-columns:not(.ind-steps) {
  gap: 0;
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
}
body.page-inner main .ind-columns:not(.ind-steps) > * {
  padding: 30px 28px 32px;
}
body.page-inner main .ind-columns:not(.ind-steps) > :first-child {
  padding-left: 0;
}
body.page-inner main .ind-columns:not(.ind-steps) > :last-child {
  padding-right: 0;
}
body.page-inner main .ind-columns:not(.ind-steps) > * + * {
  border-left: 1px solid var(--color-rule);
}
body.page-inner main .ind-columns h3 {
  font-size: 18px;
  line-height: 1.35;
}

/* Steps sit on a timeline: a rule with an azure stop above each. */
body.page-inner main .ind-steps > li {
  position: relative;
  padding-top: 30px;
  border-top: 1px solid var(--color-rule-strong);
}
body.page-inner main .ind-steps > li::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
}
body.page-inner main .ind-steps h3 {
  font-size: 21px;
}

/* An aside that names who stays responsible: an azure rule beside it, not a box. */
body.page-inner main .ind-accountability {
  padding: 4px 0 4px 28px;
  border: 0;
  border-left: 2px solid var(--color-accent);
  background: none;
}

@media (max-width: 1000px) {
  body.page-inner main .ind-columns:not(.ind-steps) {
    grid-template-columns: minmax(0, 1fr);
  }
  body.page-inner main .ind-columns:not(.ind-steps) > *,
  body.page-inner main .ind-columns:not(.ind-steps) > :first-child,
  body.page-inner main .ind-columns:not(.ind-steps) > :last-child {
    padding: 24px 0 26px;
    border-left: 0;
  }
  body.page-inner main .ind-columns:not(.ind-steps) > * + * {
    border-top: 1px solid var(--color-rule);
  }
}
@media (max-width: 899px) {
  body.page-inner main .story-heading:has(> p):not([data-stuck]) {
    display: block;
  }
  body.page-inner main .story-heading:has(> p):not([data-stuck]) > p {
    margin-top: 22px;
    padding-bottom: 0;
    font-size: 16.5px;
  }
}
@media (max-width: 767px) {
  .story-eyebrow {
    margin-bottom: 16px;
    font-size: 12px;
  }
}
