/*
 * GOFINSA_XTB_COMPACT_V1
 * Reduce vertical footprint of XTB promotional cards.
 * Does NOT change brand colors, backgrounds, disclosure text,
 * affiliate URLs, rel attributes, tracking, or popup advertising.
 */

:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  .uaeAd,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
){
  box-sizing:border-box!important;
  min-height:0!important;
  padding:15px 18px!important;
  margin-top:17px!important;
  margin-bottom:17px!important;
  border-radius:14px!important;
}

/* Headings */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  .uaeAd,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) :where(h2,h3,.gf-xtb-title){
  font-size:clamp(18px,2vw,22px)!important;
  line-height:1.35!important;
  margin-top:4px!important;
  margin-bottom:6px!important;
}

/* Main descriptive text */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  .uaeAd,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) > p,
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) .gf-xtb-desc{
  font-size:14px!important;
  line-height:1.6!important;
  margin-top:5px!important;
  margin-bottom:9px!important;
}

/* Eyebrow / ad label */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) :where(
  .newsXtbAdLabel,
  .gf-xtb-eyebrow
){
  font-size:10.5px!important;
  line-height:1.35!important;
  margin-bottom:4px!important;
}

/* CTA buttons */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  .uaeAd,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) a[href^="https://s3ode.co"],
.newsXtbAdButton{
  box-sizing:border-box!important;
  min-height:42px!important;
  padding:9px 16px!important;
  border-radius:9px!important;
  font-size:14px!important;
  line-height:1.35!important;
  margin-top:6px!important;
  margin-bottom:6px!important;
}

/* Perks / badges */
.gf-xtb-promo ul.gf-xtb-perks{
  gap:5px 7px!important;
  margin-top:4px!important;
  margin-bottom:10px!important;
}

.gf-xtb-promo ul.gf-xtb-perks li{
  font-size:11.5px!important;
  line-height:1.4!important;
  padding:3px 9px!important;
}

/* Disclosure / risk text */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) :where(
  small,
  .newsXtbAdRisk,
  .gf-xtb-disclaimer
){
  font-size:10.5px!important;
  line-height:1.5!important;
  margin-top:7px!important;
}

/*
 * Existing "approved" cards are already compact.
 * Avoid shrinking their internal structure again.
 */
.gf-xtb-card.gf-xtb-approved{
  min-height:0!important;
}

/* Mobile */
@media(max-width:650px){
  :where(
    .newsXtbAd,
    .gf-xtb-promo,
    .xtbCard,
    .gf-search-xtb-card,
    .gf-xtb-market-card,
    .gg-xtb,
    .gg-xtb-second,
    .uaeAd,
    aside[aria-label="إعلان XTB"],
    [data-gofinsa-b05-xtb-card]
  ){
    padding:12px 14px!important;
    margin-top:14px!important;
    margin-bottom:14px!important;
    border-radius:12px!important;
  }

  :where(
    .newsXtbAd,
    .gf-xtb-promo,
    .xtbCard,
    .gf-search-xtb-card,
    .gf-xtb-market-card,
    .gg-xtb,
    .gg-xtb-second,
    .uaeAd,
    aside[aria-label="إعلان XTB"],
    [data-gofinsa-b05-xtb-card]
  ) :where(h2,h3,.gf-xtb-title){
    font-size:18px!important;
    line-height:1.32!important;
    margin:3px 0 5px!important;
  }

  :where(
    .newsXtbAd,
    .gf-xtb-promo,
    .xtbCard,
    .gf-search-xtb-card,
    .gf-xtb-market-card,
    .gg-xtb,
    .gg-xtb-second,
    .uaeAd,
    aside[aria-label="إعلان XTB"],
    [data-gofinsa-b05-xtb-card]
  ) a[href^="https://s3ode.co"],
  .newsXtbAdButton{
    min-height:40px!important;
    padding:8px 13px!important;
    font-size:13.5px!important;
    border-radius:8px!important;
  }

  .gf-xtb-promo ul.gf-xtb-perks li{
    font-size:11px!important;
    padding:3px 8px!important;
  }
}

/*
 * GOFINSA_XTB_COMPACT_V2_APPROVED
 * Approved market cards were already compact.
 * Apply a lighter reduction so they stay premium and readable.
 */

