/* ==========================================================================
   REFRACT — Open-Source AI Testing Ecosystem Comparison (Watercolor Theme)
   Strict CSP Safe: Zero external fonts, zero CDN links, zero data-URI images.
   Nominal Fair-Use Compliant: Plain-text project names only; zero 3rd-party logos.
   ========================================================================== */

:root {
  --paper-bright: #FCFBF7;
  --paper-warm: #F7F4EB;
  --paper-card: rgba(255, 254, 250, 0.90);
  --paper-tint: #F3EFE4;
  --ink-sumi: #162032;
  --ink-slate: #334155;
  --ink-muted: #3E5065;

  --cerulean: #0369A1;
  --cerulean-deep: #075985;
  --cerulean-wash: rgba(14, 165, 233, 0.14);
  --cerulean-edge: rgba(2, 132, 199, 0.34);

  --seafoam: #0D645D;
  --seafoam-wash: rgba(20, 184, 166, 0.16);
  --seafoam-edge: rgba(13, 148, 136, 0.34);

  --coral: #E11D48;
  --coral-wash: rgba(244, 63, 94, 0.12);

  --ochre: #A3590D;
  --ochre-wash: rgba(245, 158, 11, 0.16);
  --ochre-edge: rgba(217, 119, 6, 0.34);

  --hairline: rgba(22, 32, 50, 0.11);
  --hairline-strong: rgba(22, 32, 50, 0.20);
  --shadow-paper: 0 12px 30px -14px rgba(22, 32, 50, 0.12), 0 2px 8px rgba(22, 32, 50, 0.04);
  --shadow-lift: 0 18px 38px -14px rgba(2, 132, 199, 0.22), 0 4px 12px rgba(22, 32, 50, 0.06);

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --sans: "Plus Jakarta Sans", "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --ease-tactile: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink-sumi);
  font-family: var(--sans);
  line-height: 1.62;
  background-color: var(--paper-bright);
  background-image:
    radial-gradient(ellipse 64% 46% at 8% 4%, var(--cerulean-wash), transparent 62%),
    radial-gradient(ellipse 56% 42% at 92% 8%, var(--seafoam-wash), transparent 60%),
    radial-gradient(ellipse 50% 38% at 80% 58%, var(--ochre-wash), transparent 64%),
    radial-gradient(ellipse 46% 38% at 16% 88%, var(--coral-wash), transparent 62%),
    linear-gradient(180deg, var(--paper-bright) 0%, var(--paper-warm) 100%);
  background-attachment: scroll;
  -webkit-font-smoothing: antialiased;
}

.eco-page-shell {
  position: relative;
}

.eco-section {
  position: relative;
  padding: 3.5rem 1.25rem 4.5rem;
  overflow: hidden;
}

.eco-wash-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 18%, rgba(14, 165, 233, 0.10), transparent 36%),
    radial-gradient(circle at 76% 24%, rgba(20, 184, 166, 0.11), transparent 34%),
    radial-gradient(circle at 52% 78%, rgba(245, 158, 11, 0.08), transparent 40%);
  z-index: 0;
}

.eco-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.eco-section a {
  color: var(--cerulean);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.18s var(--ease-tactile);
}

.eco-section a:hover {
  color: var(--cerulean-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.eco-section code {
  font-family: var(--mono);
  font-size: max(0.87em, 13px);
  font-weight: 600;
  color: var(--ink-sumi);
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.18);
  border-radius: 6px;
  padding: 0.1em 0.38em;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Header */
.eco-header {
  max-width: 860px;
  margin-bottom: 2rem;
}

.eco-eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.eco-pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.78rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cerulean-deep);
  background: var(--cerulean-wash);
  border: 1px solid var(--cerulean-edge);
}

.eco-badge-seafoam {
  color: #0F766E;
  background: var(--seafoam-wash);
  border-color: var(--seafoam-edge);
}

.eco-verified-stamp {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.24rem 0.72rem;
}

.eco-title {
  margin: 0 0 0.85rem;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.3vw, 2.75rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink-sumi);
}

