body[data-page="compare"] .compare-page {
  width: min(100% - 32px, 1240px);
  margin: 0 auto;
}

.compare-intro {
  padding-bottom: 8px;
}

.compare-intro h1 {
  margin: 8px 0;
}

.compare-intro p:not(.eyebrow) {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.compare-back-link {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.compare-back-link:hover,
.compare-back-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.compare-workspace {
  display: grid;
  gap: var(--operations-space);
  padding-top: 0;
}

.compare-selection-panel,
.compare-notice,
.compare-column-heading,
.compare-tray {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.compare-selection-panel {
  display: grid;
  gap: 12px;
  padding: var(--operations-space);
}

.compare-selection-panel h2,
.compare-table-title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.compare-selection-panel p,
.compare-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.compare-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compare-picker select {
  min-width: min(100%, 280px);
  min-height: 40px;
  flex: 1 1 260px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.compare-picker select:focus-visible,
.compare-selection-panel button:focus-visible,
.compare-tray a:focus-visible,
.compare-tray button:focus-visible,
.compare-chip button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.compare-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--blue-2);
  color: var(--text);
  font-size: 14px;
}

.compare-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-chip button,
.compare-tray button {
  min-width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.compare-chip button:hover,
.compare-tray button:hover {
  background: var(--surface);
  color: var(--ink);
}

.compare-notice {
  padding: 12px var(--operations-space);
}

.compare-notice[data-tone="warning"] {
  border-color: var(--mode-badge-border);
  background: var(--mode-badge-background);
}

.compare-notice[data-tone="warning"] p {
  color: var(--mode-badge-text);
}

.compare-table-section {
  display: grid;
  gap: 12px;
}

.compare-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-overflow-scrolling: touch;
}

.compare-data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.compare-data-table th,
.compare-data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  word-break: break-word;
}

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

.compare-data-table tbody th {
  width: 132px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.compare-data-table thead th {
  background: var(--bg-2);
}

.compare-data-table thead th:first-child {
  width: 132px;
  color: var(--muted);
}

.compare-column-heading {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.compare-column-heading a {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
}

.compare-column-heading a:hover,
.compare-column-heading a:focus-visible {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.compare-column-heading small,
.compare-data-table td {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.compare-column-heading small,
.compare-locked-copy {
  color: var(--muted);
}

.compare-locked-badge {
  display: inline-flex;
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid var(--mode-badge-border);
  border-radius: var(--radius);
  color: var(--mode-badge-text);
  font-size: 12px;
  font-weight: 700;
}

.compare-data-table a:not(.primary-btn) {
  color: var(--blue);
  font-weight: 700;
}

.compare-disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.compare-tray {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: calc(var(--layer-popover) - 1);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 8px;
}

.compare-tray[hidden] {
  display: none;
}

body[data-page="compare"] .compare-tray {
  display: none;
}

.compare-tray-count {
  padding: 0 4px;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compare-tray-feedback {
  color: var(--mode-badge-text);
  font-size: 12px;
  line-height: 1.35;
}

.compare-tray a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--surface);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.compare-tray a:hover {
  filter: brightness(0.96);
}

[data-compare-product][data-compare-limit="true"] {
  border-color: var(--mode-badge-border);
  color: var(--mode-badge-text);
}

.compare-product-wrap {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.compare-product-wrap .product-card {
  min-height: 0;
  flex: 1 1 auto;
}

.compare-product-wrap [data-compare-product] {
  width: 100%;
}

@media (max-width: 720px) {
  body[data-page="compare"] .compare-page {
    width: min(100% - 24px, 1240px);
  }

  .compare-intro {
    padding-top: 8px;
  }

  .compare-table-scroll {
    margin-inline: -2px;
  }

  .compare-data-table th,
  .compare-data-table td {
    padding: 12px;
  }

  .compare-tray {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}
