.compare-advisor-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: auto;
  min-width: 7.5rem;
  max-width: 100%;
  margin: 0.5rem 0;
  padding: 0.45rem 1rem;
  border: 1px solid currentColor;
  background: transparent;
  border-radius: 0.25rem;
  font: inherit;
  font-size: 0.875rem;
  color: inherit;
  line-height: inherit;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.compare-advisor-toggle__icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 0.9em;
  height: 0.9em;
  line-height: 0;
  opacity: 0.82;
}

.compare-advisor-toggle.is-active .compare-advisor-toggle__icon {
  opacity: 0.9;
}

.compare-advisor-toggle__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.compare-advisor-toggle__icon--remove {
  display: none;
}

.compare-advisor-toggle.is-active .compare-advisor-toggle__icon--add {
  display: none;
}

.compare-advisor-toggle.is-active .compare-advisor-toggle__icon--remove {
  display: inline-flex;
}

/* Active = already in compare: quiet secondary control, never compete with primary CTA. */
.compare-advisor-toggle.is-active {
  background: #ececec;
  color: #505050;
  border-color: #b5b5b5;
  font-weight: 400;
}

.compare-advisor-toggle.is-active:hover,
.compare-advisor-toggle.is-active:focus-visible {
  background: #e2e2e2;
  color: #3a3a3a;
  border-color: #a3a3a3;
}

.compare-advisor-toggle-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}


/* Homepage discount / teaser grid: do not offer compare. */
.path-frontpage .compare-advisor-toggle,
.path-frontpage .compare-advisor-toggle-wrap {
  display: none !important;
}

/* Teaser cards: same side inset as category pill (10px); match category control height. */
.product-teaser_micro .compare-advisor-toggle-wrap {
  padding: 0 10px 8px;
  margin-top: 0;
}

.product-teaser_micro .compare-advisor-toggle {
  width: 100%;
  min-height: 2.25rem;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: normal;
  box-sizing: border-box;
}

.product-compare-toggle {
  margin-top: 0.75rem;
  max-width: 420px;
}

.product-compare-toggle .compare-advisor-toggle {
  display: flex;
  width: 100%;
  margin: 0;
  font-size: 0.9rem;
}

.product-full .product-left2 .product-compare-toggle {
  margin-top: 1rem;
}

.view-id-category_products td.views-field-compare-advisor-toggle,
.view-id-store_products td.views-field-compare-advisor-toggle,
.view-id-search td.views-field-compare-advisor-toggle,
.view-id-search-api td.views-field-compare-advisor-toggle,
.view-id-category_products td.views-field-field-price-from,
.view-id-store_products td.views-field-field-price-from,
.view-id-search td.views-field-field-price-from,
.view-id-search-api td.views-field-field-price-from {
  white-space: normal;
}

.view-id-category_products .compare-advisor-toggle-wrap,
.view-id-store_products .compare-advisor-toggle-wrap,
.view-id-search .compare-advisor-toggle-wrap,
.view-id-search-api .compare-advisor-toggle-wrap {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0;
  box-sizing: border-box;
  text-align: center;
}

.view-id-category_products .compare-advisor-toggle,
.view-id-store_products .compare-advisor-toggle,
.view-id-search .compare-advisor-toggle,
.view-id-search-api .compare-advisor-toggle {
  width: 100%;
  margin: 0;
  font-size: 0.8rem;
}

.compare-advisor-dialog {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.compare-advisor-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
}

.compare-advisor-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  padding: 1.35rem 1.25rem 1.2rem;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.compare-advisor-dialog__x {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: #666;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.compare-advisor-dialog__title {
  margin: 0 1.5rem 0.55rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
}

.compare-advisor-dialog__text {
  margin: 0 0 1.1rem;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.45;
}

.compare-advisor-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.compare-advisor-dialog__primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border: 0;
  background: #1a1a1a;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.compare-advisor-dialog__primary:hover,
.compare-advisor-dialog__primary:focus {
  background: #2a2a2a;
  color: #fff !important;
}