.gf-xtb-card.gf-xtb-approved{
  box-sizing:border-box!important;
  min-height:0!important;
  padding:11px 14px!important;
  margin-top:14px!important;
  margin-bottom:14px!important;
  border-radius:13px!important;
  gap:7px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-copy{
  gap:5px!important;
}

.gf-xtb-card.gf-xtb-approved :where(h2,h3){
  font-size:clamp(17px,1.8vw,20px)!important;
  line-height:1.32!important;
  margin-top:3px!important;
  margin-bottom:5px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-trust{
  font-size:10.5px!important;
  line-height:1.4!important;
  margin-bottom:4px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-points{
  gap:4px 6px!important;
  margin-top:5px!important;
  margin-bottom:7px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-points > *{
  font-size:11.5px!important;
  line-height:1.4!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-offer{
  font-size:12px!important;
  line-height:1.45!important;
  margin-top:5px!important;
  margin-bottom:6px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-action{
  margin-top:6px!important;
  margin-bottom:5px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-action a[href^="https://s3ode.co"]{
  box-sizing:border-box!important;
  min-height:40px!important;
  padding:8px 14px!important;
  border-radius:9px!important;
  font-size:13.5px!important;
  line-height:1.35!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-risk{
  font-size:10px!important;
  line-height:1.45!important;
  margin-top:5px!important;
}

@media(max-width:650px){
  .gf-xtb-card.gf-xtb-approved{
    padding:10px 11px!important;
    margin-top:12px!important;
    margin-bottom:12px!important;
    border-radius:11px!important;
    gap:5px!important;
  }

  .gf-xtb-card.gf-xtb-approved :where(h2,h3){
    font-size:17px!important;
  }

  .gf-xtb-card.gf-xtb-approved .gf-xtb-action a[href^="https://s3ode.co"]{
    min-height:38px!important;
    padding:7px 11px!important;
    font-size:13px!important;
  }
}

/* GoFinsa XTB text view v3. Only explicit XTB autofill or classified ad elements. */
/* Block a legacy autofill clone as soon as it enters the DOM, before its observer runs. */
[data-gf-xtb-autofill][data-gf-xtb-autofill][data-gf-xtb-autofill][data-gf-xtb-autofill][data-gf-xtb-autofill]{display:none!important}
[data-gf-xtb-suppressed][data-gf-xtb-suppressed][data-gf-xtb-suppressed][data-gf-xtb-suppressed][data-gf-xtb-suppressed]{display:none!important}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view]{
  display:block!important;box-sizing:border-box!important;
  padding:0!important;margin:16px 0!important;border:0!important;
  border-radius:0!important;background:transparent!important;background-image:none!important;
  box-shadow:none!important;min-height:0!important;height:auto!important;
  max-width:none!important;width:auto!important;gap:0!important;
  color:inherit!important;font-family:inherit!important;font-size:0!important;
  line-height:1.8!important;text-align:inherit!important;overflow:visible!important;
}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view]::before,
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view]::after{content:none!important;display:none!important}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] [data-gf-xtb-part="muted"]{display:none!important}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] [data-gf-xtb-part="path"]{
  display:contents!important;background:transparent!important;border:0!important;
  box-shadow:none!important;color:inherit!important;font-size:0!important;
}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] [data-gf-xtb-part="path"]::before,
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] [data-gf-xtb-part="path"]::after{content:none!important;display:none!important}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] [data-gf-xtb-part="note"]{
  display:block!important;color:inherit!important;font-family:inherit!important;
  font-size:12px!important;font-weight:400!important;line-height:1.75!important;
  padding:0!important;margin:5px 0 0!important;border:0!important;
  border-radius:0!important;background:transparent!important;box-shadow:none!important;
  width:auto!important;max-width:none!important;min-height:0!important;
}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] [data-gf-xtb-part="note"] *{
  color:inherit!important;font-family:inherit!important;font-size:inherit!important;
}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] a[data-gf-xtb-part="cta"]{
  /* Keep the original React text hidden, but give the generated label a real link box. */
  display:inline-block!important;box-sizing:border-box!important;
  color:inherit!important;-webkit-text-fill-color:currentColor!important;font-family:inherit!important;
  font-size:0!important;font-weight:650!important;line-height:30.4px!important;
  padding:0!important;margin:0!important;border:0!important;border-radius:0!important;
  background:transparent!important;background-image:none!important;box-shadow:none!important;
  width:auto!important;max-width:100%!important;min-height:30.4px!important;height:auto!important;
  overflow:visible!important;white-space:normal!important;text-align:inherit!important;text-transform:none!important;
  text-decoration:none!important;vertical-align:baseline!important;cursor:pointer!important;
}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] a[data-gf-xtb-part="cta"]::before{content:none!important;display:none!important}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] a[data-gf-xtb-part="cta"]::after{
  content:attr(data-gf-xtb-copy)!important;display:inline!important;
  color:inherit!important;-webkit-text-fill-color:currentColor!important;
  font-size:16px!important;font-family:inherit!important;font-weight:650!important;line-height:1.9!important;
  text-decoration:underline!important;text-decoration-thickness:1.5px!important;
  text-underline-offset:3px!important;white-space:normal!important;
  position:static!important;width:auto!important;height:auto!important;
  background:none!important;transform:none!important;
}
[data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] a[data-gf-xtb-part="cta"]:focus-visible{
  outline:2px solid currentColor!important;outline-offset:4px!important;
}
@media(max-width:640px){
  [data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view]{margin:14px 0!important}
  [data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view][data-gf-xtb-view] a[data-gf-xtb-part="cta"]::after{font-size:15px!important}
}
