/* Reflective-wrap tote ambient-temperature case study.
   Scoped to this article; inherits the shared NoazRX public tokens from
   /styles.css and the article shell from /pages.css. */

.cs-article {
  --cs-vehicle: #fb923c;
  --cs-vehicle-soft: rgba(251, 146, 60, 0.22);
  --cs-tote: #22d3ee;
  --cs-tote-soft: rgba(34, 211, 238, 0.18);
  --cs-surface: var(--nrx-public-surface-raised, #0b1020);
  --cs-border: var(--nrx-public-border, rgba(148, 163, 184, 0.16));
  --cs-muted: var(--nrx-public-muted, #cbd5e1);
  --cs-subtle: var(--nrx-public-subtle, #94a3b8);
  max-width: 1040px;
  overflow-wrap: break-word;
}

.cs-article h2 {
  scroll-margin-top: 96px;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

/* The shared breadcrumb is inline-flex, which would otherwise pull the eyebrow
   onto the same line as the trail. Scoped to this hero only. */
.cs-hero .page-breadcrumbs {
  display: flex;
}

.cs-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  padding: 0;
}

.cs-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--nrx-public-border, rgba(148, 163, 184, 0.16));
  background: rgba(148, 163, 184, 0.08);
  color: var(--nrx-public-muted, #cbd5e1);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
}

.cs-badge--warn {
  border-color: rgba(251, 146, 60, 0.55);
  background: rgba(251, 146, 60, 0.12);
  color: #fdba74;
}

.cs-hero__rules {
  max-width: 820px;
  margin: 0;
  font-size: 0.92rem;
  color: var(--nrx-public-subtle, #94a3b8);
  border-left: 3px solid var(--nrx-public-accent, #22d3ee);
  padding-left: 0.9rem;
}

/* ── Callouts ──────────────────────────────────────────────────────────── */

.cs-callout {
  margin: 1.35rem 0;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  color: var(--cs-muted);
}

.cs-callout--warn {
  border-color: rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.08);
}

.cs-callout--quote {
  border-left: 4px solid var(--cs-tote);
  font-size: 1.08rem;
  color: var(--text, #f5f5f7);
}

/* ── Logger cards ──────────────────────────────────────────────────────── */

.cs-loggers {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 1.35rem 0;
}

.cs-logger {
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
}

.cs-logger__role {
  margin: 0 0 0.2rem;
  font-weight: 700;
  color: var(--text, #f5f5f7);
}

.cs-logger__serial {
  margin: 0 0 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  color: var(--cs-tote);
}

.cs-loggers .cs-logger p:last-child {
  margin-bottom: 0;
}

/* ── Setup diagram ─────────────────────────────────────────────────────────
   Pure HTML + CSS. Every label is real text so the diagram reads identically
   to a screen reader, to a text browser and with CSS or scripting disabled;
   nothing here depends on JavaScript, a canvas or an image. */

.cs-setup {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border-radius: var(--radius-md, 20px);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
}

.cs-setup__caption {
  margin: 0 0 1.1rem;
  font-size: 0.88rem;
  color: var(--cs-subtle);
}

.cs-setup__scene {
  display: grid;
  gap: 1rem;
}

.cs-setup__cabin {
  padding: 1rem;
  border-radius: var(--radius-sm, 12px);
  border: 2px dashed rgba(251, 146, 60, 0.55);
  background: rgba(251, 146, 60, 0.06);
}

.cs-setup__zone {
  margin: 0 0 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--cs-subtle);
}

.cs-setup__chip {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--cs-border);
  background: rgba(3, 7, 18, 0.55);
}

.cs-setup__chip-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text, #f5f5f7);
}

.cs-setup__chip-note {
  font-size: 0.84rem;
  color: var(--cs-muted);
}

.cs-setup__chip--vehicle {
  border-color: rgba(251, 146, 60, 0.5);
}

.cs-setup__chip--tote {
  border-color: rgba(34, 211, 238, 0.5);
}

/* The reflective layer is drawn as the OUTER border of the tote block, because
   that is where the material physically was. */
.cs-setup__tote {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm, 12px);
  border: 3px solid rgba(226, 232, 240, 0.75);
  background: rgba(226, 232, 240, 0.09);
}

.cs-setup__wrap {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
}

.cs-setup__toteinner {
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(3, 7, 18, 0.5);
}

.cs-setup__motion {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px dashed var(--cs-border);
  font-size: 0.88rem;
  color: var(--cs-muted);
}

.cs-setup__key {
  margin: 1.1rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--cs-muted);
}

.cs-setup__key li + li {
  margin-top: 0.3rem;
}

/* ── Summary cards (generated) ─────────────────────────────────────────── */

.cs-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 1.75rem 0;
}

.cs-card {
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cs-card__label {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cs-subtle);
}

.cs-card__value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text, #f5f5f7);
}

.cs-card__detail {
  margin: 0;
  font-size: 0.88rem;
  color: var(--cs-muted);
}

