:root {
  --tb-affiliate-blue: #4573e3;
  --tb-affiliate-blue-dark: #2f57c8;
  --tb-affiliate-blue-soft: rgba(69, 115, 227, .08);
  --tb-affiliate-text: #0f0f0f;
  --tb-affiliate-subtext: #6a6a6a;
  --tb-affiliate-border: #e5e7eb;
  --tb-affiliate-surface: #fff;
  --tb-affiliate-surface-soft: #f9f9f9;
  --tb-affiliate-radius: 18px;
}

.tb-affiliate-banner-wrap,
.tb-affiliate-banner,
.tb-affiliate-modal,
.tb-affiliate-cta {
  font-family: 'Pretendard Variable', Pretendard, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
}

.tb-affiliate-banner-wrap *,
.tb-affiliate-banner *,
.tb-affiliate-modal *,
.tb-affiliate-cta,
.tb-affiliate-cta::before,
.tb-affiliate-cta::after {
  box-sizing: border-box;
}

.tb-affiliate-cta {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--tb-affiliate-blue-dark);
  border-radius: 999px;
  background: transparent;
  color: var(--tb-affiliate-blue-dark);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, color .18s ease, border-color .18s ease, background-color .18s ease;
}

.tb-affiliate-cta:hover {
  background: var(--tb-affiliate-blue-soft);
  color: var(--tb-affiliate-blue-dark);
  transform: translateY(-1px);
}

.tb-affiliate-cta:focus-visible,
.tb-affiliate-store:focus-visible,
.tb-affiliate-modal__close:focus-visible {
  outline: 3px solid rgba(69, 115, 227, .24);
  outline-offset: 2px;
}

.tb-affiliate-cta--ranking {
  min-height: 24px;
  gap: 7px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #6f531f !important;
  -webkit-text-fill-color: #6f531f;
  font-size: 11px;
  font-weight: 700;
  transform: none !important;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.tb-affiliate-cta--ranking:hover {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #6f531f !important;
  -webkit-text-fill-color: #6f531f;
  transform: none !important;
}

.tb-affiliate-cta--ranking:focus,
.tb-affiliate-cta--ranking:active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #6f531f !important;
  -webkit-text-fill-color: #6f531f;
  transform: none !important;
}

.tb-affiliate-cta--ranking:focus-visible {
  outline-color: rgba(212, 154, 58, .30);
}

.tb-affiliate-cta__icon-shell {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 7px;
  background-color: #fff5e3 !important;
  transition: background-color .18s ease;
}

.tb-affiliate-cta--ranking:hover .tb-affiliate-cta__icon-shell {
  background-color: #fcebcb !important;
}

.tb-affiliate-cta__store-icon {
  display: block;
  flex: 0 0 14px;
  color: #b87918;
  -webkit-text-fill-color: #b87918;
}

.tb-affiliate-ranking-action {
  margin-top: 10px;
}

