/**
 * Broker ranking shortcodes: [fxt_brokers_sidebar] [fxt_brokers_top10]
 */

.fxt-br-widget {
    --fxt-br-accent: var(--positive-color, #1e8f5c);
    --fxt-br-border: #e8e8e8;
    --fxt-br-muted: #9ca3af;
    --fxt-br-head: #4b5563;
    font-family: var(--font-fxt, ui-sans-serif, system-ui, sans-serif);
    font-size: 0.875rem;
    line-height: 1.4;
    color: #111827;
    background: #fff;
    border: 1px solid var(--fxt-br-border);
    border-radius: 6px;
    overflow: hidden;
    max-width: 100%;
    margin-bottom: 1.25rem;
}

/* ——— Sidebar: “7 BEST FOREX BROKERS” card ——— */

.fxt-br-widget--sidebar {
    --fxt-br-accent: #1e8f5c;
}

.fxt-br-widget--sidebar .fxt-br-widget__head {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--fxt-br-border);
}

.fxt-br-widget--sidebar .fxt-br-widget__trophy {
    color: var(--fxt-br-accent);
}

.fxt-br-widget--sidebar .fxt-br-widget__trophy svg {
    stroke: currentColor;
}

.fxt-br-widget--sidebar .fxt-br-widget__title {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fxt-br-head);
}

.fxt-br-widget--sidebar .fxt-br-widget__row {
    display: grid;
    align-items: center;
    gap: 0.5rem 0.5rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--fxt-br-border);
    grid-template-columns: 2.375rem minmax(0, 1fr) minmax(4.25rem, auto) auto;
}

.fxt-br-widget--sidebar .fxt-br-widget__row:last-child {
    border-bottom: none;
}

.fxt-br-widget--sidebar .fxt-br-widget__badge {
    width: 2.125rem;
    height: 2.125rem;
    font-size: 0.75rem;
}

.fxt-br-widget--sidebar .fxt-br-widget__badge--gold {
    background: linear-gradient(160deg, #f5d547 0%, #e6b422 45%, #c99716 100%);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 1px 2px rgba(0, 0, 0, 0.08);
}

.fxt-br-widget--sidebar .fxt-br-widget__badge--silver {
    background: linear-gradient(160deg, #f1f5f9 0%, #cbd5e1 55%, #94a3b8 100%);
    color: #fff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.fxt-br-widget--sidebar .fxt-br-widget__badge--bronze {
    background: linear-gradient(160deg, #e09556 0%, #c5753d 50%, #a16207 100%);
    color: #fff;
}

.fxt-br-widget--sidebar .fxt-br-widget__badge--muted {
    background: #ececec;
    color: #6b7280;
    border: 1px solid #e0e0e0;
    font-weight: 700;
}

.fxt-br-widget--sidebar .fxt-br-widget__logo img,
.fxt-br-widget--sidebar .fxt-br-widget__logo-img {
    max-height: 34px;
}

.fxt-br-widget--sidebar .fxt-br-widget__deposit {
    text-align: center;
}

.fxt-br-widget--sidebar .fxt-br-widget__micro {
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--fxt-br-muted);
    margin-bottom: 0.12rem;
}

.fxt-br-widget--sidebar .fxt-br-widget__value {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #111;
}

.fxt-br-widget--sidebar .fxt-br-widget__btn {
    padding: 0.4rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--fxt-br-accent);
    background: #fff;
    border: 1px solid var(--fxt-br-accent);
    border-radius: 4px;
}

.fxt-br-widget--sidebar .fxt-br-widget__btn:hover {
    background: rgba(30, 143, 92, 0.08);
    color: #176b47;
}

/* ——— Wide (top 10) variant ——— */

.fxt-br-widget--wide {
    font-size: 0.8125rem;
}

.fxt-br-widget__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: #fff;
    border-bottom: 1px solid var(--fxt-br-border);
}

.fxt-br-widget--wide .fxt-br-widget__head {
    background: #f3f4f6;
}

.fxt-br-widget__trophy {
    display: flex;
    color: var(--fxt-br-accent);
    flex-shrink: 0;
}

.fxt-br-widget__title {
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #374151;
}

.fxt-br-widget__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fxt-br-widget__row {
    display: grid;
    align-items: center;
    gap: 0.5rem 0.6rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--fxt-br-border);
    grid-template-columns: 2rem minmax(0, 1fr) minmax(4.5rem, auto) auto;
}

.fxt-br-widget__row:last-child {
    border-bottom: none;
}

.fxt-br-widget--wide .fxt-br-widget__row {
    grid-template-columns: 2rem minmax(72px, 6.5rem) minmax(5rem, 1fr) minmax(4rem, auto) auto;
}