/* Sits directly under the card grid: the plain-language definition of the
   calculated metric, then the co-location qualification for the two
   concurrent-hour example cards. */
.cs-metric-definition,
.cs-qualification {
  margin: -0.5rem 0 1.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm, 12px);
  font-size: 0.88rem;
  color: var(--cs-muted);
}

.cs-metric-definition {
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
}

.cs-metric-definition strong {
  color: var(--text, #f5f5f7);
}

.cs-qualification {
  margin-top: 0;
  border: 1px solid rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.08);
}

.cs-conclusion {
  margin: 1.35rem 0;
  font-size: 1.08rem;
  color: var(--text, #f5f5f7);
}

/* ── Chart ─────────────────────────────────────────────────────────────── */

.cs-chart {
  margin: 1.75rem 0;
  padding: 1.25rem;
  border-radius: var(--radius-md, 20px);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
}

.cs-chart__caption {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--cs-muted);
}

.cs-chart__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.cs-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.cs-control__label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cs-subtle);
}

.cs-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cs-btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--cs-border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--cs-muted);
  transition: background var(--transition, 260ms ease), color var(--transition, 260ms ease),
    border-color var(--transition, 260ms ease);
}

.cs-btn:hover {
  border-color: rgba(34, 211, 238, 0.5);
  color: var(--text, #f5f5f7);
}

.cs-btn.is-active,
.cs-btn[aria-pressed='true'] {
  background: rgba(34, 211, 238, 0.16);
  border-color: rgba(34, 211, 238, 0.6);
  color: #e0f9ff;
}

.cs-btn--wide {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm, 12px);
}

.cs-btn:focus-visible,
.cs-chart__canvas:focus-visible,
.cs-download:focus-visible,
.cs-details summary:focus-visible,
.cs-cta__link:focus-visible {
  outline: 3px solid var(--cs-tote);
  outline-offset: 2px;
}

.cs-chart__hint {
  margin: 0 0 0.9rem;
  font-size: 0.84rem;
  color: var(--cs-subtle);
}

/* `.page-article ul` sets `list-style: disc` at a higher specificity, so the
   structural lists in this article have to opt out explicitly. */
.page-article .cs-legend,
.page-article .cs-sources,
.page-article .cs-cards {
  list-style: none;
  padding-left: 0;
}

.cs-legend {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.cs-legend__item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--cs-muted);
}

.cs-legend__item::before {
  content: none;
}

.cs-legend__swatch {
  flex: 0 0 auto;
  margin-top: 0.35rem;
  width: 26px;
  border-radius: 3px;
}

.cs-legend__swatch--band {
  height: 14px;
  background: var(--cs-vehicle-soft);
  border-top: 2px solid var(--cs-vehicle);
  border-bottom: 2px solid var(--cs-vehicle);
}

.cs-legend__swatch--line {
  height: 3px;
  background: var(--cs-tote);
}

.cs-chart__surface {
  position: relative;
  width: 100%;
}

.cs-chart__canvas {
  display: block;
  width: 100%;
  height: 420px;
  border-radius: var(--radius-sm, 12px);
  background: rgba(3, 7, 18, 0.65);
  touch-action: pan-y;
}

.cs-chart__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--cs-subtle);
  font-size: 0.9rem;
}

.cs-chart__loading[hidden] {
  display: none;
}

.cs-tooltip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  min-width: 190px;
  max-width: min(280px, 78vw);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: rgba(3, 7, 18, 0.96);
  color: var(--text, #f5f5f7);
  font-size: 0.82rem;
  line-height: 1.5;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.cs-tooltip[hidden] {
  display: none;
}

.cs-tooltip__time {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--cs-subtle);
  margin-bottom: 0.35rem;
}

.cs-tooltip__row {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.cs-tooltip__row--vehicle strong { color: var(--cs-vehicle); }
.cs-tooltip__row--tote strong { color: var(--cs-tote); }

.cs-chart__readout {
  margin: 0.75rem 0 0;
  min-height: 1.4em;
  font-size: 0.86rem;
  color: var(--cs-muted);
}

.cs-chart__rules {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--cs-subtle);
  border-left: 3px solid var(--cs-tote);
  padding-left: 0.85rem;
}

.cs-stress {
  margin-top: 1.1rem;
}

.cs-stress__panel {
  margin-top: 0.75rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--cs-border);
  background: rgba(148, 163, 184, 0.06);
}

.cs-stress__panel[hidden] {
  display: none;
}

.cs-stress__panel p {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
}

.cs-stress__panel p:last-child {
  margin-bottom: 0;
}

/* Shown only when scripting is unavailable. */
.cs-chart__nojs {
  display: none;
}

.no-js .cs-chart {
  display: none;
}

.no-js .cs-chart__nojs {
  display: block;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.08);
}

/* ── Tables ────────────────────────────────────────────────────────────── */

.cs-tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  border: 1px solid var(--cs-border);
  border-radius: var(--radius-sm, 12px);
  background: var(--cs-surface);
  max-width: 100%;
}

.cs-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 0.86rem;
}