.eco-title-accent {
  background: linear-gradient(120deg, var(--cerulean-deep), var(--seafoam));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eco-lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-slate);
  max-width: 78ch;
}

.eco-status-note {
  max-width: 860px;
  margin: 0.9rem 0 0;
  padding: 0.85rem 1.05rem;
  background: rgba(255, 251, 235, 0.92);
  border: 1px solid rgba(180, 83, 9, 0.28);
  border-left: 4px solid #B45309;
  border-radius: 10px;
  color: var(--ink-slate);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.eco-status-note strong {
  color: var(--ink-sumi);
}

/* When the factual hedge is collapsed into a <details>, keep it quiet and
   keyboard-accessible instead of competing with the page headline. */
.eco-status-note summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink-sumi);
  list-style-position: inside;
}

.eco-status-note summary:hover,
.eco-status-note summary:focus-visible {
  color: #92400E;
}

.eco-status-note[open] summary {
  margin-bottom: 0.5rem;
}

.eco-status-note p {
  margin: 0;
}

/* Single quiet release-status chip for the page footer. */
.release-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.72rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper-card);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.25;
  white-space: nowrap;
}

.release-status-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #D97706;
}

.release-status-chip:hover,
.release-status-chip:focus-visible {
  color: var(--ink-slate);
  border-color: var(--hairline-strong);
}

.release-status-chip:focus-visible {
  outline: 2px solid var(--ink-link);
  outline-offset: 2px;
}

/* Interactive Use-Case Picker */
.eco-picker-wrap {
  margin-bottom: 1.35rem;
  padding: 1.1rem 1.2rem;
  background: var(--paper-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-paper);
  backdrop-filter: blur(8px);
}

.eco-picker-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-slate);
  margin-bottom: 0.75rem;
}

.eco-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.eco-dot-cerulean {
  background: linear-gradient(135deg, var(--cerulean), var(--seafoam));
}

.eco-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.eco-pill {
  appearance: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--ink-slate);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  transition:
    transform 0.18s var(--ease-tactile),
    background-color 0.18s var(--ease-tactile),
    border-color 0.18s var(--ease-tactile),
    box-shadow 0.18s var(--ease-tactile),
    color 0.18s var(--ease-tactile);
}

.eco-pill:hover {
  transform: translateY(-1px);
  border-color: var(--cerulean-edge);
  color: var(--ink-sumi);
  background: rgba(14, 165, 233, 0.08);
}

.eco-pill:focus-visible {
  outline: 2px solid var(--cerulean);
  outline-offset: 2px;
}

.eco-pill.is-active {
  color: #FFFFFF;
  border-color: transparent;
  background: linear-gradient(125deg, var(--cerulean), var(--seafoam));
  box-shadow: 0 8px 18px -8px rgba(2, 132, 199, 0.55);
}

/* Dynamic Recommendation Banner */
.eco-recommendation {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  padding: 1.05rem 1.25rem;
  background: linear-gradient(125deg, rgba(14, 165, 233, 0.10), rgba(20, 184, 166, 0.10));
  border: 1px solid var(--cerulean-edge);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-paper);
}

.eco-rec-badge {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cerulean-deep);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--cerulean-edge);
  border-radius: 999px;
  padding: 0.34rem 0.8rem;
  white-space: nowrap;
}

.eco-rec-title {
  margin: 0 0 0.2rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink-sumi);
}

.eco-rec-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-slate);
}

.eco-rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.eco-rec-link {
  display: inline-flex;
  align-items: center;
  padding: 0.44rem 0.88rem;
  border-radius: 999px;
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--cerulean-edge);
  white-space: nowrap;
}

/* Tool Cards Grid */
.eco-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.eco-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.2rem;
  background: var(--paper-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-paper);
  transition:
    transform 0.22s var(--ease-tactile),
    border-color 0.22s var(--ease-tactile),
    box-shadow 0.22s var(--ease-tactile),
    opacity 0.22s var(--ease-tactile);
}

