.lang-dd {
    position: relative;
    display: inline-block;
}

.lang-dd > select {
    display: none;
}

.lang-dd-btn {
    background-color: transparent;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='10' height='10'%3E%3Cpath fill='%232d3436' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    border: 1px solid rgba(45, 52, 54, 0.2);
    border-radius: 6px;
    color: #2d3436;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 3px 22px 3px 8px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.lang-dd-btn:hover,
.lang-dd-btn:focus-visible,
.lang-dd-btn[aria-expanded="true"] {
    opacity: 1;
    border-color: var(--primary, #6c5ce7);
    outline: none;
}

.lang-dd-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 100%;
    margin: 0;
    padding: 4px;
    list-style: none;
    border: 1px solid rgba(45, 52, 54, 0.15);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.lang-dd-list[hidden] {
    display: none;
}

.lang-dd-list li {
    padding: 6px 10px;
    border-radius: 6px;
    color: #2d3436;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.lang-dd-list li:hover,
.lang-dd-list li.active {
    background: rgba(108, 92, 231, 0.1);
}

.lang-dd-list li.selected {
    background: #6c5ce7;
    color: #fff;
}

/* Hero variant — used when the dropdown sits among the pill-shaped hero
   buttons (Home page) on the purple gradient background, instead of on the
   light, blurred header bar used by the calculator pages. Wrap it with
   <div className="hero-lang"><LanguageSwitcher /></div> to opt in. */
.hero-lang {
    display: inline-flex;
    align-items: center;
}

.hero-lang .lang-dd-btn {
    background-color: transparent;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='10' height='10'%3E%3Cpath fill='%23ffffff' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.875rem 3rem 0.875rem 1.75rem;
    opacity: 1;
}

.hero-lang .lang-dd-btn:hover,
.hero-lang .lang-dd-btn:focus-visible,
.hero-lang .lang-dd-btn[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: #fff;
}

.hero-lang .lang-dd-list {
    top: calc(100% + 8px);
    right: 0;
    background-color: #fff;
    min-width: 140px;
}

@media (max-width: 480px) {
    .hero-lang {
        width: 100%;
    }

    .hero-lang .lang-dd-btn {
        width: 100%;
    }
}