.tb-rankings .tb-affiliate-ranking-action--row {
  display: flex;
  flex: 0 0 auto;
  align-self: center;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.tb-rankings .tb-affiliate-ranking-action--mobile-price {
  display: none;
}

/* The LAN-cable ranking has its own card markup and a higher-specificity
 * `button { font: inherit; }` reset. Keep its injected CTA on the same type
 * scale and baseline as the CTA used by the other ranking layouts. */
.tb-rankings-lancable .tb-lan-card.tb-affiliate-has-lancable-cta .tb-lan-product {
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.tb-rankings-lancable .tb-affiliate-ranking-action--lancable {
  display: flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1;
}

.tb-rankings-lancable .tb-affiliate-ranking-action--lancable-mobile-price {
  display: none;
}

.tb-rankings-lancable .tb-affiliate-cta.tb-affiliate-cta--ranking {
  width: auto;
  min-height: 24px;
  padding: 0;
  font-family: 'Pretendard Variable', Pretendard, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -.01em !important;
  white-space: nowrap;
}

.tb-rankings-lancable .tb-affiliate-cta--ranking > span:last-child {
  font: inherit;
  line-height: 1;
}

@media (max-width: 700px) {
  .tb-rankings-lancable .tb-lan-card.tb-affiliate-has-lancable-cta {
    grid-template-columns: minmax(0, 1fr) 124px;
  }

  .tb-rankings-lancable .tb-lan-card.tb-affiliate-has-lancable-cta .tb-lan-product {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .tb-rankings-lancable .tb-affiliate-ranking-action--lancable {
    display: none;
  }

  .tb-rankings-lancable .tb-lan-card.tb-affiliate-has-lancable-cta .tb-lan-card-price {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .tb-rankings-lancable .tb-affiliate-ranking-action--lancable-mobile-price {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    order: -1;
    margin: 0 6px 0 0;
  }

  .tb-rankings-lancable .tb-affiliate-ranking-action--lancable-mobile-price .tb-affiliate-cta--ranking {
    min-width: 0;
    gap: 3px;
    font-size: 10px !important;
  }
}

.tb-affiliate-banner-wrap {
  --tb-affiliate-available-width: calc(100% - 20px);
  width: min(560px, var(--tb-affiliate-available-width)) !important;
  max-width: 560px !important;
  max-inline-size: 560px !important;
  flex: 0 1 560px !important;
  justify-self: center;
  margin: 34px auto;
}

.tb-affiliate-banner {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 4px;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0;
  padding: 6px clamp(14px, 2.2vw, 18px);
  border: 0 !important;
  border-radius: 10px;
  background: transparent !important;
  color: var(--tb-affiliate-text);
  box-shadow: none !important;
  transform: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: none;
}

.tb-affiliate-banner:hover {
  border: 0 !important;
  background: transparent !important;
  text-decoration: none !important;
}

.tb-affiliate-banner:hover .tb-affiliate-banner__icon {
  background-color: #fcebcb !important;
}

.tb-affiliate-banner:focus-visible {
  outline: 3px solid rgba(212, 154, 58, .28);
  outline-offset: 2px;
}

.tb-affiliate-banner::before {
  content: '';
  position: static;
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: #d49a3a;
  transform: none;
}

.tb-affiliate-banner__eyebrow {
  display: block;
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0;
  color: #9a6819;
  -webkit-text-fill-color: #9a6819;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.005em;
}

.tb-affiliate-banner__icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 7px;
  background-color: #fff5e3 !important;
  color: #b87918 !important;
  transition: background-color .18s ease;
}

.tb-affiliate-banner__description {
  flex: 1 1 260px;
  min-width: 0;
  margin: 0;
  color: var(--tb-affiliate-subtext);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.012em;
  vertical-align: baseline;
}

.tb-affiliate-banner__main {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
}

.tb-affiliate-banner__title {
  display: inline-block;
  flex: 0 0 auto;
  color: #0f0f0f;
  -webkit-text-fill-color: #0f0f0f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  vertical-align: baseline;
}

.tb-affiliate-banner__copy {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: baseline;
  min-width: 0;
  gap: 16px;
}

.tb-affiliate-cta--banner {
  min-height: 28px;
  gap: 8px;
  padding: 0;
  border: 0 !important;
  outline: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #0f0f0f !important;
  -webkit-text-fill-color: #0f0f0f;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
}

.tb-affiliate-cta--banner:hover {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--tb-affiliate-blue-dark) !important;
  -webkit-text-fill-color: #2f57c8;
  transform: none;
}

.tb-affiliate-cta__arrow {
  margin-left: 7px;
  font-size: 14px;
  font-weight: 700;
  transform: translateY(-1px);
  transition: transform .18s ease;
}

.tb-affiliate-policy-link {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 6px 2px 0 auto;
  color: #777 !important;
  -webkit-text-fill-color: #777;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  text-align: right;
  text-decoration: none !important;
  text-underline-offset: 3px;
  transition: color .18s ease;
}

.tb-affiliate-policy-link:hover {
  color: #333 !important;
  -webkit-text-fill-color: #333;
  text-decoration: none !important;
}

.tb-affiliate-policy-link:focus-visible {
  outline: 3px solid rgba(69, 115, 227, .24);
  outline-offset: 3px;
  border-radius: 3px;
}

html.tb-affiliate-lock,
body.tb-affiliate-lock {
  overflow: hidden !important;
}

.tb-affiliate-modal[hidden] {
  display: none !important;
}

.tb-affiliate-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.tb-affiliate-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, .48);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.tb-affiliate-modal__panel {
  position: relative;
  width: min(100%, 540px);
  max-height: min(720px, calc(100dvh - 40px));
  overflow: auto;
  padding: clamp(26px, 5vw, 38px);
  border: 1px solid var(--tb-affiliate-border);
  border-radius: var(--tb-affiliate-radius);
  background: var(--tb-affiliate-surface);
  color: var(--tb-affiliate-text);
  box-shadow: 0 24px 70px rgba(15, 15, 15, .2);
  outline: none;
}

.tb-affiliate-modal__panel h2 {
  margin: 0 42px 8px 0;
  color: var(--tb-affiliate-text);
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 820;
  line-height: 1.3;
  letter-spacing: -.03em;
}

.tb-affiliate-modal__description {
  margin: 0;
  color: var(--tb-affiliate-subtext);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.tb-affiliate-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--tb-affiliate-surface-soft);
  color: var(--tb-affiliate-subtext);
  font: 400 28px/1 system-ui, sans-serif;
  cursor: pointer;
}