.compare-advisor-dialog__secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border: 1px solid #ccc;
  background: #fff;
  color: #333;
  text-decoration: none;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

body.compare-advisor-dialog-open {
  overflow: hidden;
}

.compare-advisor-badge {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 0.9rem;
}

body.path-compare .compare-advisor-badge {
  display: none !important;
}

.compare-advisor-badge:hover,
.compare-advisor-badge:focus,
.compare-advisor-badge:focus-visible,
.compare-advisor-badge:active,
.compare-advisor-badge:visited {
  background: #2a2a2a;
  color: #fff;
  text-decoration: none;
}

.compare-advisor-badge:hover .compare-advisor-badge__count,
.compare-advisor-badge:focus .compare-advisor-badge__count,
.compare-advisor-badge:active .compare-advisor-badge__count {
  background: #fff;
  color: #1a1a1a;
}

.compare-advisor-badge__count {
  display: inline-flex;
  min-width: 1.4rem;
  height: 1.4rem;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #1a1a1a;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
}

.compare-advisor-badge.is-pulse {
  animation: compare-advisor-badge-pulse 0.5s ease;
}

@keyframes compare-advisor-badge-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.compare-advisor-flyer {
  position: fixed;
  z-index: 1050;
  border-radius: 0.75rem;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition:
    transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .compare-advisor-flyer {
    display: none;
  }

  .compare-advisor-badge.is-pulse {
    animation: none;
  }
}

