/* IMD Language Toggle (shared) */

html[data-lang="en"] .lang-ja { display: none !important; }
html:not([data-lang="en"]) .lang-en { display: none !important; }

/* Floating toggle UI (works without Tailwind) */
.imd-lang-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    transition: opacity 160ms ease, transform 160ms ease;
}

.imd-lang-toggle.is-hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.imd-lang-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    border-radius: 8px;
    height: 34px;
    line-height: 34px;
    font-weight: 800;
    font-size: 13px;
    padding: 0 10px;
    color: #e2e8f0;
    background: transparent;
}

.imd-lang-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.9);
}

.imd-lang-btn.is-active {
    background: #4f46e5;
    color: #ffffff;
}

.imd-lang-btn.is-icon {
    width: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.imd-flag-jp {
    display: block;
    width: 20px;
    height: 14px;
}

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