.sj-compare {
  clear: both;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 12px 0 8px;
  padding: 22px 20px 20px;
  background: #f7f8fb;
  border: 1px solid #e8ebf0;
  border-radius: 16px;
  font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #111827;
  overflow-x: hidden;
}
.sj-compare__head {
  margin: 0 0 16px;
}
.sj-compare__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.35;
  word-break: keep-all;
}
.sj-compare__desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #6b7280;
  word-break: keep-all;
}
.sj-compare__chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
}
.sj-compare__chips a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  line-height: 1.2;
}
.sj-compare__chips a:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
.sj-compare__carrier-tip {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: -0.03em;
  line-height: 1.45;
  word-break: keep-all;
}
.sj-compare__carrier-tip span {
  display: inline-block;
  margin-left: 6px;
  font-weight: 800;
  color: #111827;
}
.sj-compare__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.sj-compare__item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}
.sj-compare__item a {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
  padding: 14px 12px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sj-compare__item a:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
}
.sj-compare__item.is-current a {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb inset;
  background: #f8fbff;
}
.sj-compare__badges {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 22px;
  height: 22px;
  margin-bottom: 8px;
}
.sj-compare__badges em,
.sj-compare__badges b {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.sj-compare__badges em {
  color: #4b5563;
  background: #f3f4f6;
}
.sj-compare__item.is-current .sj-compare__badges em {
  color: #1d4ed8;
  background: #dbeafe;
}
.sj-compare__badges b {
  margin-left: 0;
  color: #fff;
  background: #e11d48;
}
.sj-compare__img {
  width: 88px;
  height: 88px;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: #fff center / contain no-repeat;
}
.sj-compare__img.is-empty {
  background-color: #f3f4f6;
}
.sj-compare__name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.35;
  min-height: 2.7em;
  overflow: hidden;
  word-break: keep-all;
}
.sj-compare__cond,
.sj-compare__factory {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #9ca3af;
  letter-spacing: -0.02em;
}
.sj-compare__factory {
  text-decoration: line-through;
}
.sj-compare__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin-top: 6px;
  font-size: 13px;
  color: #111827;
  letter-spacing: -0.04em;
}
.sj-compare__price i {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
}
.sj-compare__price strong {
  font-size: 20px;
  font-weight: 800;
}
.sj-compare__best-tel {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.sj-compare__tels {
  list-style: none;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px dashed #e5e7eb;
}
.sj-compare__tels li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  color: #6b7280;
  letter-spacing: -0.02em;
  line-height: 1.55;
}
.sj-compare__tels li.is-best {
  color: #1d4ed8;
  font-weight: 800;
}
.sj-compare__tels em {
  font-style: normal;
  font-weight: 700;
}
.sj-compare__diff {
  display: block;
  margin-top: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.4;
  min-height: 2.8em;
}
.sj-compare__diff.is-base { color: #2563eb; }
.sj-compare__diff.is-down { color: #e11d48; }
.sj-compare__diff.is-up { color: #6b7280; }
.sj-compare__diff.is-same { color: #6b7280; }
.sj-compare__cta {
  display: block;
  margin-top: auto;
  padding: 8px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 8px;
}
.sj-compare__item.is-current .sj-compare__cta {
  color: #374151;
  background: #eef2f7;
}

@media (max-width: 900px) {
  .detail-guides-slot:has(+ .sj-compare) .detail-guides {
    margin-bottom: 0;
    padding-bottom: 8px !important;
  }
  .sj-compare {
    margin: 0;
    padding: 12px 0 110px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    overflow-x: hidden;
  }
  .sj-compare__head {
    padding: 0 12px;
    margin-bottom: 12px;
  }
  .sj-compare__title { font-size: 16px; letter-spacing: -0.03em; }
  .sj-compare__carrier-tip { font-size: 12px; padding: 9px 11px; }
  .sj-compare__list {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    gap: 8px;
    padding: 0 12px 8px;
    box-sizing: border-box;
  }
  .sj-compare__item {
    flex: 0 0 168px;
    width: 168px;
    max-width: 168px;
    height: auto;
    align-self: stretch;
  }
  .sj-compare__name { min-height: 2.6em; font-size: 13px; }
  .sj-compare__price strong { font-size: 18px; }
  .sj-compare__cta { margin-top: auto; }
  .sj-compare__badges {
    flex-wrap: nowrap;
    height: 22px;
    min-height: 22px;
  }
  .sj-compare__badges em,
  .sj-compare__badges b {
    font-size: 10px;
    padding: 3px 5px;
    letter-spacing: -0.05em;
  }
}

.sj-recent-popup-wrap {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.48);
}
.sj-recent-popup-wrap.is-open,
.sj-recent-popup-wrap:not([hidden]) {
  display: flex;
}
.sj-recent-popup-wrap[hidden] {
  display: none !important;
}
.sj-recent-popup {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: 88vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  padding: 22px 18px 18px;
  box-sizing: border-box;
}
.sj-recent-popup__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: #f3f4f6;
  color: #374151;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.sj-recent-popup__title {
  margin: 0 48px 12px 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.sj-recent-popup__empty {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
  word-break: keep-all;
}
.sj-recent-popup .sj-compare {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
body.sj-recent-popup-open { overflow: hidden; }

@media (max-width: 900px) {
  .sj-recent-popup { padding: 18px 0 16px; border-radius: 14px; }
  .sj-recent-popup__title,
  .sj-recent-popup__empty { padding: 0 14px; }
  .sj-recent-popup__close { right: 10px; }
  .sj-recent-popup .sj-compare { padding: 0; }
}