.compare-advisor {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Phones: drop stacked side padding so the matrix can use the width. */
@media (max-width: 767.98px) {
  .compare-advisor {
    padding: 1rem 0 2rem;
  }

  body.path-compare .region-content {
    padding-left: 0;
    padding-right: 0;
  }

  body.path-compare .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Matrix needs horizontal room; use more of the site container on large screens. */
@media (min-width: 992px) {
  .compare-advisor {
    max-width: min(72rem, 100%);
  }
}

@media (min-width: 1400px) {
  .compare-advisor {
    max-width: min(90rem, 100%);
  }
}

.compare-advisor__title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
}

.compare-advisor__lead {
  color: #555;
  margin-bottom: 1.5rem;
}

.compare-advisor__empty {
  max-width: 36rem;
  margin: 0.5rem 0 1.5rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid #e4e4e0;
  border-radius: 0.4rem;
  background: #fafaf8;
}

.compare-advisor__empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.compare-advisor__empty-lead {
  margin: 0 0 0.85rem;
  color: #444;
}

.compare-advisor__empty-steps {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: #333;
}

.compare-advisor__empty-steps li + li {
  margin-top: 0.35rem;
}

.compare-advisor__empty-cta {
  margin: 0;
}

.compare-advisor__list-loading {
  margin: 0.75rem 0;
  color: #777;
  font-size: 0.95rem;
}

.compare-advisor__layout-toggle {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0 0 0.85rem;
  padding: 0.2rem;
  border: 1px solid #ddd;
  border-radius: 0.4rem;
  background: #f7f7f5;
}

.compare-advisor__layout-btn {
  border: 0;
  background: transparent;
  color: #555;
  padding: 0.35rem 0.75rem;
  border-radius: 0.3rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.compare-advisor__layout-btn.is-active {
  background: #fff;
  color: #1a1a1a;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.compare-advisor__matrix-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 0.5rem;
  border: 1px solid #e8e8e8;
  border-radius: 0.45rem;
}

.compare-advisor__matrix {
  table-layout: fixed;
  width: 100%;
  /* Label (~8.5rem) + up to 5 course cols at ~7.5rem each. */
  min-width: calc(8.5rem + 5 * 7.5rem);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.compare-advisor__matrix th,
.compare-advisor__matrix td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  text-align: left;
}

/* Vertical separators between courses (works with row zebra). */
.compare-advisor__matrix thead .compare-advisor__matrix-course,
.compare-advisor__matrix tbody td {
  border-left: 1px solid #e0e0e0;
}

.compare-advisor__matrix thead th {
  background: #fafafa;
  font-weight: 600;
}

/* Zebra rows: light / light-gray (sticky label column matches). */
.compare-advisor__matrix tbody tr:nth-child(odd) > th,
.compare-advisor__matrix tbody tr:nth-child(odd) > td {
  background: #fff;
}

.compare-advisor__matrix tbody tr:nth-child(even) > th,
.compare-advisor__matrix tbody tr:nth-child(even) > td {
  background: #f3f4f6;
}

.compare-advisor__matrix-corner,
.compare-advisor__matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 8.5rem;
  min-width: 8.5rem;
  max-width: 8.5rem;
  color: #666;
  font-weight: 500;
  box-shadow: 1px 0 0 #eee;
}

.compare-advisor__matrix thead .compare-advisor__matrix-corner {
  z-index: 3;
  background: #fafafa;
}

/* Course columns: equal share, but not narrower than ~120px on mobile scroll. */
.compare-advisor__matrix-course,
.compare-advisor__matrix tbody td {
  width: auto;
  min-width: 7.5rem; /* ~120px; ~95px content after padding */
  max-width: none;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.compare-advisor__matrix-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin-top: 0.2rem;
  line-height: 1.35;
  font-weight: 600;
}

.compare-advisor__matrix-row--actions td,
.compare-advisor__matrix-row--actions th {
  border-bottom: 0;
}

.compare-advisor__desc-open {
  border: 0;
  background: transparent;
  color: #555;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.compare-advisor__desc-open:hover,
.compare-advisor__desc-open:focus {
  color: #1a1a1a;
}

.compare-advisor-dialog__panel--wide {
  width: min(100%, 56rem);
  max-width: min(56rem, calc(100vw - 2rem));
}

.compare-advisor-dialog__body {
  margin: 0 0 1rem;
  max-height: min(60vh, 32rem);
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.45;
  color: #333;
  font-size: 0.95rem;
}

.compare-advisor__card {
  padding: 1rem 0.85rem;
  border-bottom: 1px solid #e5e5e5;
  border-radius: 0.35rem;
}

.compare-advisor__list > .compare-advisor__card:nth-of-type(odd) {
  background: #fff;
}

.compare-advisor__list > .compare-advisor__card:nth-of-type(even) {
  background: #f3f4f6;
}

.compare-advisor__card-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.compare-advisor__card-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

/* Per-course inquiry: outline primary — visible but quieter than five solid buttons. */
.compare-advisor__card-actions .compare-advisor__inquiry {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: #d24b3d;
  background: transparent;
  border: 1px solid #d24b3d;
  border-radius: 3px;
  box-shadow: none;
}

.compare-advisor__card-actions .compare-advisor__inquiry:hover,
.compare-advisor__card-actions .compare-advisor__inquiry:focus {
  color: #fff;
  background: #d24b3d;
  border-color: #d24b3d;
  text-decoration: none;
}

.compare-advisor__card-actions .compare-advisor__remove {
  align-self: flex-start;
  padding-left: 0;
  font-size: 0.9rem;
}

.compare-advisor__card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #555;
  font-size: 0.9rem;
}

.compare-advisor__facts {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0.65rem 0 0.5rem;
  font-size: 0.9rem;
}

.compare-advisor__fact {
  display: contents;
}

.compare-advisor__facts dt {
  margin: 0;
  color: #777;
  font-weight: 500;
}

.compare-advisor__facts dd {
  margin: 0;
  color: #333;
}

.compare-advisor__desc {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.9rem;
}

.compare-advisor__desc summary {
  cursor: pointer;
  color: #555;
  user-select: none;
}

.compare-advisor__desc-body {
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: #f7f7f5;
  border-radius: 0.35rem;
  color: #333;
  line-height: 1.45;
  white-space: pre-wrap;
}

.compare-advisor__actions {
  margin: 1.75rem 0 1.25rem;
  padding-top: 0.5rem;
}

/* Outline CTA — scoped styles (Bootstrap .btn resets border/color if mixed in). */
.compare-advisor__actions .compare-advisor__help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 11rem);
  padding: 0.5rem 1.1rem;
  border: 1.5px solid #7f3d46;
  background: #faf5f6;
  color: #7f3d46;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(127, 61, 70, 0.1);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.compare-advisor__actions .compare-advisor__help-btn:hover,
