/* P2 Stage 2: shared provider-card polish for legacy and managed guides.
   Loaded last by single.php so this file can normalize historical guide styles
   without changing guide content or provider data. */

.single-post .ds-guide-v140 .ds-shortlist {
  gap: 20px !important;
  align-items: stretch !important;
}

.single-post .ds-guide-v140 .ds-shortlist__row--v143 {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  box-sizing: border-box !important;
  padding: 22px !important;
  gap: 10px !important;
  position: relative;
}

.single-post .ds-guide-v140 .ds-shortlist__row--v143 > .ds-personally-trusted-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  display: block;
  width: 62px;
  height: auto;
  max-width: 62px;
  object-fit: contain;
  object-position: center;
  z-index: 1;
}

/* The trust mark is intentionally a shortlist signal only. Detailed reviews
   already have a CTA in the top-right and should not repeat the badge. */
.single-post .ds-guide-v140 .ds-ranked-pick--v143 > .ds-personally-trusted-badge {
  display: none;
}

.single-post .ds-guide-v140 .ds-shortlist__row--v143 > .ds-shortlist__badge {
  align-self: flex-start;
  box-sizing: border-box;
  max-width: calc(100% - 82px) !important;
}

.single-post .ds-guide-v140 .ds-shortlist__row--v143 > .ds-shortlist__brand {
  padding-right: 80px;
}

/* Keep every provider mark in the same visual footprint while preserving
   contain-vs-round artwork behavior from the existing brand classes. */
.single-post .ds-guide-v140 .ds-shortlist__logo.ds-brand-original,
.single-post .ds-guide-v140 .ds-provider-logo-v143.ds-brand-original,
.single-post .ds-guide-v140 .ds-shortlist__logo.ds-brand-local,
.single-post .ds-guide-v140 .ds-provider-logo-v143.ds-brand-local,
.single-post .ds-guide-v140 .ds-shortlist__logo.ds-brand-round,
.single-post .ds-guide-v140 .ds-provider-logo-v143.ds-brand-round {
  display: block !important;
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  flex: 0 0 56px !important;
  margin: 0 !important;
  padding: 0 !important;
  object-position: center !important;
}

.single-post .ds-guide-v140 .ds-shortlist__logo.ds-brand-original,
.single-post .ds-guide-v140 .ds-provider-logo-v143.ds-brand-original,
.single-post .ds-guide-v140 .ds-shortlist__logo.ds-brand-local,
.single-post .ds-guide-v140 .ds-provider-logo-v143.ds-brand-local {
  object-fit: contain !important;
}

.single-post .ds-guide-v140 .ds-shortlist__logo.ds-brand-round,
.single-post .ds-guide-v140 .ds-provider-logo-v143.ds-brand-round {
  border-radius: 50% !important;
  object-fit: cover !important;
}

.single-post .ds-guide-v140 .ds-shortlist__brand:has(.ds-brand-original),
.single-post .ds-guide-v140 .ds-shortlist__brand:has(.ds-brand-local),
.single-post .ds-guide-v140 .ds-shortlist__brand:has(.ds-brand-round) {
  min-height: 56px !important;
  gap: 12px !important;
  margin: 2px 0 4px !important;
  align-items: center !important;
}

.single-post .ds-guide-v140 .ds-shortlist__brand strong {
  min-width: 0;
  font-size: 20px !important;
  line-height: 1.25 !important;
  overflow-wrap: anywhere;
}

.single-post .ds-guide-v140 .ds-shortlist__badge {
  max-width: 100%;
  margin: 0 0 2px !important;
}

.single-post .ds-guide-v140 .ds-shortlist__description {
  margin: 2px 0 !important;
}

.single-post .ds-guide-v140 .entry-content .ds-shortlist__highlights {
  margin: 4px 0 8px !important;
}

/* Ratings become the common lower anchor for every card. This keeps CTAs in
   the same visual row even when descriptions/features have different lengths. */
.single-post .ds-guide-v140 .ds-shortlist__row .dslp-shortlist-rating-price {
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 14px !important;
  border-top: 1px solid #e4eaf1;
  color: #183252;
}

.single-post .ds-guide-v140 .dslp-editorial-rating {
  display: grid;
  gap: 4px;
}

.single-post .ds-guide-v140 .dslp-rating-title {
  margin: 0 0 3px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  font-weight: 700 !important;
  color: #314862;
}

