/* Comparison page components use the shared Callimachus tokens and fonts. */
.comparison-page {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

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

.comparison-page button:not(.theme-toggle),
.comparison-page select {
  font: inherit;
}

.comparison-page button {
  color: var(--ink);
  cursor: pointer;
}

.comparison-page [hidden] {
  display: none !important;
}

.cmp-shell {
  width: min(calc(100% - 48px), var(--content));
  margin-inline: auto;
}

.cmp-skip {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 16px;
  transform: translateY(-170%);
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.cmp-skip:focus {
  transform: translateY(0);
}



.cmp-intro {
  padding: 43px 0 30px;
}

.cmp-intro h1 {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.cmp-lede {
  max-width: 78ch;
  margin: 15px 0 0;
  color: var(--ink-2);
  font-size: 1.04rem;
  line-height: 1.65;
}

.cmp-review-note {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.cmp-ref {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-left: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  vertical-align: baseline;
}

.cmp-ref:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.cmp-inline-refs,
.cmp-source-fallback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.cmp-ref-fallback {
  min-height: 24px;
  padding-inline: 5px;
  font: 500 10px/1.4 var(--mono);
}

.cmp-section {
  scroll-margin-top: 92px;
}

.cmp-section-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

.cmp-section-top h2,
.cmp-reading h2,
.cmp-source-top h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.cmp-section-top p {
  max-width: 55ch;
  margin: 0;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.cmp-noscript {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.cmp-toolbar {
  padding: 12px 14px 0;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface);
}

.cmp-toolbar-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.cmp-modes,
.cmp-display {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px;
  border-radius: 6px;
  background: var(--surface-3);
}

.cmp-mode {
  padding: 7px 11px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2) !important;
  font-size: 13px !important;
  white-space: nowrap;
}

.cmp-mode[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent-deep) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.cmp-select {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-2);
  font-size: 13px;
}

.cmp-select select {
  max-width: 260px;
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

.cmp-stage-details {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.cmp-stage-details summary {
  width: fit-content;
  padding: 10px 2px 9px;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 13px;
}

.cmp-stage-details summary:hover {
  color: var(--accent-deep);
}

.cmp-filters {
  display: flex;
  gap: 5px;
  padding: 0 0 12px;
  overflow-x: auto;
}

.cmp-filter {
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2) !important;
  font-size: 13px !important;
  white-space: nowrap;
}

.cmp-filter[aria-pressed="true"] {
  border-color: var(--line-2);
  background: var(--surface-2);
  color: var(--accent-deep) !important;
  font-weight: 600;
}

.cmp-table-frame {
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cmp-table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--line-2) var(--surface-2);
  scrollbar-width: thin;
}

.cmp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
}

.cmp-table caption {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
}

.cmp-table thead th {
  position: sticky;
  z-index: 5;
  top: 0;
  width: calc((100% - 230px) / 2);
  padding: 16px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
  text-align: left;
  vertical-align: top;
}

.cmp-table thead th:first-child {
  left: 0;
  z-index: 7;
  width: 230px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

.cmp-table thead th.cmp-calli {
  border-top: 3px solid var(--accent);
  padding-top: 13px;
  background: var(--accent-soft);
}

.cmp-system-name {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.cmp-system-kind {
  display: block;
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.4;
}

.cmp-header-link {
  display: inline-flex;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-deep) !important;
  font-size: 12px !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cmp-table tbody th.cmp-feature {
  position: sticky;
  z-index: 3;
  left: 0;
  width: 230px;
  padding: 15px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  text-align: left;
  vertical-align: top;
}

.cmp-feature-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.cmp-feature-question {
  display: block;
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.cmp-table td {
  padding: 15px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  vertical-align: top;
}

.cmp-table td:last-child {
  border-right: 0;
}

.cmp-table td[data-status="documented"] {
  background: color-mix(in srgb, var(--ok-soft) 34%, var(--surface));
}

.cmp-table td[data-status="different"] {
  background: color-mix(in srgb, var(--accent-soft) 34%, var(--surface));
}

.cmp-table td[data-status="partial"] {
  background: color-mix(in srgb, var(--warn-soft) 34%, var(--surface));
}

.cmp-table td[data-status="unknown"] {
  background: color-mix(in srgb, var(--neutral-soft) 48%, var(--surface));
}

.cmp-table td[data-status="out"] {
  background: color-mix(in srgb, var(--danger-soft) 30%, var(--surface));
}

.cmp-cell-text {
  min-height: 22px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

.cmp-cell-text.unknown {
  color: var(--ink-2);
}

.cmp-cell-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.cmp-cell-evidence {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
}

.cmp-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.cmp-table td[data-status="documented"] .cmp-status {
  border-color: color-mix(in srgb, var(--ok) 38%, transparent);
  background: var(--ok-soft);
  color: var(--ok);
}

.cmp-table td[data-status="different"] .cmp-status {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

.cmp-table td[data-status="partial"] .cmp-status {
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
  background: var(--warn-soft);
  color: var(--warn);
}

.cmp-table td[data-status="unknown"] .cmp-status {
  border-color: color-mix(in srgb, var(--neutral) 36%, transparent);
  background: var(--neutral-soft);
  color: var(--neutral);
}

.cmp-table td[data-status="out"] .cmp-status {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.cmp-basis {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.4;
}

.cmp-dot {
  width: 7px;
  height: 7px;
  flex: none;
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: currentColor;
  color: var(--neutral);
}

.cmp-dot.documented {
  color: var(--ok);
}

.cmp-dot.different {
  color: var(--accent);
}

.cmp-dot.partial {
  color: var(--warn);
}

.cmp-dot.unknown {
  color: var(--neutral);
}

.cmp-dot.out {
  color: var(--danger);
}

.cmp-cell-refs {
  display: flex;
  flex-wrap: wrap;
}

.cmp-cell-refs .cmp-ref {
  min-height: 27px;
  margin: 0;
  padding-inline: 7px;
  font-size: 12px;
}

.cmp-rowgroup th {
  padding: 9px 16px;
  border-block: 1px solid var(--line-2);
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

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

.cmp-summary-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
}

.cmp-legend {
  margin: 3px 0 15px;
  padding: 0 2px;
  color: var(--ink-2);
  font-size: 13px;
}

.cmp-legend-note {
  margin: 0 0 8px;
}

.cmp-legend-items {
  display: flex;
  gap: 9px 18px;
  flex-wrap: wrap;
}

.cmp-legend-items span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cmp-legend-symbol {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.cmp-legend-symbol.documented { color: var(--ok); }
.cmp-legend-symbol.different { color: var(--accent); }
.cmp-legend-symbol.partial { color: var(--warn); }
.cmp-legend-symbol.unknown { color: var(--neutral); }
.cmp-legend-symbol.out { color: var(--danger); }

body[data-display="summary"] .cmp-detail-content,
body[data-display="summary"] .cmp-feature-question,
body[data-display="summary"] .cmp-system-kind,
body[data-display="summary"] .cmp-header-link {
  display: none !important;
}

body[data-display="summary"] .cmp-summary-content {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body[data-display="summary"] .cmp-summary-mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--surface);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

body[data-display="summary"] .cmp-summary-mark[data-status="documented"] {
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  background: var(--ok-soft);
  color: var(--ok);
}

body[data-display="summary"] .cmp-summary-mark[data-status="different"] {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

body[data-display="summary"] .cmp-summary-mark[data-status="partial"] {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: var(--warn-soft);
  color: var(--warn);
}

body[data-display="summary"] .cmp-summary-mark[data-status="unknown"] {
  border-color: color-mix(in srgb, var(--neutral) 40%, transparent);
  background: var(--neutral-soft);
  color: var(--neutral);
}

body[data-display="summary"] .cmp-summary-mark[data-status="out"] {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

body[data-display="summary"] .cmp-summary-source-fallback {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  font: 500 10px/1.4 var(--mono);
  flex-wrap: wrap;
}

body[data-display="summary"] .cmp-summary-source-fallback a {
  color: var(--accent-deep);
}

body[data-display="details"] .cmp-summary-content {
  display: none;
}

body[data-display="summary"]:not([data-mode="focus"]) .cmp-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

body[data-display="summary"] .cmp-table thead th:first-child,
body[data-display="summary"] .cmp-table tbody th.cmp-feature {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

body[data-display="summary"] .cmp-table thead th {
  padding: 10px 6px;
  text-align: center;
  vertical-align: middle;
}

body[data-display="summary"] .cmp-table thead th:first-child {
  text-align: left;
}

body[data-display="summary"] .cmp-table td {
  padding: 4px 6px;
  vertical-align: middle;
}

body[data-display="summary"] .cmp-table tbody th.cmp-feature {
  padding: 6px 12px;
  vertical-align: middle;
}

body[data-display="summary"] .cmp-rowgroup th {
  padding: 5px 12px;
}

body[data-display="summary"]:not([data-mode="focus"]) .cmp-table thead th:not(:first-child),
body[data-display="summary"]:not([data-mode="focus"]) .cmp-table td[data-system-cell] {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

body[data-display="summary"] .cmp-system-name {
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: normal;
}

body[data-display="summary"] .cmp-table th.cmp-calli .cmp-system-name {
  white-space: nowrap;
}

body[data-display="summary"]:not([data-mode="focus"]) .cmp-table th.cmp-calli,
body[data-display="summary"]:not([data-mode="focus"]) .cmp-table td.cmp-calli {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}

body[data-display="summary"] .cmp-table thead th.cmp-calli {
  border-top: 0;
  border-right: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  background: var(--accent);
}

body[data-display="summary"] .cmp-table thead th.cmp-calli .cmp-system-name {
  color: var(--accent-ink);
}

body[data-display="summary"]:not([data-mode="focus"]) .cmp-table thead th.cmp-calli,
body[data-display="summary"]:not([data-mode="focus"]) .cmp-table td.cmp-calli {
  position: sticky;
  left: 220px;
  z-index: 6;
  border-right: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

body[data-display="summary"]:not([data-mode="focus"]) .cmp-table td.cmp-calli {
  z-index: 4;
}

body[data-display="summary"]:not([data-mode="focus"]) .cmp-table tbody th.cmp-feature {
  z-index: 5;
}

body[data-display="summary"][data-mode="focus"] .cmp-table thead th:not(:first-child),
body[data-display="summary"][data-mode="focus"] .cmp-table td[data-system-cell] {
  width: calc((100% - 220px) / 2);
  min-width: 120px;
}

body:not([data-mode="focus"]) .cmp-table {
  width: max-content;
  min-width: 100%;
}

body:not([data-mode="focus"]) .cmp-table thead th:not(:first-child),
body:not([data-mode="focus"]) .cmp-table td[data-system-cell] {
  width: 245px;
  min-width: 245px;
  max-width: 245px;
}

body:not([data-mode="focus"]) .cmp-table th.cmp-calli,
body:not([data-mode="focus"]) .cmp-table td.cmp-calli {
  width: 270px;
  min-width: 270px;
  max-width: 270px;
}

body:not([data-mode="focus"]) .cmp-table th.cmp-feature {
  min-width: 230px;
  max-width: 230px;
}

.cmp-reading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  margin: 48px 0;
  padding-top: 26px;
  border-top: 1px solid var(--line-2);
}

.cmp-reading > div:first-child p {
  max-width: 68ch;
  margin: 13px 0 0;
  color: var(--ink-2);
  font-size: 15px;
}

.cmp-reading ul {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cmp-reading li {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.cmp-reading li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cmp-reading h3 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 650;
}

.cmp-reading li p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

.cmp-sources {
  padding-top: 25px;
  border-top: 1px solid var(--line-2);
  scroll-margin-top: 90px;
}

.cmp-source-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.cmp-source-top p {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

.cmp-button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--accent-deep) !important;
  font-size: 14px !important;
  font-weight: 600;
  white-space: nowrap;
}

.cmp-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cmp-source-group {
  margin-bottom: 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.cmp-source-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.cmp-source-group summary span {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 400;
}

.cmp-source-list {
  padding: 0 16px 12px;
}

.cmp-source-entry {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.cmp-source-id {
  padding-top: 2px;
  color: var(--ink-2);
  font: 500 12px/1.5 var(--mono);
}

.cmp-source-entry h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.cmp-source-entry h3 a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cmp-source-entry p {
  margin: 5px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
}

.cmp-source-meta {
  font-size: 12px !important;
}

.cmp-source-entry code {
  display: inline-block;
  max-width: 100%;
  margin-top: 5px;
  color: var(--ink-2);
  font: 12px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

.cmp-source-entry .cmp-source-note {
  color: var(--ink-2);
  font-size: 13px;
}

.cmp-footer {
  margin-top: 40px;
  padding: 24px 0;
  background: var(--nav);
  color: var(--nav-ink);
}

.cmp-footer .cmp-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cmp-footer p {
  max-width: 65ch;
  margin: 0;
  color: var(--nav-ink-2);
  font-size: 13px;
}

.cmp-footer-links {
  display: flex;
  gap: 20px;
  white-space: nowrap;
}

.cmp-footer a {
  color: var(--nav-ink);
  font-size: 13px;
}

.cmp-dialog {
  width: min(660px, calc(100% - 32px));
  max-height: 85vh;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.cmp-dialog::backdrop {
  background: rgba(8, 20, 30, 0.55);
  backdrop-filter: blur(3px);
}

.cmp-dialog-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.cmp-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-deep);
  font: 500 12px/1.4 var(--mono);
}

.cmp-dialog-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.cmp-close {
  display: grid;
  place-items: center;
  padding: 0;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 20px !important;
  line-height: 1;
}

.cmp-close-icon {
  display: block;
}

.cmp-dialog-body {
  max-height: calc(85vh - 75px);
  padding: 18px 24px 24px;
  overflow: auto;
}

.cmp-dialog-claim {
  margin: 0 0 13px;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 550;
}

.cmp-dialog-qualifier {
  margin: 12px 0;
  padding: 10px 13px;
  border-left: 2px solid var(--accent);
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 14px;
}

.cmp-dialog-location {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 13px;
}

.cmp-dialog-source {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.cmp-dialog-source a {
  display: block;
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 600;
}

.cmp-dialog-source p {
  margin: 5px 0 0;
  color: var(--ink-2);
  font-size: 13px;
}

.cmp-dialog-source code {
  display: block;
  margin-top: 7px;
  color: var(--ink-2);
  font: 12px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

.cmp-dialog-footnote {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

@media (max-width: 900px) {
  .cmp-shell {
    width: min(calc(100% - 40px), var(--content));
  }

  .cmp-section-top {
    align-items: start;
    flex-direction: column;
    gap: 9px;
  }

  .cmp-reading {
    gap: 28px;
  }
}

@media (max-width: 700px) {
  .cmp-shell {
    width: min(calc(100% - 32px), var(--content));
  }

  .cmp-intro {
    padding: 31px 0 24px;
  }

  .cmp-intro h1 {
    font-size: 2.15rem;
  }

  .cmp-lede {
    font-size: 15px;
  }

  .cmp-review-note {
    font-size: 13px;
  }

  .cmp-toolbar {
    padding: 10px 10px 0;
  }

  .cmp-toolbar-line {
    align-items: stretch;
  }

  .cmp-modes,
  .cmp-display {
    width: 100%;
    flex-wrap: nowrap;
  }

  .cmp-mode {
    flex: 1;
    padding-inline: 5px;
    font-size: 12px !important;
  }

  .cmp-select {
    width: 100%;
    justify-content: space-between;
  }

  .cmp-select select {
    max-width: 64%;
    flex: 1;
  }

  .cmp-table caption {
    padding: 10px 12px;
  }

  .cmp-summary-bar {
    display: block;
    padding: 9px 12px;
    font-size: 12px;
  }

  .cmp-summary-bar span + span {
    display: block;
    margin-top: 3px;
  }

  .cmp-legend-items {
    gap: 9px 14px;
    font-size: 12px;
  }

  .cmp-reading {
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 34px 0;
    padding-top: 22px;
  }

  .cmp-reading > div:first-child p {
    font-size: 14px;
  }

  .cmp-source-top {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }

  .cmp-source-top p {
    font-size: 13px;
  }

  .cmp-source-group summary {
    padding: 12px;
    font-size: 14px;
  }

  .cmp-source-list {
    padding-inline: 12px;
  }

  .cmp-source-entry {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
  }

  .cmp-source-entry h3 {
    font-size: 14px;
  }

  .cmp-footer .cmp-shell {
    align-items: start;
    flex-direction: column;
    gap: 15px;
  }

  .cmp-footer-links {
    gap: 16px;
    flex-wrap: wrap;
  }

  .cmp-dialog-head,
  .cmp-dialog-body {
    padding-inline: 18px;
  }

  .cmp-dialog-head {
    padding-top: 17px;
    padding-bottom: 13px;
  }

  body[data-mode="focus"] .cmp-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  body[data-mode="focus"] .cmp-table caption {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  body[data-mode="focus"] .cmp-table thead {
    display: block;
    width: 100%;
    background: var(--surface);
  }

  body[data-mode="focus"] .cmp-table thead tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body[data-mode="focus"] .cmp-table thead th:first-child {
    display: none;
  }

  body[data-mode="focus"] .cmp-table thead th {
    position: static;
    width: auto;
    min-width: 0;
    padding: 12px;
  }

  body[data-mode="focus"] .cmp-table tbody {
    display: block;
  }

  body[data-mode="focus"] .cmp-table tr.cmp-rowgroup {
    display: block;
  }

  body[data-mode="focus"] .cmp-table tr.cmp-rowgroup th {
    display: block;
    padding: 9px 12px;
  }

  body[data-mode="focus"] .cmp-table tr[data-feature] {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body[data-mode="focus"] .cmp-table th.cmp-feature {
    position: static;
    grid-column: 1 / -1;
    width: auto;
    padding: 11px 12px;
    border-right: 0;
    background: var(--surface-3);
  }

  body[data-mode="focus"] .cmp-table td {
    display: block;
    min-width: 0;
    max-width: none;
    padding: 12px;
  }

  body[data-display="summary"][data-mode="focus"] .cmp-table th.cmp-calli,
  body[data-display="summary"][data-mode="focus"] .cmp-table td.cmp-calli {
    position: static;
    left: auto;
    z-index: auto;
  }

  body[data-display="summary"][data-mode="focus"] .cmp-table thead th:not(:first-child),
  body[data-display="summary"][data-mode="focus"] .cmp-table td[data-system-cell] {
    width: auto;
    min-width: 0;
    max-width: none;
  }

  body[data-mode="focus"] .cmp-cell-text {
    font-size: 13px;
  }

  body[data-mode="focus"] .cmp-cell-bottom {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 390px) {
  .cmp-mode {
    font-size: 11px !important;
  }
}

@media (max-width: 640px) {
  body[data-display="summary"]:not([data-mode="focus"]) .cmp-table thead th:first-child,
  body[data-display="summary"]:not([data-mode="focus"]) .cmp-table tbody th.cmp-feature {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
  }

  body[data-display="summary"]:not([data-mode="focus"]) .cmp-table thead th:not(:first-child),
  body[data-display="summary"]:not([data-mode="focus"]) .cmp-table td[data-system-cell] {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
  }

  body[data-display="summary"]:not([data-mode="focus"]) .cmp-table thead th.cmp-calli,
  body[data-display="summary"]:not([data-mode="focus"]) .cmp-table td.cmp-calli {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    left: 140px;
  }
}

@media print {
  .masthead,
  .cmp-toolbar,
  .cmp-dialog,
  .cmp-header-link,
  .cmp-source-top button,
  .cmp-footer {
    display: none !important;
  }

  .cmp-shell {
    width: 100%;
    max-width: none;
  }

  .cmp-intro {
    padding-block: 18px;
  }

  .cmp-table-scroll {
    overflow: visible;
  }

  .cmp-table thead th,
  .cmp-table tbody th.cmp-feature {
    position: static;
  }

  .cmp-table-frame {
    box-shadow: none;
  }

  .cmp-table tr,
  .cmp-source-entry {
    break-inside: avoid;
  }

  .cmp-source-list {
    display: block !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .comparison-page {
    scroll-behavior: auto;
  }
}