.fxt-br-widget__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.fxt-br-widget__badge--gold {
    background: linear-gradient(145deg, #fcd34d, #d97706);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.fxt-br-widget__badge--silver {
    background: linear-gradient(145deg, #f3f4f6, #9ca3af);
    color: #fff;
}

.fxt-br-widget__badge--bronze {
    background: linear-gradient(145deg, #d97706, #92400e);
    color: #fff;
}

.fxt-br-widget__badge--muted {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.fxt-br-widget__badge-num {
    display: block;
}

.fxt-br-widget__crown {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.fxt-br-widget__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.fxt-br-widget__logo img,
.fxt-br-widget__logo-img {
    max-height: 36px;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.fxt-br-widget--wide .fxt-br-widget__logo img,
.fxt-br-widget--wide .fxt-br-widget__logo-img {
    max-height: 40px;
}

.fxt-br-widget__logo-fallback {
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    color: var(--fxt-br-muted);
    word-break: break-word;
}

.fxt-br-widget__micro {
    display: block;
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fxt-br-muted);
    margin-bottom: 0.15rem;
}

.fxt-br-widget__value {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #111827;
}

.fxt-br-widget__deposit,
.fxt-br-widget__bonus {
    min-width: 0;
    text-align: center;
}

.fxt-br-widget--wide .fxt-br-widget__deposit,
.fxt-br-widget--wide .fxt-br-widget__bonus {
    text-align: center;
}

.fxt-br-widget__cta {
    flex-shrink: 0;
    justify-self: end;
}

.fxt-br-widget__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--fxt-br-accent);
    background: #fff;
    border: 1px solid var(--fxt-br-accent);
    border-radius: 0.25rem;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.fxt-br-widget__btn:hover {
    background: rgba(13, 148, 136, 0.08);
    text-decoration: none;
}

.fxt-br-widget__ext {
    flex-shrink: 0;
}

/* ——— Top 4 entry modal (same broker data as Top 10, limit 4) ——— */

html.fxt-br-modal--document-open,
body.fxt-br-modal--document-open {
    overflow: hidden;
}

.fxt-br-modal {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.fxt-br-modal[hidden] {
    display: none;
}

.fxt-br-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    cursor: pointer;
}

.fxt-br-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 32rem;
    max-height: min(90vh, 640px);
    overflow: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(0, 0, 0, 0.06);
}

.fxt-br-modal__close {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    z-index: 2;
    margin: 0;
    padding: 0.25rem 0.45rem;
    border: 0;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.fxt-br-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.fxt-br-modal__chrome {
    padding-bottom: 0.25rem;
}

.fxt-br-modal__titlebar {
    background: #000;
    color: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    padding: 0.85rem 2.25rem 0.85rem 1rem;
    border-radius: 10px 10px 0 0;
}

.fxt-br-modal__cols {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(4.5rem, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: #bfdbfe;
    border-bottom: 1px solid #93c5fd;
}

.fxt-br-modal__col-h {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e3a5f;
    text-align: center;
}

.fxt-br-modal__col-h:first-child {
    text-align: left;
    padding-left: 0.25rem;
}

.fxt-br-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fxt-br-modal__row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(4.5rem, 1fr) auto;
    gap: 0.5rem 0.65rem;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #e5e7eb;
}

.fxt-br-modal__row:last-child {
    border-bottom: none;
}

.fxt-br-modal__broker {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.fxt-br-modal .fxt-br-widget__badge {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    font-size: 0.6875rem;
}

.fxt-br-modal__logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.fxt-br-modal__logo-img {
    max-height: 40px;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.fxt-br-modal__logo-fallback {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--fxt-br-muted, #9ca3af);
    word-break: break-word;
}

.fxt-br-modal__deposit {
    text-align: center;
    min-width: 0;
}

.fxt-br-modal__micro {
    display: block;
    font-size: 0.5625rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.12rem;
}

.fxt-br-modal__value {
    display: block;
    font-weight: 700;
    font-size: 0.9375rem;
    color: #111827;
}

.fxt-br-modal__cta {
    justify-self: end;
}

.fxt-br-modal__btn {
    display: inline-flex;
    align-items: stretch;
    text-decoration: none;
    border-radius: 4px;
    overflow: hidden;
    font-weight: 700;
    font-size: 0.5625rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
    transition:
        filter 0.15s ease,
        opacity 0.15s ease;
}

.fxt-br-modal__btn:hover {
    filter: brightness(0.95);
    text-decoration: none;
    color: #fff;
}

.fxt-br-modal__btn-chevrons {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.35rem;
    background: #15803d;
    font-size: 0.625rem;
    line-height: 1;
}

.fxt-br-modal__btn-label {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    background: #22c55e;
}

@media (max-width: 639px) {
    .fxt-br-widget--wide {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fxt-br-widget--wide .fxt-br-widget__list {
        min-width: 32rem;
    }

    .fxt-br-widget--sidebar .fxt-br-widget__row {
        grid-template-columns: 2rem minmax(0, 1fr) minmax(3.5rem, auto) auto;
        gap: 0.35rem 0.35rem;
        padding: 0.55rem 0.5rem;
    }

    .fxt-br-widget--sidebar .fxt-br-widget__badge {
        width: 1.875rem;
        height: 1.875rem;
        font-size: 0.6875rem;
    }

    .fxt-br-widget--sidebar .fxt-br-widget__btn {
        padding: 0.35rem 0.45rem;
        font-size: 0.625rem;
    }

    .fxt-br-modal__cols,
    .fxt-br-modal__row {
        grid-template-columns: minmax(0, 1fr) minmax(3.25rem, auto) auto;
        gap: 0.35rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .fxt-br-modal__btn-label {
        padding: 0.35rem 0.4rem;
    }

    .fxt-br-modal__btn-chevrons {
        padding: 0.35rem 0.28rem;
    }
}