.compare-advisor__actions .compare-advisor__help-btn:focus {
  color: #fff;
  background: #7f3d46;
  border-color: #7f3d46;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(127, 61, 70, 0.22);
}

.compare-advisor__criteria {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #f7f7f5;
  border-radius: 0.5rem;
}

.compare-advisor__criteria-grid {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.compare-advisor__criterion {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
}

.compare-advisor__criterion input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
}

.compare-advisor__criterion label {
  margin: 0;
  cursor: pointer;
  line-height: 1.35;
  font-weight: 400;
}

.compare-advisor__loading {
  margin-top: 1.5rem;
}

.compare-advisor__skeleton {
  height: 8rem;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #eee 25%, #f7f7f7 50%, #eee 75%);
  background-size: 200% 100%;
  animation: compare-advisor-shimmer 1.2s infinite;
}

@keyframes compare-advisor-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.compare-advisor__all-courses-title {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.compare-advisor__top {
  margin: 1.5rem 0 1rem;
  padding: 1.25rem;
  background: #f0f4ef;
  border-radius: 0.5rem;
}

.compare-advisor__result-grid {
  display: grid;
  gap: 1rem;
}

.compare-advisor__result-card {
  padding: 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #fff;
}

.compare-advisor__result-card.is-top {
  border-color: #8fbf9a;
  background: #e8f5eb;
}

.compare-advisor__result-card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.35rem;
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.compare-advisor__result-card h3 a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.compare-advisor__result-card h3 a:hover {
  color: #1a5c2e;
}

.compare-advisor__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: #2f8f4e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.compare-advisor__pros-cons {
  margin: 0.5rem 0 0.75rem;
  padding: 0;
  list-style: none;
}

.compare-advisor__pros-cons li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.4rem 0;
  line-height: 1.35;
}

.compare-advisor__sign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  border-radius: 0.3rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.compare-advisor__sign--pro {
  background: #d8f0df;
  color: #1f7a3a;
}

.compare-advisor__sign--con {
  background: #f8e0e0;
  color: #b33a3a;
}

.compare-advisor__rating {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.compare-advisor__disclaimer {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: #777;
}

.compare-advisor__result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.compare-advisor__paste {
  margin-top: 2rem;
  padding: 1.25rem;
  background: #f7f7f5;
  border-radius: 0.5rem;
}

.compare-advisor__paste-input {
  width: 100%;
  margin: 0.75rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.compare-advisor__external-ai {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #f7f7f5;
  border-radius: 0.5rem;
}

.compare-advisor__external-ai-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.compare-advisor__external-ai-hint {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.45;
}

.compare-advisor__external-ai-hint p {
  margin: 0 0 0.5rem;
}

.compare-advisor__external-ai-steps {
  margin: 0;
  padding-left: 1.25rem;
}

.compare-advisor__external-ai-steps li {
  margin: 0.25rem 0;
}

.compare-advisor__id {
  margin-right: 0.4rem;
  margin-left: 0;
  font-size: 0.8em;
  font-weight: 500;
  color: #888;
  white-space: nowrap;
}

.compare-advisor__error {
  color: #8a1f1f;
}

.compare-advisor-builtin-prompt {
  max-height: 18rem;
  overflow: auto;
  padding: 0.75rem 1rem;
  margin: 0.35rem 0 0;
  background: #f4f4f2;
  border: 1px solid #ddd;
  border-radius: 0.35rem;
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.4;
}
.compare-advisor__card details {
  border-radius: 4px;
  padding: 0.3em;
}