.single-post .ds-guide-v140 .dslp-rating-line {
  display: grid !important;
  grid-template-columns: minmax(112px, 1fr) 88px 50px !important;
  gap: 8px !important;
  align-items: center !important;
  min-height: 22px !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.single-post .ds-guide-v140 .ds-shortlist__row .dslp-rating-line .dslp-rating-stars {
  width: 88px !important;
  height: 18px !important;
  font: 17px/18px Arial, sans-serif !important;
}

.single-post .ds-guide-v140 .dslp-rating-overall {
  min-height: 26px !important;
  margin-top: 5px !important;
  padding-top: 6px !important;
  border-top: 1px solid #dce5ef;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.single-post .ds-guide-v140 .ds-shortlist__row .dslp-rating-line .dslp-rating-score {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.single-post .ds-guide-v140 .dslp-price-slot {
  min-height: 36px !important;
  padding-top: 10px !important;
  justify-content: flex-start !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  color: #536981;
}

.single-post .ds-guide-v140 .ds-shortlist__footer-v143 {
  width: 100% !important;
  margin-top: 0 !important;
  padding-top: 10px !important;
  gap: 9px !important;
  justify-items: center !important;
}

.single-post .ds-guide-v140 .ds-shortlist__cta.ds-guide-cta-balanced {
  width: 188px !important;
  max-width: 100% !important;
}

.single-post .ds-guide-v140 .ds-shortlist__review-link {
  margin: 0 !important;
  line-height: 1.3 !important;
  text-align: center !important;
}

/* Detailed-review headers use the same logo footprint as shortlist cards. */
.single-post .ds-guide-v140 .ds-provider-overview:has(.ds-brand-original),
.single-post .ds-guide-v140 .ds-provider-overview:has(.ds-brand-local),
.single-post .ds-guide-v140 .ds-provider-overview:has(.ds-brand-round),
.single-post .ds-guide-v140 .ds-v144-secondary-grid .ds-provider-overview:has(.ds-brand-original),
.single-post .ds-guide-v140 .ds-v144-secondary-grid .ds-provider-overview:has(.ds-brand-local),
.single-post .ds-guide-v140 .ds-v144-secondary-grid .ds-provider-overview:has(.ds-brand-round) {
  grid-template-columns: 56px minmax(0, 1fr) auto !important;
  column-gap: 16px !important;
  align-items: center !important;
}

/* Standard five-column comparison table used by both guide generations. */
.single-post .ds-guide-v140 .dslp-comparison .dslp-table {
  width: 100% !important;
  min-width: 700px !important;
  table-layout: fixed !important;
}

.single-post .ds-guide-v140 .dslp-comparison .dslp-table th:first-child,
.single-post .ds-guide-v140 .dslp-comparison .dslp-table td:first-child { width: 24% !important; }
.single-post .ds-guide-v140 .dslp-comparison .dslp-table th:nth-child(2),
.single-post .ds-guide-v140 .dslp-comparison .dslp-table td:nth-child(2) { width: 34% !important; }
.single-post .ds-guide-v140 .dslp-comparison .dslp-table th:nth-child(3),
.single-post .ds-guide-v140 .dslp-comparison .dslp-table td:nth-child(3),
.single-post .ds-guide-v140 .dslp-comparison .dslp-table th:nth-child(4),
.single-post .ds-guide-v140 .dslp-comparison .dslp-table td:nth-child(4) { width: 12% !important; text-align: center !important; }
.single-post .ds-guide-v140 .dslp-comparison .dslp-table th:nth-child(5),
.single-post .ds-guide-v140 .dslp-comparison .dslp-table td:nth-child(5) { width: 18% !important; text-align: center !important; }
.single-post .ds-guide-v140 .dslp-comparison .dslp-table th:nth-child(n+3),
.single-post .ds-guide-v140 .dslp-comparison .dslp-table td:nth-child(n+3) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The rules above are written for the five-column ratings table. A generated
   three-column comparison table (Provider / Key differences / Main limitation)
   holds prose, so it keeps the proportions from companion.css and wraps its
   text instead of overflowing the cell. Scoped to exactly three columns, so the
   five-column ratings tables are untouched. */
.single-post .ds-guide-v140 .dslp-comparison .dslp-table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) th:first-child,
.single-post .ds-guide-v140 .dslp-comparison .dslp-table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) td:first-child { width: 26% !important; }
.single-post .ds-guide-v140 .dslp-comparison .dslp-table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) th:nth-child(2),
.single-post .ds-guide-v140 .dslp-comparison .dslp-table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) td:nth-child(2) { width: 40% !important; }
.single-post .ds-guide-v140 .dslp-comparison .dslp-table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) th:nth-child(3),
.single-post .ds-guide-v140 .dslp-comparison .dslp-table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) td:nth-child(3) {
  width: 34% !important;
  text-align: left !important;
  white-space: normal;
  font-variant-numeric: normal;
}

