.card-utilities {
  position: absolute;
  z-index: 4;
  top: 13px;
  right: 13px;
  display: flex;
  gap: 8px;
}

.card-utilities .save-action,
.compare-action {
  position: static;
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--navy);
  box-shadow: 0 5px 16px rgba(4, 24, 45, .12);
  backdrop-filter: blur(12px);
}

.compare-action svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.compare-action:hover,
.compare-action:focus-visible,
.card-utilities .save-action:hover,
.card-utilities .save-action:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(215, 170, 79, .28), 0 5px 16px rgba(4, 24, 45, .14);
}

.compare-action.selected,
.card-utilities .save-action.saved {
  background: var(--navy);
  color: #fff;
}

.property-card[data-open-property] .promotion-card-badge {
  right: 112px;
}

.compare-tray-root {
  position: fixed;
  z-index: 66;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(620px, calc(100% - 144px));
  transform: translateX(-50%);
  pointer-events: none;
}

.compare-tray-root[hidden] {
  display: none;
}

.compare-tray {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 9px 8px 14px;
  border: 1px solid rgba(6, 38, 74, .15);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  color: var(--navy);
  box-shadow: 0 16px 42px rgba(6, 38, 74, .18);
  backdrop-filter: blur(18px) saturate(130%);
  pointer-events: auto;
}

.compare-tray-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.compare-tray-copy strong {
  font-size: 13px;
}

.compare-tray-copy span {
  overflow: hidden;
  color: #6f7b89;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-tray-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.compare-tray-open,
.compare-tray-clear {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 850;
}

.compare-tray-open {
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
}

.compare-tray-open:disabled {
  cursor: default;
  border-color: rgba(6, 38, 74, .12);
  background: #e8edf2;
  color: #7b8794;
}

.compare-tray-clear {
  border: 1px solid rgba(6, 38, 74, .13);
  background: #fff;
  color: var(--navy);
}

.property-detail-active .compare-tray-root {
  bottom: max(96px, calc(78px + env(safe-area-inset-bottom)));
}

.compare-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 0 72px;
}

.compare-page-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.compare-page-head h1,
.compare-page-empty h1 {
  margin: 8px 0 10px;
  color: var(--navy);
}

.compare-page-head > p:last-child,
.compare-page-empty > p:last-child {
  color: #657282;
}

.compare-back {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 800;
}

.compare-scroll {
  overflow-x: auto;
  border: 1px solid rgba(6, 38, 74, .12);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(6, 38, 74, .08);
}

.compare-grid {
  display: grid;
  grid-template-columns: minmax(148px, .72fr) repeat(var(--compare-count), minmax(240px, 1fr));
  min-width: calc(148px + (var(--compare-count) * 240px));
}

.compare-corner,
.compare-property-head,
.compare-row-label,
.compare-cell {
  border-right: 1px solid rgba(6, 38, 74, .09);
  border-bottom: 1px solid rgba(6, 38, 74, .09);
}

.compare-property-head {
  min-height: 176px;
  padding: 20px;
}

.compare-property-head h2 {
  margin: 8px 0;
  color: var(--navy);
  font-size: 18px;
  line-height: 1.25;
}

.compare-property-head > p:not(.compare-property-type) {
  margin: 0 0 14px;
  color: #687585;
  font-size: 12px;
}

.compare-property-type {
  margin: 0;
  color: #8a6a1e;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.compare-property-head button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(6, 38, 74, .14);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.compare-row {
  display: contents;
}

.compare-row-label,
.compare-cell {
  padding: 14px 16px;
}

.compare-row-label {
  background: #f7f8f8;
  color: #6c7886;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.compare-cell {
  color: var(--navy);
  font-size: 13px;
  font-weight: 750;
}

.compare-cell.missing {
  color: #8d97a2;
  font-weight: 600;
}

.compare-page-empty {
  max-width: 720px;
}

@media (max-width: 680px) {
  .property-card[data-open-property] .promotion-card-badge {
    right: 108px;
  }

  .compare-tray-root {
    bottom: max(76px, calc(58px + env(safe-area-inset-bottom)));
    width: calc(100% - 28px);
  }

  .property-detail-active .compare-tray-root {
    bottom: max(112px, calc(94px + env(safe-area-inset-bottom)));
  }

  .compare-tray {
    min-height: 54px;
    padding-left: 12px;
    border-radius: 16px;
  }

  .compare-tray-copy span {
    max-width: 36vw;
  }

  .compare-tray-open,
  .compare-tray-clear {
    padding: 0 10px;
  }

  .compare-page {
    padding-top: 20px;
  }

  .compare-grid {
    grid-template-columns: 120px repeat(var(--compare-count), minmax(220px, 1fr));
    min-width: calc(120px + (var(--compare-count) * 220px));
  }

  .compare-property-head {
    padding: 16px;
  }
}

/* Buyer-journey fix 2026-11-09: never cover an open form, and leave room so
   the floating tray does not sit on top of the last content on the page. */
body:has(.sheet-backdrop:not([hidden])) .compare-tray-root {
  display: none;
}

body:has(.compare-tray-root:not([hidden])) {
  padding-bottom: 96px;
}

/* Compare polish 2026-11-09: photo, per-property actions, not-applicable cells. */
.compare-property-media {
  display: grid;
  height: 120px;
  margin: -20px -20px 14px;
  overflow: hidden;
  place-items: end start;
  padding: 12px;
  background: linear-gradient(145deg, #082d55, #315f77);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 15px;
}

.compare-property-media img {
  width: calc(100% + 24px);
  height: 120px;
  margin: -12px;
  object-fit: cover;
}

.compare-property-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.compare-property-head .compare-save.saved {
  border-color: #d7aa2f;
  background: #fff8e6;
}

.compare-property-head .compare-remove {
  border-color: transparent;
  background: transparent;
  color: #687585;
  text-decoration: underline;
}

.compare-verify {
  display: block;
  width: 132px;
  height: 36px;
}

.compare-verify img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.compare-cell.not-applicable {
  color: #b2bac3;
  font-weight: 600;
}