.eco-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.eco-card-refract {
  background: linear-gradient(160deg, rgba(255, 254, 250, 0.96), rgba(224, 242, 254, 0.42));
  border-color: var(--cerulean-edge);
}

.eco-card.is-highlighted {
  border-color: var(--cerulean);
  box-shadow: 0 16px 34px -14px rgba(2, 132, 199, 0.34), 0 0 0 2px rgba(2, 132, 199, 0.16);
  transform: translateY(-2px);
}

.eco-card.is-paired {
  border-color: var(--seafoam);
  box-shadow: 0 14px 30px -14px rgba(13, 148, 136, 0.28), 0 0 0 2px rgba(13, 148, 136, 0.14);
}

.eco-card.is-dimmed {
  background: rgba(243, 239, 228, 0.72);
  border-color: rgba(22, 32, 50, 0.10);
  box-shadow: none;
}

.eco-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.eco-card-kicker {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.15rem;
}

.eco-card-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink-sumi);
}

.eco-license-tag {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.18rem 0.56rem;
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-slate);
}

.eco-license-apache {
  color: var(--cerulean-deep);
  background: var(--cerulean-wash);
  border-color: var(--cerulean-edge);
}

.eco-license-mit {
  color: var(--seafoam);
  background: var(--seafoam-wash);
  border-color: var(--seafoam-edge);
}

.eco-card-desc {
  margin: 0 0 0.85rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-slate);
  flex-grow: 1;
}

.eco-card-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin: 0 0 0.9rem;
  padding: 0.65rem 0.75rem;
  background: rgba(247, 244, 235, 0.75);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-size: 0.90625rem;
  line-height: 1.5;
}

.eco-card-meta dt {
  font-weight: 700;
  color: var(--ink-muted);
  display: inline;
  margin-right: 0.35rem;
}

.eco-card-meta dt::after {
  content: ":";
}

.eco-card-meta dd {
  display: inline;
  margin: 0;
  color: var(--ink-sumi);
}

.eco-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--hairline);
}

.eco-repo-link {
  font-family: var(--mono);
  font-size: 0.8125rem;
  word-break: break-word;
}

.eco-match-pill {
  display: none;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  white-space: nowrap;
}

.eco-card.is-highlighted .eco-match-pill {
  display: inline-block;
  color: var(--cerulean-deep);
  background: var(--cerulean-wash);
  border: 1px solid var(--cerulean-edge);
}

.eco-card.is-paired .eco-match-pill {
  display: inline-block;
  color: #0F766E;
  background: var(--seafoam-wash);
  border: 1px solid var(--seafoam-edge);
}

/* Comparison Matrix */
.eco-matrix-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  list-style: none;
  margin-bottom: 0.75rem;
}

.eco-matrix-summary::-webkit-details-marker {
  display: none;
}

.eco-matrix-summary::before {
  content: "▸";
  font-size: 1.05rem;
  color: var(--ink-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.eco-matrix-disclosure[open] > .eco-matrix-summary::before {
  transform: rotate(90deg);
}

.eco-matrix-section {
  margin-bottom: 2.5rem;
}

.eco-matrix-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.eco-subheading {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-size: 1.48rem;
  color: var(--ink-sumi);
}

.eco-subcopy {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-slate);
}

.eco-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.eco-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.eco-table-scroll {
  overflow-x: auto;
  background: var(--paper-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-paper);
}

.eco-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.90625rem;
}

/* Wide screens fit the table cleanly within container width (zero horizontal
   overflow at 1024px, 1280px, 1440px); below 721px the table becomes a
   per-row card stack so no phone ever scrolls horizontally. */
@media (min-width: 721px) {
  .eco-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
}

.eco-table th,
.eco-table td {
  padding: 0.85rem 0.75rem;
  vertical-align: top;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid rgba(22, 32, 50, 0.06);
  transition: background-color 0.2s var(--ease-tactile), opacity 0.2s var(--ease-tactile);
}

