/* Focused commercial-hub readability and navigation improvements.
   These styles load after stabilization, without modifying the legacy design CSS. */

/* Rank numbers remain authoritative. Rounded public scores do not create ties. */
.ts-rank.ts-rank--editorial {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 43px;
  width: auto;
  height: auto;
  padding: 7px 10px;
  border: 1px solid #bfd5cb;
  border-radius: 999px;
  background: #f1f7f4;
  color: var(--ts-pine, #164f47);
  line-height: 1.1;
  white-space: nowrap;
}
.ts-rank--editorial .ts-rank__number { font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ts-rank--editorial .ts-rank__tie {
  padding-left: 6px;
  border-left: 1px solid #bfd5cb;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ts-rank.ts-rank--tied { background: #e8f1ed; border-color: #9ec3b4; }

/* Top three: logo-led cards, quieter company names, controlled editorial lengths. */
.ts-commercial-hub .ts-pick-grid { align-items: stretch; }
.ts-commercial-hub .ts-pick-card {
  display: flex;
  min-width: 0;
  min-height: 300px;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 23px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ts-commercial-hub .ts-pick-card:hover,
.ts-commercial-hub .ts-pick-card:focus-visible {
  border-color: #87ad9c;
  box-shadow: 0 6px 20px rgba(22,79,71,.07);
}
.ts-commercial-hub .ts-pick-card:focus-visible { outline: 3px solid #378572; outline-offset: 3px; }
.ts-commercial-hub .ts-pick-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ts-commercial-hub .ts-pick-card__score { color: var(--ts-pine); font: 750 15px/1.2 var(--ts-sans); font-variant-numeric: tabular-nums; }
.ts-commercial-hub .ts-pick-card__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-height: 83px;
}
.ts-commercial-hub .ts-pick-card__logo { display: block; width: min(100%, 166px); height: 55px; object-fit: contain; object-position: left center; border-radius: 0; }
.ts-commercial-hub .ts-pick-card__logo.ts-logo { display: grid; width: 55px; height: 55px; border-radius: 6px; }
.ts-commercial-hub .ts-pick-card__brand h3 { margin: 0; font: 700 18px/1.2 var(--ts-sans); letter-spacing: -.01em; }
.ts-commercial-hub .ts-pick-card__best-for,
.ts-commercial-hub .ts-pick-card__description {
  margin: 0;
  font-size: 14px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}
.ts-commercial-hub .ts-pick-card__best-for { color: var(--ts-ink); font-weight: 600; }
.ts-commercial-hub .ts-pick-card__best-for span { color: var(--ts-pine-2); font-weight: 750; }
.ts-commercial-hub .ts-pick-card__description { color: var(--ts-muted); }
.ts-commercial-hub .ts-pick-card__cta { display: block; margin-top: auto; padding-top: 7px; color: var(--ts-pine-2); font-size: 13px; font-weight: 750; }

/* Main comparison: recognizable logos, readable ties, working in-page links. */
.ts-table-wrap table { min-width: 760px; white-space: normal; }
.ts-table-wrap td { vertical-align: middle; line-height: 1.38; }
.ts-table-rank-cell { width: 85px; }
.ts-table-product { display: flex; align-items: center; min-width: 170px; }
.ts-table-product > a, .ts-table-product__static { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.ts-table-logo-image { display: block; width: 160px; height: 44px; max-width: 100%; flex: 0 1 160px; object-fit: contain; object-position: left center; border-radius: 0; }
.ts-table-logo-image--icon { width: 44px; height: 44px; flex: 0 0 44px; }
.ts-table-product-name { font-size: 13px; font-weight: 750; }
.ts-table-product .ts-brand-name-visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: 0 !important; overflow: hidden !important;
  clip-path: inset(50%) !important; white-space: nowrap !important;
}
.ts-table-product a { color: var(--ts-pine-2); text-decoration: none; text-underline-offset: 3px; }
.ts-table-product a:hover { text-decoration-thickness: 2px; }
.ts-table-product a:focus-visible { outline: 2px solid var(--ts-pine-2); outline-offset: 3px; }

/* Product section: logo is the visual anchor, vendor website is an explicit link. */
.ts-product-summary-card__header { grid-template-columns: auto minmax(0,1fr) auto; gap: 17px; align-items: start; padding: 22px; }
.ts-product-summary-card__identity { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; }
.ts-product-summary-card__brand { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; min-width: 0; }
.ts-product-summary-card__brand-logo { display: block; width: min(100%, 175px); height: 62px; object-fit: contain; object-position: left center; border-radius: 0; }
.ts-product-summary-card__brand-logo.ts-logo { display: grid; width: 56px; height: 56px; border-radius: 6px; flex: 0 0 56px; }
.ts-product-summary-card__brand h3 { margin: 0; font: 700 19px/1.2 var(--ts-sans); letter-spacing: -.01em; }
.ts-product-summary-card__best-for { margin: 0 !important; max-width: 490px; font-size: 14px !important; line-height: 1.4; }
.ts-product-summary-card__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; min-width: 150px; }
.ts-product-summary-card__score { min-width: 0; text-align: right; }
.ts-product-summary-card__website {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid #afcec1;
  border-radius: 5px;
  background: #eaf3ef;
  color: var(--ts-pine, #164f47) !important;
  font: 750 12px/1.25 var(--ts-sans);
  text-decoration: none !important;
  white-space: nowrap;
}
.ts-product-summary-card__website:hover { background: #dbece4; border-color: #79a68f; }
.ts-product-summary-card__website:focus-visible { outline: 3px solid #378572; outline-offset: 3px; }
.ts-product-review { scroll-margin-top: 90px; }

@media (max-width: 980px) {
  .ts-commercial-hub .ts-pick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ts-commercial-hub .ts-pick-card { min-height: 280px; }
}
@media (max-width: 760px) {
  .ts-commercial-hub .ts-pick-grid { grid-template-columns: 1fr; }
  .ts-commercial-hub .ts-pick-card { min-height: 0; padding: 20px; }
  .ts-commercial-hub .ts-pick-card__brand { min-height: 0; }
  .ts-product-summary-card__header { grid-template-columns: auto minmax(0,1fr); gap: 12px; padding: 16px; }
  .ts-product-summary-card__identity { min-width: 0; gap: 10px; }
  .ts-product-summary-card__brand { align-items: flex-start; flex-direction: column; gap: 6px; }
  .ts-product-summary-card__brand-logo { height: 54px; max-width: 150px; }
  .ts-product-summary-card__brand h3 { font-size: 17px; }
  .ts-product-summary-card__actions { grid-column: 2; align-items: flex-start; min-width: 0; }
  .ts-product-summary-card__score { display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .ts-product-summary-card__website { white-space: normal; }
  .ts-table-wrap table { min-width: 730px; }
}
@media (prefers-reduced-motion: reduce) {
  .ts-commercial-hub .ts-pick-card { transition: none; }
}

.ts-commercial-hub .ts-pick-card__brand h3.ts-brand-name-visually-hidden,
.ts-product-summary-card__brand h3.ts-brand-name-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}