.cs-table caption {
  caption-side: top;
  text-align: left;
  padding: 0.9rem 1rem;
  color: var(--cs-subtle);
  font-size: 0.82rem;
  line-height: 1.55;
}

.cs-table th,
.cs-table td {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: right;
  white-space: nowrap;
  color: var(--cs-muted);
}

.cs-table thead th {
  position: sticky;
  top: 0;
  background: #0b1020;
  color: var(--text, #f5f5f7);
  font-weight: 600;
  text-align: right;
  z-index: 1;
}

.cs-table th[scope='row'] {
  text-align: left;
  font-weight: 600;
  color: var(--text, #f5f5f7);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.cs-table thead th:first-child {
  text-align: left;
}

.cs-table tbody tr:last-child th,
.cs-table tbody tr:last-child td {
  border-bottom: none;
}

.cs-details {
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
}

.cs-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text, #f5f5f7);
}

.cs-details__fallback {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--cs-muted);
}

.cs-details .cs-tablewrap {
  border: none;
  background: transparent;
  margin-bottom: 0;
}

/* The complete daily results live in a native <details>: collapsed by default,
   keyboard operable and fully functional with scripting disabled. */
.cs-details--daily > summary {
  font-size: 1rem;
}

.cs-details--daily > summary::marker {
  color: var(--cs-tote);
}

.cs-scrollnote {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--cs-subtle);
}

/* ── Downloads and provenance ──────────────────────────────────────────── */

.cs-downloads {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 1.25rem 0;
}

.cs-download {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.07);
  text-decoration: none;
  transition: border-color var(--transition, 260ms ease), background var(--transition, 260ms ease);
}

.cs-download:hover {
  border-color: rgba(34, 211, 238, 0.7);
  background: rgba(34, 211, 238, 0.13);
}

.cs-download__name {
  font-weight: 700;
  color: var(--cs-tote);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.cs-download__meta {
  font-size: 0.84rem;
  color: var(--cs-muted);
}

.cs-sources {
  list-style: none;
  margin: 1.25rem 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.cs-source {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
}

.cs-sources .cs-source::before {
  content: none;
}

.cs-source__role {
  margin: 0 0 0.3rem;
  font-weight: 700;
  color: var(--text, #f5f5f7);
}

.cs-source__path {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.cs-source__path code,
.cs-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--cs-tote);
  overflow-wrap: anywhere;
}

.cs-source__meta {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 0.3rem 0.9rem;
  margin: 0;
  font-size: 0.84rem;
}

.cs-source__meta dt {
  color: var(--cs-subtle);
  white-space: nowrap;
}

.cs-source__meta dd {
  margin: 0;
  color: var(--cs-muted);
  overflow-wrap: anywhere;
  min-width: 0;
}

.cs-evidence-note {
  margin: 0 0 1.35rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px dashed var(--cs-border);
  font-size: 0.88rem;
  color: var(--cs-muted);
}

.cs-limitations li strong {
  color: #fdba74;
}

.cs-cta {
  margin: 1.5rem 0 0;
}

.cs-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.9), rgba(37, 99, 235, 0.9));
  color: #03131a;
  font-weight: 700;
  text-decoration: none;
}

.cs-cta__link:hover {
  filter: brightness(1.08);
}

.cs-footnote {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cs-border);
  font-size: 0.82rem;
  color: var(--cs-subtle);
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .cs-chart {
    padding: 1rem 0.85rem;
  }

  .cs-chart__canvas {
    height: 340px;
  }

  .cs-chart__toolbar {
    gap: 0.9rem;
  }

  .cs-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
  }

  .cs-source__meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .cs-source__meta dd {
    margin-bottom: 0.45rem;
  }
}

@media (max-width: 400px) {
  .cs-chart__canvas {
    height: 300px;
  }
}

/* ── Print ─────────────────────────────────────────────────────────────────
   A collapsed <details> must not swallow the complete daily results on paper.
   Both the legacy child-display technique and the modern ::details-content
   pseudo-element are applied so the table prints in every engine. */

@media print {
  .cs-details > summary {
    display: block;
    list-style: none;
  }

  .cs-details::details-content {
    content-visibility: visible;
    block-size: auto;
    opacity: 1;
  }

  .cs-details > *:not(summary) {
    display: block !important;
  }

  .cs-tablewrap {
    overflow-x: visible;
  }

  .cs-table {
    min-width: 0;
  }

  .cs-table thead th {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-btn,
  .cs-download,
  .cs-cta__link {
    transition: none;
  }

  .cs-chart *,
  .cs-chart *::before,
  .cs-chart *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Companion-study banner pointing at the vehicle-cabin analysis of the same
   source export. Placed above the hero so a reader who wants the environment
   question rather than the container question is redirected immediately. */
.cs-companion {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 230, 255, 0.05);
  padding: 0.9rem 0;
  font-size: 0.92rem;
}

.cs-companion p {
  margin: 0;
  line-height: 1.6;
}

.cs-companion a {
  font-weight: 600;
  white-space: nowrap;
}
