.compare-trigger,
.compare-close {
  border: 1px solid var(--product-line-strong);
  border-radius: var(--product-control-radius);
  background: var(--product-paper);
  color: var(--product-accent);
  cursor: pointer;
}

.compare-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 16px;
  font: inherit;
  font-size: .875rem;
  font-weight: 750;
}

.compare-trigger svg,
.compare-close svg {
  flex: none;
  width: 19px;
}

.compare-trigger:hover,
.compare-trigger[aria-expanded="true"],
.compare-close:hover {
  border-color: var(--product-accent);
  background: var(--product-accent-soft);
  color: var(--product-accent-strong);
}

.product-comparison {
  scroll-margin-top: 62px;
  padding-block: clamp(26px, 4vw, 50px);
  border-bottom: 1px solid var(--product-line);
  background: var(--product-canvas);
}

.compare-panel {
  container-type: inline-size;
}

.compare-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: clamp(14px, 2vw, 20px);
  border-bottom: 1px solid var(--product-line-strong);
}

.compare-heading h2 {
  margin: 0;
  color: var(--product-ink);
  font-size: clamp(1.625rem, 3vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.compare-heading h2:focus {
  outline: 0;
}

.compare-heading p {
  margin: 6px 0 0;
  color: var(--product-muted);
  font-size: .875rem;
  font-weight: 650;
}

.compare-close {
  display: grid;
  flex: 0 0 44px;
  min-height: 44px;
  place-items: center;
  background: transparent;
}

.compare-models {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(12px, 2vw, 24px);
  margin-top: clamp(14px, 2vw, 24px);
  align-items: stretch;
}

.compare-current,
.compare-models label {
  min-width: 0;
  color: var(--product-muted);
  font-size: .8125rem;
  font-weight: 750;
}

.compare-current {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 9px 12px;
  border-radius: var(--product-control-radius);
  background: var(--product-accent-soft);
}

.compare-current img {
  flex: none;
  width: 54px;
  height: 52px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.compare-current strong {
  display: block;
  margin-top: 2px;
  color: var(--product-accent-strong);
  font-size: .975rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.compare-models label {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

.compare-models small {
  font-size: inherit;
  font-weight: 550;
}

.compare-models select {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--product-line-strong);
  border-radius: var(--product-control-radius);
  background: var(--product-paper);
  color: var(--product-accent-strong);
  color-scheme: light;
  font: inherit;
  font-size: .9375rem;
  font-weight: 700;
  cursor: pointer;
}

.compare-models select:enabled:hover {
  border-color: var(--product-accent);
}

.compare-models select:disabled {
  background: transparent;
  color: var(--product-muted);
  cursor: default;
}

@supports (appearance: base-select) and selector(::picker(select)) {
  .compare-models select,
  .compare-models select::picker(select) { appearance: base-select; }

  .compare-models select {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    -webkit-tap-highlight-color: transparent;
  }

  .compare-models select:open { border-color: var(--product-accent); }

  .compare-models selectedcontent {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .compare-models select::picker-icon {
    box-sizing: border-box;
    flex: none;
    width: 7px;
    height: 7px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    color: var(--product-accent);
    content: "";
    transform: translateY(-2px) rotate(45deg);
  }

  .compare-models select:open::picker-icon { transform: translateY(2px) rotate(225deg); }
  .compare-models select:disabled::picker-icon { color: inherit; }

  .compare-models select::picker(select) {
    box-sizing: border-box;
    inline-size: anchor-size(width);
    max-block-size: min(22rem, 45dvh);
    margin-block: 5px;
    padding: 4px;
    border: 1px solid var(--product-line-strong);
    border-radius: var(--product-control-radius);
    background: var(--product-paper);
    box-shadow: var(--product-shadow);
    color: var(--product-accent-strong);
    scrollbar-color: #8b9eae var(--product-accent-soft);
    overscroll-behavior: contain;
  }

  .compare-models option {
    align-items: center;
    gap: 8px;
    min-block-size: 44px;
    padding: 7px 9px;
    border-radius: 5px;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .compare-models option:first-child:not(:checked) { color: var(--product-muted); }
  .compare-models option:checked { background: var(--product-surface); color: var(--product-accent); font-weight: 750; }
  .compare-models option:is(:hover, :focus-visible) { background: var(--product-accent-soft); }
  .compare-models option:focus-visible { outline-offset: -2px; }
}

.compare-status,
.compare-note,
.compare-scroll-note {
  margin: 12px 0 0;
  color: var(--product-muted);
  font-size: .8125rem;
  line-height: 1.5;
}

.compare-status { margin-top: 16px; }

.compare-scroll-note { display: none; }

.compare-table-scroll {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid var(--product-line);
  border-radius: var(--product-radius);
  background: var(--product-paper);
  scrollbar-color: #8b9eae var(--product-accent-soft);
}

.compare-table {
  width: 100%;
  min-width: 18.75rem;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--product-ink);
  text-align: left;
  font-size: .875rem;
  line-height: 1.45;
}

.compare-table-scroll[data-model-count="3"] .compare-table { min-width: 34rem; }

.compare-table :is(th, td) {
  padding: 12px clamp(10px, 1.6vw, 20px);
  border-bottom: 1px solid var(--product-line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.compare-table thead th {
  padding-block: 15px;
  border-bottom-color: var(--product-line-strong);
  background: var(--product-surface);
  color: var(--product-accent-strong);
  font-weight: 800;
}

.compare-table tr > :first-child {
  position: sticky;
  z-index: 1;
  inset-inline-start: 0;
  width: 24%;
  border-inline-end: 1px solid var(--product-line);
  background: var(--product-surface);
}

.compare-table tbody th { font-weight: 700; }
.compare-table tr > :nth-child(2) { background: #f0f4f8; }
.compare-table thead th:nth-child(2) { background: #e7edf3; }
.compare-table tbody tr:last-child > * { border-bottom: 0; }
.compare-table td { font-variant-numeric: tabular-nums; }
.compare-table td[data-compare-missing] { color: var(--product-muted); }

.compare-table th a {
  color: var(--product-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.compare-table th a:hover { color: var(--product-accent-strong); }

@media (max-width: 740px) {
  .compare-models {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-current,
  .compare-models label:nth-child(2):last-child { grid-column: 1 / -1; }

  .compare-table :is(th, td) { font-size: .8125rem; }
  .compare-table tr > :first-child { width: 6.5rem; }
}

@media (max-width: 540px) {
  .compare-models { grid-template-columns: minmax(0, 1fr); }
}

@container (width < calc(34rem + 2px)) {
  .compare-scroll-note[data-model-count="3"] { display: block; }
}

@container (width < calc(18.75rem + 2px)) {
  .compare-scroll-note[data-model-count="2"] { display: block; }
}