.tb-affiliate-modal__close:hover {
  background: var(--tb-affiliate-blue-soft);
  color: var(--tb-affiliate-blue-dark);
}

.tb-affiliate-modal__stores {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 20px;
}

.tb-affiliate-store {
  min-height: 48px;
  display: inline-flex;
  flex: 1 1 150px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--tb-affiliate-border);
  border-radius: 12px;
  background: var(--tb-affiliate-surface);
  color: var(--tb-affiliate-text);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  text-decoration: none !important;
  overflow-wrap: anywhere;
  transition: none;
}

.tb-affiliate-store:hover {
  border-color: rgba(69, 115, 227, .5);
  background: var(--tb-affiliate-blue-soft);
  color: var(--tb-affiliate-blue-dark);
  transform: none;
}

.tb-affiliate-modal__disclosure,
.tb-affiliate-modal__dummy {
  margin: 0;
  color: var(--tb-affiliate-subtext);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}

.tb-affiliate-modal__dummy {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--tb-affiliate-blue-soft);
  color: var(--tb-affiliate-blue-dark);
}

@media (max-width: 700px) {
  .tb-affiliate-banner-wrap {
    --tb-affiliate-available-width: calc(100% - 32px);
    width: min(560px, var(--tb-affiliate-available-width)) !important;
    margin: 28px 0;
    margin-right: auto;
    margin-left: auto;
  }

  .tb-affiliate-banner__main {
    align-items: center;
    flex-direction: row;
  }

  .tb-affiliate-banner__description {
    font-size: 12px;
    line-height: 1.2;
  }

  .tb-affiliate-banner__copy {
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .tb-affiliate-modal__stores {
    flex-direction: column;
  }

  .tb-affiliate-store {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 680px) {
  /* Keep every row on the same tracks, including rows without purchase links.
   * A bare 1fr track grows to the price/CTA's intrinsic minimum width. */
  .tb-rankings[data-tb-affiliate-bound] .li {
    grid-template-columns: 24px 44px minmax(0, 1fr) 54px 60px;
  }

  .tb-rankings.tb-mic-rankings[data-tb-affiliate-bound] .li {
    grid-template-columns: 24px 44px minmax(0, 1fr) 54px 80px;
  }

  .tb-rankings[data-tb-affiliate-bound] .li-price {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .tb-rankings .tb-affiliate-ranking-action--row {
    display: none;
  }

  .tb-rankings .li.tb-affiliate-has-row-cta .li-price {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-self: center;
    align-items: center;
    max-width: 100%;
    overflow: visible;
    white-space: normal;
  }

  .tb-rankings .tb-affiliate-ranking-price-value {
    min-width: 0;
    max-width: 100%;
  }

  .tb-rankings .tb-affiliate-ranking-action--mobile-price {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    margin: 0;
    white-space: nowrap;
  }

  .tb-rankings .tb-affiliate-ranking-action--mobile-price .tb-affiliate-cta--ranking {
    min-width: 0;
    gap: 3px;
    font-size: 10px;
  }
}

/* Reserve enough room for both the price and CTA on narrow phones. */
@media (max-width: 360px) {
  .tb-rankings[data-tb-affiliate-bound] .li {
    grid-template-columns: 20px 36px minmax(0, 1fr) 46px 48px;
    column-gap: 6px;
  }

  .tb-rankings.tb-mic-rankings[data-tb-affiliate-bound] .li {
    grid-template-columns: 20px 36px minmax(0, 1fr) 46px 64px;
  }

  .tb-rankings[data-tb-affiliate-bound] .li-thumb {
    width: 36px;
    height: 36px;
  }

  .tb-rankings[data-tb-affiliate-bound] .li-radar,
  .tb-rankings[data-tb-affiliate-bound] .tb-mini-radar-canvas {
    width: 48px !important;
    height: 48px !important;
  }

  .tb-rankings.tb-mic-rankings[data-tb-affiliate-bound] .li-chart,
  .tb-rankings.tb-mic-rankings[data-tb-affiliate-bound] .tb-mini-bar-canvas {
    width: 64px !important;
    height: 48px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tb-affiliate-cta,
  .tb-affiliate-store {
    transition: none;
  }
}