@media (min-width: 721px) and (max-width: 1180px) {
  .eco-section {
    padding: 2.75rem 0.75rem 3.5rem;
  }

  .eco-table th,
  .eco-table td {
    padding: 0.72rem 0.56rem;
  }
}

.eco-table th:last-child,
.eco-table td:last-child {
  border-right: 0;
}

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

.eco-table thead th {
  background: rgba(247, 244, 235, 0.92);
  font-weight: 700;
  color: var(--ink-sumi);
}

.eco-table thead th a,
.eco-table thead th .eco-th-name {
  display: block;
  font-size: 0.93rem;
  margin-bottom: 0.2rem;
  overflow-wrap: anywhere;
}

.eco-th-meta {
  display: block;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

.eco-col-feature {
  width: 24%;
  min-width: 0;
}

#eco-matrix-table .eco-col-feature {
  width: 20%;
}

.eco-table tbody th[scope="row"] {
  font-weight: 600;
  color: var(--ink-sumi);
  background: rgba(252, 251, 247, 0.85);
}

.eco-col-refract,
.eco-table td[data-col-tool="refract"] {
  background: rgba(14, 165, 233, 0.05);
}

.eco-table [data-col-tool].is-col-highlighted {
  background: rgba(14, 165, 233, 0.13);
}

.eco-table [data-col-tool].is-col-paired {
  background: rgba(20, 184, 166, 0.11);
}

.eco-table [data-col-tool].is-col-dimmed {
  background: rgba(243, 239, 228, 0.55);
}

.eco-chip {
  display: inline-block;
  max-width: 100%;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.16rem 0.58rem;
  margin-bottom: 0.4rem;
}

.eco-chip-yes {
  color: var(--seafoam);
  background: var(--seafoam-wash);
  border: 1px solid var(--seafoam-edge);
}

.eco-chip-partial {
  color: #92400E;
  background: var(--ochre-wash);
  border: 1px solid var(--ochre-edge);
}

.eco-cell-note {
  display: block;
  font-size: 0.90625rem;
  line-height: 1.48;
  color: var(--ink-slate);
}

/* Per-row upstream citation links inside the matrix feature column. */
.eco-row-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  margin-top: 0.55rem;
  font-size: 13px;
  line-height: 1.35;
}

.eco-row-sources-label {
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.eco-row-sources a {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cerulean-deep);
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.24);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  text-decoration: none;
  white-space: nowrap;
}

.eco-row-sources a:hover {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(2, 132, 199, 0.5);
  color: var(--cerulean-deep);
  text-decoration: none;
}

/* Better Together Section */
.eco-together {
  padding: 1.5rem 1.5rem 1.6rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(255, 254, 250, 0.94), rgba(240, 253, 250, 0.84));
  border: 1px solid var(--seafoam-edge);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-paper);
}

.eco-together-intro {
  margin-bottom: 1.15rem;
}

.eco-together-intro .eco-pill-badge {
  margin-bottom: 0.5rem;
}

.eco-pairings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.eco-pair-card {
  padding: 1rem 1.05rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  transition: border-color 0.2s var(--ease-tactile), box-shadow 0.2s var(--ease-tactile), opacity 0.2s var(--ease-tactile);
}

.eco-pair-card.is-pair-active {
  border-color: var(--seafoam);
  box-shadow: 0 12px 26px -14px rgba(13, 148, 136, 0.34);
}

.eco-pair-card p {
  margin: 0.65rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-slate);
}

.eco-pair-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.eco-pair-node {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--paper-tint);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-sumi);
}

.eco-pair-node-refract {
  color: var(--cerulean-deep);
  background: var(--cerulean-wash);
  border-color: var(--cerulean-edge);
}

.eco-pair-plus {
  font-weight: 700;
  color: var(--seafoam);
}

/* Legal Footer */
.eco-legal-footer {
  padding: 1.1rem 1.25rem;
  background: rgba(247, 244, 235, 0.86);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  font-size: 0.90625rem;
  color: var(--ink-muted);
}

.eco-legal-footer p {
  margin: 0 0 0.45rem;
}

