.market-flag {
    display: inline-flex;
    width: 22px;
    height: 15px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
    flex-shrink: 0;
}

.market-flag svg {
    width: 100%;
    height: 100%;
    display: block;
}

.market-switcher {
    position: relative;
}

.market-switcher-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 999px;
    padding: 6px 8px;
    color: inherit;
    line-height: 1;
}

.market-switcher-toggle::-webkit-details-marker {
    display: none;
}

.market-switcher-toggle::marker {
    content: "";
}

.market-switcher-toggle:hover,
.market-switcher[open] .market-switcher-toggle {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.7);
}

.market-switcher-current-meta {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.market-switcher-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 260px;
    max-height: min(70vh, 420px);
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    padding: 6px;
    z-index: 1200;
}

.market-switcher-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.market-switcher-option:hover,
.market-switcher-option.is-active {
    background: rgba(15, 23, 42, 0.06);
}

.market-switcher-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.market-switcher-name {
    font-size: 13px;
    font-weight: 600;
}

.market-switcher-meta {
    font-size: 11px;
    color: #64748b;
}

.market-switcher-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.market-switcher-row {
    margin: 8px 0 28px;
    text-align: center;
}

.market-switcher-heading {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    margin: 0 0 14px;
}

.market-switcher-row ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 14px;
    margin: 0 auto;
    padding: 0;
    max-width: 340px;
}

.market-switcher-flag {
    display: block;
    line-height: 0;
    border-radius: 2px;
}

.market-switcher-flag .market-flag {
    width: 42px;
    height: 28px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.market-switcher-flag.is-active .market-flag,
.market-switcher-flag:hover .market-flag {
    box-shadow: 0 0 0 2px #fff;
}

.market-switcher-row .market-switcher-option {
    display: none;
}

.bo-sidebar .market-switcher-compact {
    margin: 0 12px 12px;
}

.bo-sidebar .market-switcher-toggle {
    width: 100%;
    justify-content: flex-start;
    color: inherit;
}

.bo-sidebar .market-switcher-menu {
    left: 12px;
    right: 12px;
    min-width: 0;
}

.register-free-page,
.min-h-screen.flex {
    position: relative;
}

.register-free-page .market-switcher-compact,
.min-h-screen .market-switcher-compact {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
}

.cf-form-market {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 16px;
}

@media (max-width: 768px) {
    .nav-actions .market-switcher-current-meta {
        display: none;
    }
}
