/* Guest comparison uses the site's shared graphite panels and red outlines. */
.ac-compare-page .ac-comparison {
  padding: 34px 0 60px;
}

.ac-compare-heading {
  margin-bottom: 24px;
}

.ac-compare-heading h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.ac-compare-heading p {
  max-width: 760px;
  margin: 0;
  color: var(--ac-muted, #a4b2c1);
  font-size: 16px;
  line-height: 1.7;
}

.ac-compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

:is(.ac-compare-toolbar button, .ac-compare-toolbar a, .ac-compare-detail, .ac-compare-go, .ac-compare-tray-actions button, .ac-compare-tray-inner > button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 15px;
  border: 1px solid #82404b;
  border-radius: 9px;
  background: #281e27;
  color: #e0c3c9;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s;
}

:is(.ac-compare-toolbar button, .ac-compare-toolbar a, .ac-compare-detail, .ac-compare-go, .ac-compare-tray-actions button, .ac-compare-tray-inner > button):hover {
  background: #39232c;
  border-color: #ba4653;
  color: #fff;
  text-decoration: none;
}

:is(.ac-compare-toolbar button, .ac-compare-detail, .ac-compare-add)[aria-pressed="true"] {
  background: #3b202a;
  border-color: #bd3f4d;
  color: #f4c1c8;
}

:is(.ac-compare-toolbar button, .ac-compare-detail, .ac-compare-add, .ac-compare-go):active {
  box-shadow: inset 0 2px 5px #0004;
}

:is(.ac-compare-toolbar button, .ac-compare-add, .ac-compare-detail, .ac-compare-go):disabled,
.ac-compare-go[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
}

.ac-compare-notice,
.ac-compare-empty {
  padding: 20px 24px;
  margin-bottom: 22px;
  border: 1px solid #2c3947;
  border-radius: 14px;
  background: linear-gradient(145deg, #17222d, #131c25);
  color: var(--ac-muted, #a4b2c1);
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.ac-compare-empty {
  padding: 36px 28px;
}

.ac-compare-empty h2 {
  margin: 0 0 12px;
  font-size: 25px;
  line-height: 1.35;
}

.ac-compare-empty p {
  max-width: 640px;
  margin: 0 0 20px;
}

.ac-compare-notice p:last-child,
.ac-compare-empty p:last-child {
  margin-bottom: 0;
}

/* Only horizontal overflow is contained. The page remains the vertical scroller. */
.ac-compare-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #2c3947;
  border-radius: 16px;
  background: #141e28;
  scrollbar-width: thin;
  scrollbar-color: #59606c #111a23;
  overscroll-behavior-x: contain;
}

.ac-compare-table {
  --compare-label-width: 160px;
  --compare-mod-width: 240px;
  width: 100%;
  min-width: calc(var(--compare-label-width) + var(--compare-count, 2) * var(--compare-mod-width));
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--ac-text, #e8edf2);
  font-size: 15px;
  line-height: 1.6;
}

.ac-compare-table col:first-child {
  width: var(--compare-label-width);
}

.ac-compare-table th,
.ac-compare-table td {
  padding: 16px 18px;
  border-right: 1px solid #2b3744;
  border-bottom: 1px solid #2b3744;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.ac-compare-table tr > :last-child {
  border-right: 0;
}

.ac-compare-table tbody:last-child tr:last-child > * {
  border-bottom: 0;
}

.ac-compare-table thead th {
  background: #16212c;
  font-weight: 400;
}

.ac-compare-table .ac-compare-label,
.ac-compare-table .ac-compare-row > th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #17212b;
  box-shadow: 5px 0 9px -7px #0009;
  color: #b6c3d0;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.ac-compare-table .ac-compare-label {
  z-index: 3;
  vertical-align: bottom;
}

.ac-compare-row > th .ac-icon {
  width: 17px;
  height: 17px;
  margin: 2px 5px 2px 0;
  color: #8e9eaf;
}

.ac-compare-row > th span {
  vertical-align: middle;
}

.ac-compare-table .ac-compare-section > th {
  padding: 12px 18px;
  background: #1c2833;
  color: #d2dbe5;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
}

.ac-compare-mod {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ac-compare-mod-image {
  display: block;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 10;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #2b3745;
  border-radius: 11px;
  background: #0d141b;
}

.ac-compare-mod-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ac-compare-mod-name {
  display: block;
  min-height: 4.2em;
  color: #edf2f7;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.015em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ac-compare-mod-name:hover,
.ac-compare-mod-name:focus-visible {
  color: #f4bec6;
}

.ac-compare-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  margin-top: auto;
  padding: 9px 12px;
  border: 1px solid #3e4b59;
  border-radius: 8px;
  color: #c2ceda;
  background: #1b2834;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}

.ac-compare-open:hover {
  border-color: #79505a;
  background: #282530;
  color: #f4e0e4;
}

.ac-compare-remove,
.ac-compare-tray-items button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #536070;
  border-radius: 8px;
  background: #121b25f5;
  color: #dce4ed;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition: color .16s, background-color .16s, border-color .16s;
}

.ac-compare-remove {
  position: absolute;
  top: 8px;
  right: 8px;
}

.ac-compare-remove .ac-icon,
.ac-compare-tray-items button .ac-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.ac-compare-remove:hover,
.ac-compare-tray-items button:hover {
  color: #ffd4db;
  border-color: #a74755;
  background: #3b222c;
}

.ac-compare-value {
  color: #e4ebf3;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.ac-compare-value[data-status="unknown"],
.ac-compare-value[data-status="unverified"] {
  color: #99a8b9;
  font-size: 14px;
  font-weight: 400;
}

.ac-compare-note,
.ac-compare-source {
  display: block;
  margin-top: 7px;
  color: #94a4b6;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ac-compare-source {
  color: #8192a5;
}

/* Sibling buttons overlay the image without changing catalogue card geometry. */
.ac-card-column {
  position: relative;
}

.ac-card-column > .ac-compare-add {
  position: absolute;
  z-index: 4;
  top: 58px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  max-width: calc(100% - 48px);
  padding: 8px 11px;
  border: 1px solid #77515c;
  border-radius: 8px;
  background: #151c26f5;
  color: #e2d6dc;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: color .16s, background-color .16s, border-color .16s, box-shadow .16s;
}

.ac-card-column > .ac-compare-add .ac-icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.ac-card-column > .ac-compare-add:hover {
  color: #fff;
  border-color: #b64a58;
  background: #33232e;
}

.ac-card-column > .ac-compare-add[aria-pressed="true"] {
  color: #f4c1c8;
  border-color: #bd3f4d;
  background: #3b202a;
}

.ac-related-grid .ac-card-column > .ac-compare-add {
  top: 14px;
  right: 12px;
}

.ac-compare-detail {
  width: 100%;
  margin-top: 14px;
}

/* Fixed selection tray stays clear of the final page content. */
body.ac-has-compare-tray {
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}

.ac-compare-tray {
  position: fixed;
  z-index: 1020;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: calc(100% - 32px);
  max-width: 1280px;
  transform: translateX(-50%);
  border: 1px solid #48505e;
  border-radius: 14px;
  background: #131d28f5;
  color: #e3ebf4;
  box-shadow: 0 10px 38px #0007;
  backdrop-filter: blur(14px);
}

.ac-compare-tray-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 14px 16px;
}

.ac-compare-tray-summary {
  min-width: 0;
  line-height: 1.4;
}

.ac-compare-tray-summary strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.ac-compare-tray-summary small {
  display: block;
  margin-top: 3px;
  color: #9eafc1;
  font-size: 12px;
}

.ac-compare-tray-items {
  display: flex;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 3px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #59606c transparent;
  overscroll-behavior-x: contain;
}

.ac-compare-tray-items li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  max-width: 220px;
  padding: 4px 4px 4px 11px;
  border: 1px solid #334354;
  border-radius: 8px;
  background: #1b2835;
}

.ac-compare-tray-items li > span {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ac-compare-tray-items button {
  width: 28px;
  height: 28px;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
  color: #b5c2d0;
}

.ac-compare-tray-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ac-compare-go {
  border-color: #b23f4c;
  background: #3a222b;
  color: #f6d3d9;
  white-space: nowrap;
}

.ac-compare-tray-actions button {
  border-color: #42505f;
  background: #182430;
  color: #b9c7d6;
}

.ac-comparison [hidden],
.ac-compare-row.hidden,
.ac-compare-tray[hidden],
.ac-compare-tray [hidden],
.ac-compare-add[hidden],
.ac-compare-detail[hidden] {
  display: none !important;
}

@media (max-width: 991px) {
  .ac-compare-table {
    --compare-label-width: 140px;
    --compare-mod-width: 230px;
  }

  body.ac-has-compare-tray {
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px));
  }

  .ac-compare-tray-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
  }

  .ac-compare-tray-summary {
    grid-column: 1;
    grid-row: 1;
  }

  .ac-compare-tray-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .ac-compare-tray-items {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 575px) {
  .ac-compare-page .ac-comparison {
    padding: 25px 0 42px;
  }

  .ac-compare-heading p {
    font-size: 15px;
  }

  .ac-compare-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .ac-compare-toolbar > :is(button, a) {
    width: 100%;
  }

  .ac-compare-table {
    --compare-label-width: clamp(108px, calc(100vw - 224px), 120px);
    --compare-mod-width: min(220px, calc(100vw - 40px - var(--compare-label-width) - 2px));
  }

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

  .ac-compare-table .ac-compare-row > th[scope="row"],
  .ac-compare-table .ac-compare-label {
    font-size: 13px;
  }

  .ac-compare-row > th .ac-icon {
    display: block;
    margin: 0 0 6px;
  }

  .ac-compare-mod-name {
    font-size: 17px;
  }

  .ac-compare-notice,
  .ac-compare-empty {
    padding: 20px 18px;
  }

  body.ac-has-compare-tray {
    padding-bottom: calc(184px + env(safe-area-inset-bottom, 0px));
  }

  .ac-compare-tray {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 20px);
    border-radius: 12px;
  }

  .ac-compare-tray-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .ac-compare-tray-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    grid-column: 1;
    grid-row: 1;
  }

  .ac-compare-tray-summary small {
    margin: 0;
  }

  .ac-compare-tray-items {
    grid-column: 1;
    grid-row: 2;
    padding: 3px;
  }

  .ac-compare-tray-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-column: 1;
    grid-row: 3;
  }

  .ac-compare-tray-actions > * {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ac-comparison *,
  .ac-compare-tray *,
  .ac-compare-add,
  .ac-compare-detail {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 359px) {
  .ac-compare-table .ac-compare-label,
  .ac-compare-table .ac-compare-row > th[scope="row"] {
    padding-inline: 8px;
  }
}

/* A nonmodal status message also leaves a denied clipboard link selectable. */
.ac-compare-feedback {
  position: fixed;
  z-index: 2200;
  top: 96px;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 15px 18px;
  border: 1px solid #505668;
  border-radius: 12px;
  background: #202a36;
  box-shadow: 0 12px 32px #0006;
  color: #e4ebf3;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  user-select: text;
}

.ac-compare-feedback[hidden] {
  display: none !important;
}

@media (max-width: 1099px) {
  .ac-compare-feedback { top: 82px; }
}

.ac-compare-guidance,
.ac-compare-scroll-hint {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 18px;
  color: #9eafc1;
  font-size: 14px;
  line-height: 1.65;
}

.ac-compare-guidance > .ac-icon,
.ac-compare-scroll-hint > .ac-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  margin-top: 3px;
}

.ac-compare-scroll-hint {
  margin-bottom: 12px;
  font-size: 13px;
  color: #8d9eaf;
}

.ac-compare-explanation {
  margin-top: 9px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.65;
}

.ac-compare-explanation > summary {
  width: fit-content;
  max-width: 100%;
  padding: 5px 0;
  color: #b7a7b0;
  cursor: pointer;
}

.ac-compare-explanation > summary:hover,
.ac-compare-explanation[open] > summary {
  color: #e7c2ca;
}

.ac-compare-explanation > summary:focus-visible {
  outline: 2px solid #c4828d;
  outline-offset: 2px;
  border-radius: 3px;
}

.ac-compare-explanation > p {
  margin: 7px 0 0;
  color: #9babbc;
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 575px) {
  .ac-compare-remove { width: 40px; height: 40px; }
  .ac-compare-tray-items button { width: 36px; height: 36px; }
  .ac-compare-explanation > summary { padding-block: 8px; }
}