.eco-legal-footer p:last-child {
  margin-bottom: 0;
}

.eco-disambig {
  color: var(--ink-slate);
}

.eco-disclaimer {
  margin-top: 16px;
  font-size: 0.90625rem;
  color: #475569;
}

/* Responsive */
@media (max-width: 1020px) {
  .eco-cards-grid,
  .eco-pairings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eco-recommendation {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 1320px) {
  .eco-matrix-disclosure .eco-table-scroll {
    overflow-x: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #eco-matrix-table {
    min-width: 0;
    display: block;
    border-collapse: separate;
    border-spacing: 0;
  }

  #eco-matrix-table thead {
    display: none;
  }

  #eco-matrix-table tbody {
    display: block;
  }

  #eco-matrix-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--paper-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-paper);
  }

  #eco-matrix-table tbody th[scope="row"] {
    grid-column: 1 / -1;
    width: auto;
    padding: 0 0 0.5rem;
    border-bottom: 1px solid var(--hairline);
    background: transparent;
    font-size: 0.98rem;
    line-height: 1.4;
  }

  #eco-matrix-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.75rem 0.85rem;
    border: 0;
    border-left: 3px solid rgba(22, 32, 50, 0.09);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.78);
    overflow-wrap: break-word;
  }

  #eco-matrix-table tbody td::before {
    content: attr(data-tool-label);
    font-family: var(--mono);
    font-size: var(--fs-label);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink-muted);
  }

  #eco-matrix-table tbody td[data-col-tool="refract"] {
    border-left-color: var(--cerulean);
  }

  #eco-matrix-table tbody td[data-col-tool="refract"]::before {
    color: var(--cerulean-deep);
  }
}

@media (max-width: 720px) {
  #eco-matrix-table tbody tr {
    grid-template-columns: 1fr;
  }
  /* Mobile-native capability matrix: no 980px horizontal-scroll table. The
     auto overflow still contains any unexpected cell overflow, so the body
     never widens on a 390px phone. This breakpoint matches ui-shell.js's
     <=720px fold boundary, so the matrix is cards (not a scrolled table)
     even inside the optional <details> disclosure. */
  .eco-table-scroll {
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .eco-table {
    min-width: 0;
    display: block;
    border-collapse: separate;
    border-spacing: 0;
  }

  .eco-table thead {
    display: none;
  }

  .eco-table tbody {
    display: block;
  }

  .eco-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--paper-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-paper);
  }

  .eco-table tbody th[scope="row"] {
    grid-column: 1 / -1;
    padding: 0 0 0.45rem;
    border-bottom: 1px solid var(--hairline);
    background: transparent;
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .eco-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-left: 3px solid rgba(22, 32, 50, 0.09);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.78);
  }

  .eco-table tbody td::before {
    content: attr(data-tool-label);
    font-family: var(--mono);
    font-size: var(--fs-label);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink-muted);
  }

  .eco-table tbody td[data-col-tool="refract"] {
    border-left-color: var(--cerulean);
  }

  .eco-table tbody td[data-col-tool="refract"]::before {
    color: var(--cerulean-deep);
  }

  .eco-table tbody td.is-col-highlighted {
    background: rgba(14, 165, 233, 0.13);
  }

  .eco-table tbody td.is-col-paired {
    background: rgba(20, 184, 166, 0.11);
  }

  .eco-table tbody td.is-col-dimmed {
    background: rgba(243, 239, 228, 0.55);
  }
  .eco-section {
    padding: 2.25rem 0.9rem 3rem;
  }

  .eco-cards-grid,
  .eco-pairings-grid {
    grid-template-columns: 1fr;
  }
}
/* ------------------------------------------------------------------------
   Mobile matrix: the <=720px card-stack above is authoritative at every
   phone width. It converts the six-column table into per-row progressive
   disclosure cards, so no viewport below 721px ever forces the legacy
   980px horizontal-scroll table. Keep this note so future edits do not
   re-introduce a mobile min-width override.
   ------------------------------------------------------------------------ */