@media (max-width: 640px) {
  .single-post .ds-guide-v140 .ds-shortlist { gap: 16px !important; }
  .single-post .ds-guide-v140 .ds-shortlist__row--v143 { padding: 18px !important; }

  .single-post .ds-guide-v140 .ds-shortlist__row--v143 > .ds-personally-trusted-badge {
    top: 14px;
    right: 14px;
    width: 50px;
    max-width: 50px;
  }

  .single-post .ds-guide-v140 .ds-shortlist__row--v143 > .ds-shortlist__badge {
    max-width: calc(100% - 66px) !important;
  }

  .single-post .ds-guide-v140 .ds-shortlist__row--v143 > .ds-shortlist__brand {
    padding-right: 64px;
  }

  .single-post .ds-guide-v140 .ds-shortlist__logo.ds-brand-original,
  .single-post .ds-guide-v140 .ds-provider-logo-v143.ds-brand-original,
  .single-post .ds-guide-v140 .ds-shortlist__logo.ds-brand-local,
  .single-post .ds-guide-v140 .ds-provider-logo-v143.ds-brand-local,
  .single-post .ds-guide-v140 .ds-shortlist__logo.ds-brand-round,
  .single-post .ds-guide-v140 .ds-provider-logo-v143.ds-brand-round {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
    flex-basis: 52px !important;
  }

  .single-post .ds-guide-v140 .ds-shortlist__brand:has(.ds-brand-original),
  .single-post .ds-guide-v140 .ds-shortlist__brand:has(.ds-brand-local),
  .single-post .ds-guide-v140 .ds-shortlist__brand:has(.ds-brand-round) {
    min-height: 52px !important;
  }

  .single-post .ds-guide-v140 .dslp-rating-line {
    grid-template-columns: minmax(0, 1fr) 82px 46px !important;
    gap: 6px !important;
    font-size: 12.5px !important;
  }

  .single-post .ds-guide-v140 .ds-shortlist__row .dslp-rating-line .dslp-rating-stars {
    width: 82px !important;
    font-size: 16px !important;
  }

  .single-post .ds-guide-v140 .ds-shortlist__cta.ds-guide-cta-balanced {
    width: 100% !important;
    max-width: 100% !important;
  }

  .single-post .ds-guide-v140 .ds-provider-overview:has(.ds-brand-original),
  .single-post .ds-guide-v140 .ds-provider-overview:has(.ds-brand-local),
  .single-post .ds-guide-v140 .ds-provider-overview:has(.ds-brand-round),
  .single-post .ds-guide-v140 .ds-v144-secondary-grid .ds-provider-overview:has(.ds-brand-original),
  .single-post .ds-guide-v140 .ds-v144-secondary-grid .ds-provider-overview:has(.ds-brand-local),
  .single-post .ds-guide-v140 .ds-v144-secondary-grid .ds-provider-overview:has(.ds-brand-round) {
    grid-template-columns: 52px minmax(0, 1fr) !important;
  }

  .single-post .ds-guide-v140 .ds-provider-overview__action,
  .single-post .ds-guide-v140 .ds-v144-secondary-grid .ds-provider-overview__action {
    grid-column: 1 / -1 !important;
  }

  .single-post .ds-guide-v140 .dslp-comparison {
    padding: 16px !important;
  }

  .single-post .ds-guide-v140 .dslp-comparison .dslp-table {
    min-width: 660px !important;
  }
}

/* Legacy structured guides: the existing first shortlist card is already the
   published #1 editorial pick, so mirror the managed-guide Trusted treatment
   there without altering stored post content or adding a second ranking system. */
.single-post:not(.dscm-managed-guide) .ds-guide-v140 .ds-seeded-guide .ds-shortlist > .ds-shortlist__row:first-child {
  position: relative;
}

.single-post:not(.dscm-managed-guide) .ds-guide-v140 .ds-seeded-guide .ds-shortlist > .ds-shortlist__row:first-child::before {
  content: "Trusted";
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  box-sizing: border-box;
  padding: 5px 9px 5px 30px;
  border: 1px solid #c8ecd5;
  border-radius: 999px;
  background-color: #eefbf3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23179a55'/%3E%3Cpath d='M4.1 8.2 6.7 10.7 12 5.4' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 9px center;
  color: #167244;
  font: 700 12px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
}

.single-post:not(.dscm-managed-guide) .ds-guide-v140 .ds-seeded-guide .ds-shortlist > .ds-shortlist__row:first-child > .ds-shortlist__badge {
  max-width: calc(100% - 100px) !important;
}

.single-post:not(.dscm-managed-guide) .ds-guide-v140 .ds-seeded-guide .ds-shortlist > .ds-shortlist__row:first-child > .ds-shortlist__brand {
  padding-right: 96px !important;
}

@media (max-width: 640px) {
  .single-post:not(.dscm-managed-guide) .ds-guide-v140 .ds-seeded-guide .ds-shortlist > .ds-shortlist__row:first-child::before {
    top: 14px;
    right: 14px;
    min-height: 24px;
    padding: 4px 7px 4px 28px;
    background-position: 7px center;
    font-size: 11.5px;
  }

  .single-post:not(.dscm-managed-guide) .ds-guide-v140 .ds-seeded-guide .ds-shortlist > .ds-shortlist__row:first-child > .ds-shortlist__badge {
    max-width: calc(100% - 90px) !important;
  }

  .single-post:not(.dscm-managed-guide) .ds-guide-v140 .ds-seeded-guide .ds-shortlist > .ds-shortlist__row:first-child > .ds-shortlist__brand {
    padding-right: 86px !important;
  }
}
