/* Approved desktop regulatory cards. The mobile list keeps its iOS layout. */
.fxm-hero-reg-wordmark,
.fxm-hero-license-summary,
.fxm-hero-license-entity-icon,
.fxm-hero-license-entity--empty { display: none; }
.fxm-hero-license-entity-copy { display: contents; }

@media (min-width: 768px) {
  [data-fxm-broker-hero] .fxm-hero-panel--regulatory {
    container: fxm-hero-licenses / inline-size;
    padding: 14px;
    border-color: #e9e2f8;
    background: #fff;
    box-shadow: 0 8px 24px -18px rgba(79, 52, 217, .24);
  }
  [data-fxm-broker-hero] .fxm-hero-panel--regulatory::after { display: none; }
  [data-fxm-broker-hero] .fxm-hero-panel--regulatory .fxm-hero-panel-head { margin-bottom: 12px; }
  [data-fxm-broker-hero] .fxm-hero-panel--regulatory h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
  }
  [data-fxm-broker-hero] .fxm-hero-panel--regulatory h2::before {
    width: 4px;
    height: 17px;
    flex: none;
    border-radius: 4px;
    background: linear-gradient(#a56bff, #6936e8);
    content: "";
  }
  [data-fxm-broker-hero] .fxm-hero-license-grid {
    gap: 10px;
    grid-auto-columns: calc((100% - 10px) / 2);
    padding: 2px 0 5px;
    align-items: stretch;
  }
  [data-fxm-broker-hero] .fxm-hero-license-grid:has(> .fxm-hero-license:only-child) {
    grid-template-columns: minmax(0, 1fr);
  }
  [data-fxm-broker-hero] .fxm-hero-license {
    display: grid;
    grid-template-rows: 40px 22px 26px minmax(84px, 1fr) 54px;
    gap: 7px;
    align-content: start;
    height: 282px;
    min-height: 282px;
    margin: 0;
    padding: 13px;
    border: 1px solid #e3daf8;
    border-radius: 14px;
    box-shadow: 0 3px 6px rgba(73, 42, 147, .04);
    color: #252133;
    text-align: start;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
  }
  /* Override the base card's hover shorthand as well as its default surface. */
  [data-fxm-broker-hero] .fxm-hero-license,
  [data-fxm-broker-hero] .fxm-hero-license:hover {
    background-color: #fff;
    background-image:
      linear-gradient(180deg, rgba(255, 255, 255, 0) 20%, #fff 62%),
      linear-gradient(110deg, #fff 6%, rgba(255, 255, 255, .78) 44%, rgba(255, 255, 255, .08) 100%),
      var(--fxm-img-license-card-wave-v1, url('../images/licenses/license-card-wave-v1.jpg'));
    background-position: top right;
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  [data-fxm-broker-hero] .fxm-hero-license:hover {
    border-color: #bfa8ed;
    box-shadow: 0 3px 8px rgba(73, 42, 147, .1);
    transform: none;
  }
  [data-fxm-broker-hero] .fxm-hero-license:focus-visible {
    outline: 2px solid #7852e8;
    outline-offset: -3px;
  }
  [data-fxm-broker-hero] .fxm-hero-reg-logo {
    height: 40px;
    margin: 0;
    min-width: 0;
  }
  [data-fxm-broker-hero] .fxm-hero-reg-logo-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 38px;
    mix-blend-mode: multiply;
  }
  [data-fxm-broker-hero] .fxm-hero-license-head > div:first-child { display: none; }
  [data-fxm-broker-hero] .fxm-hero-license-country {
    gap: 7px;
    height: 22px;
    margin: 0;
    color: #6f697d;
    font-size: 12px;
    font-weight: 400;
  }
  /* The supplied CySEC asset is a Great Place to Work badge, not a regulator
     logo. Only that known asset falls back to the actual institution name. */
  [data-fxm-broker-hero] .fxm-hero-reg-logo:is(:not(:has(img)), .is-unavailable, :has(img[src*="/regulator_logo/354143672150921216.svg"])) > :not(.fxm-hero-reg-wordmark) { display: none; }
  [data-fxm-broker-hero] .fxm-hero-reg-logo:is(:not(:has(img)), .is-unavailable, :has(img[src*="/regulator_logo/354143672150921216.svg"])) .fxm-hero-reg-wordmark {
    display: block;
    max-width: 100%;
    color: #272035;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.03em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  [data-fxm-broker-hero] .fxm-hero-license-meta {
    display: block;
    margin: 0;
  }
  [data-fxm-broker-hero] .fxm-hero-license-meta > .fxm-hero-license-type-row,
  [data-fxm-broker-hero] .fxm-hero-license-meta > .fxm-hero-license-number-row { display: none !important; }
  [data-fxm-broker-hero] .fxm-hero-license-meta > .fxm-hero-license-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 26px;
  }
  [data-fxm-broker-hero] .fxm-hero-license-status-row dt {
    color: #726b80;
    font-size: 12px;
    font-weight: 400;
  }
  [data-fxm-broker-hero] .fxm-hero-status-tag {
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
  }
  [data-fxm-broker-hero] .fxm-hero-status-tag.is-active::before {
    display: inline-flex;
    width: 11px;
    height: 11px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: currentColor;
    content: "";
    background: #149469 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 6 2 2 4-4' fill='none' stroke='white' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
  }
  [data-fxm-broker-hero] .fxm-hero-license-summary {
    display: grid;
    grid-template-rows: 1fr 1fr;
    margin: 0;
    border-top: 1px solid #e5ddf7;
  }
  [data-fxm-broker-hero] .fxm-hero-license-summary-row {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 40px;
  }
  [data-fxm-broker-hero] .fxm-hero-license-summary-row + .fxm-hero-license-summary-row { border-top: 1px solid #eee8f8; }
  [data-fxm-broker-hero] .fxm-hero-license-summary dt {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #726b80;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 400;
  }
  [data-fxm-broker-hero] .fxm-hero-license-summary dt svg { flex: none; color: #7b4be7; stroke-width: 1.7; }
  [data-fxm-broker-hero] .fxm-hero-license-summary dt > span {
    display: block;
    white-space: nowrap;
  }
  [data-fxm-broker-hero] .fxm-hero-license-summary dd {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #292332;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    overflow-wrap: normal;
    text-align: end;
  }
  [data-fxm-broker-hero] .fxm-hero-license-execution {
    display: inline-block;
    min-width: 34px;
    max-width: 100%;
    padding: 1px 9px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: middle;
    border-radius: 9px;
    background: #eee6ff;
    text-align: center;
  }
  [data-fxm-broker-hero] .fxm-hero-license-summary .is-undisclosed { color: #81798e; }
  [data-fxm-broker-hero] .fxm-hero-license-execution.is-undisclosed { padding: 0; background: none; }
  [data-fxm-broker-hero] .fxm-hero-license-entity {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin: 0 -3px -2px;
    padding: 7px 8px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(100deg, #faf8ff, #f2ecfd);
  }
  [data-fxm-broker-hero] .fxm-hero-license-entity-icon {
    display: flex;
    flex: none;
    align-items: center;
    padding-right: 8px;
    border-right: 1px solid #d8c8f6;
    color: #8150ee;
  }
  [data-fxm-broker-hero] .fxm-hero-license-entity-icon svg { stroke-width: 1.65; }
  [data-fxm-broker-hero] .fxm-hero-license-entity-copy { display: block; min-width: 0; }
  [data-fxm-broker-hero] .fxm-hero-license-entity-label { color: #81758e; font-size: 10.5px; font-weight: 400; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  [data-fxm-broker-hero] .fxm-hero-license-entity-name {
    display: -webkit-box;
    margin: 2px 0 0;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow-wrap: anywhere;
    color: #30263c;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.35;
  }
  [data-fxm-broker-hero] .fxm-hero-license-entity--empty .fxm-hero-license-entity-name { color: #81798e; font-weight: 400; }
}
/* The hero's right column, rather than the viewport, determines card capacity. */
@container fxm-hero-licenses (min-width: 660px) {
  [data-fxm-broker-hero] .fxm-hero-license-grid { grid-auto-columns: calc((100% - 20px) / 3); }
}

/* Keep the atlas outside the interactive track and give the record the full
   panel width whenever there is too little room for an illustration. */
@container fxm-hero-licenses (min-width: 460px) {
  [data-fxm-broker-hero] .fxm-hero-reg-stage:has(.fxm-hero-license:only-child) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(14px, 3cqi, 28px);
  }
  [data-fxm-broker-hero] .fxm-hero-reg-stage:has(.fxm-hero-license:only-child)::after {
    content: "";
    background: var(--fxm-img-regulatory-atlas, url('../images/licenses/regulatory-atlas.webp')) center / min(100%, 370px) auto no-repeat;
    pointer-events: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-fxm-broker-hero] .fxm-hero-license { transition: none; }
}
