.header {
    position: relative;
    z-index: 8000;
    padding: 14px 0 6px;
}

.header-content--nav-only {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid rgba(220, 229, 217, 0.88);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 32px rgba(50, 69, 54, 0.08);
    backdrop-filter: blur(18px);
}

.logo,
.top-nav-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
}

.site-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    overflow: hidden;
    padding: 2px;
    border: 1px solid color-mix(in srgb, var(--accent-primary) 36%, var(--border-color));
    border-radius: 50%;
    background: #000000;
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--accent-primary) 7%, transparent),
        0 8px 22px color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.site-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    transform-origin: 50% 50%;
    animation: xhash-logo-full-turn 3s ease-in-out infinite;
    will-change: transform;
}

@keyframes xhash-logo-full-turn {
    0%,
    66.666% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.exchange-brand-title,
.logo h1 {
    color: var(--text-primary);
    font-size: clamp(0.95rem, 2vw, 1.22rem);
    font-weight: 950;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.nav {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.nav-link,
.footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 11px;
    color: var(--text-secondary);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 850;
    line-height: 1.1;
    white-space: nowrap;
}

.nav-link:hover,
.footer-link:hover,
.nav-link.active,
.footer-link.active {
    color: var(--accent-primary);
    background: var(--accent-soft);
}

.mobile-nav-toggle,
.mobile-nav-panel {
    display: none;
}

.mobile-nav-toggle {
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 7px 11px;
    color: var(--text-secondary);
    border: 1px solid rgba(220, 229, 217, 0.95);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 #fff;
    font: inherit;
    font-weight: 850;
    line-height: 1.1;
    cursor: pointer;
}

.mobile-nav-toggle__icon,
.mobile-nav-toggle__icon::before,
.mobile-nav-toggle__icon::after {
    display: block;
    width: 15px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.mobile-nav-toggle__icon {
    position: relative;
}

.mobile-nav-toggle__icon::before,
.mobile-nav-toggle__icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.mobile-nav-toggle__icon::before {
    top: -5px;
}

.mobile-nav-toggle__icon::after {
    top: 5px;
}

.mobile-nav-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 10px;
    z-index: 8050;
    width: min(220px, calc(100vw - 28px));
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(220, 229, 217, 0.95);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 48px rgba(50, 69, 54, 0.16);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-nav-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.mobile-nav-panel__link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--text-primary);
    border: 1px solid transparent;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 900;
    line-height: 1.15;
}

.mobile-nav-panel__link:hover,
.mobile-nav-panel__link.active {
    color: var(--accent-primary);
    background: #f3f8f1;
    border-color: #d8e4d5;
}

.lang-dd {
    position: relative;
    z-index: 8100;
}

.lang-dd__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 5px 6px;
    color: var(--accent-primary);
    border: 1px solid rgba(220, 229, 217, 0.95);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 24px rgba(50, 69, 54, 0.1), inset 0 1px 0 #fff;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.lang-dd__btn:hover,
.lang-dd.open .lang-dd__btn {
    transform: translateY(-1px);
    border-color: rgba(47, 125, 91, 0.32);
    background: #ffffff;
    box-shadow: 0 16px 30px rgba(50, 69, 54, 0.14), inset 0 1px 0 #fff;
}

.lang-dd__flag-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    padding: 3px;
    border-radius: 50%;
    background: #f3f8f1;
    border: 1px solid rgba(220, 229, 217, 0.92);
}

.lang-flag {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 5px 12px rgba(48, 65, 49, 0.14);
}

.lang-dd__chev {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--accent-primary);
    background: var(--accent-soft);
    transition: transform 0.18s ease;
}

.lang-dd__chev svg {
    width: 14px;
    height: 14px;
}

.lang-dd.open .lang-dd__chev {
    transform: rotate(180deg);
}

.lang-dd__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 8200;
    display: grid;
    gap: 6px;
    width: 190px;
    padding: 7px;
    border: 1px solid rgba(220, 229, 217, 0.95);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 48px rgba(50, 69, 54, 0.16);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-dd.open .lang-dd__menu {
    display: grid;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.lang-dd__opt {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 7px 8px;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.lang-dd__opt:hover,
.lang-dd__opt.active,
.lang-dd__opt[aria-selected="true"] {
    background: #f3f8f1;
    border-color: #d8e4d5;
}

.lang-dd__opt-media {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 3px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(220, 229, 217, 0.9);
}

.lang-dd__opt-copy {
    display: grid;
    min-width: 0;
}

.lang-dd__opt-text {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.15;
}

.lang-dd__opt-check {
    width: 8px;
    height: 8px;
    justify-self: center;
    border-radius: 50%;
    background: transparent;
}

.lang-dd__opt.active .lang-dd__opt-check,
.lang-dd__opt[aria-selected="true"] .lang-dd__opt-check {
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.footer {
    padding: 18px 0 22px;
    background: transparent;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

.footer-domains {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-domain-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 7px;
    padding: 7px 10px;
    color: var(--text-secondary);
    border: 1px solid rgba(220, 229, 217, 0.9);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.footer-domain-chip--clear {
    color: var(--accent-primary);
    border-color: rgba(47, 125, 91, 0.22);
    background: rgba(243, 248, 241, 0.86);
}

.footer-domain-chip__label {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.13em;
}

.footer-domain-chip__value {
    min-width: 0;
    max-width: none;
    overflow: visible;
    color: currentColor;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1.15;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-bottom-nav {
    display: none;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 54px;
    min-height: 42px;
    padding: 5px;
    color: var(--text-muted);
    border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
    box-shadow: var(--shadow-sm), inset 0 1px 0 color-mix(in srgb, #fff 58%, transparent);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent-primary);
    border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-color));
    box-shadow: var(--shadow-md), 0 0 0 3px color-mix(in srgb, var(--accent-primary) 9%, transparent);
    transform: translateY(-1px);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

.theme-toggle__track {
    position: relative;
    display: block;
    width: 42px;
    height: 30px;
    border-radius: 999px;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--accent-primary) 18%, var(--bg-secondary)),
            color-mix(in srgb, var(--accent-secondary) 13%, var(--bg-input)));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-color) 86%, transparent);
}

.theme-toggle__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    color: #f0a928;
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(25, 39, 29, 0.18);
    transform: translateX(12px);
    transition: color 0.24s ease, transform 0.24s ease, background 0.24s ease;
}

.theme-toggle__icon {
    position: absolute;
    width: 14px;
    height: 14px;
    transition: opacity 0.18s ease, transform 0.24s ease;
}

.theme-toggle__icon--sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle__icon--moon {
    opacity: 0;
    transform: rotate(-24deg) scale(0.7);
}

html[data-theme="dark"] .theme-toggle__thumb {
    color: var(--accent-secondary);
    background: #101922;
    transform: translateX(0);
}

html[data-theme="dark"] .theme-toggle__icon--sun {
    opacity: 0;
    transform: rotate(28deg) scale(0.7);
}

html[data-theme="dark"] .theme-toggle__icon--moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle,
    .theme-toggle__thumb,
    .theme-toggle__icon {
        transition: none;
    }
}

@media (max-width: 768px) {
    .header { padding-top: 8px; }
    .header-content--nav-only {
        gap: 8px;
        min-height: 50px;
        padding: 7px 8px;
        border-radius: 16px;
        position: relative;
    }
    .site-logo-wrap {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 50%;
    }
    .site-logo { width: 100%; height: 100%; }
    .exchange-brand-title {
        max-width: 46vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .nav {
        flex: 0 1 auto;
        gap: 6px;
    }
    .nav-link {
        display: none;
    }
    .mobile-nav-toggle {
        display: inline-flex;
        font-size: 13px;
    }
    .mobile-nav-panel {
        display: grid;
    }
    .lang-dd__btn {
        min-height: 40px;
        gap: 5px;
    }
    .theme-toggle {
        min-width: 40px;
        min-height: 40px;
        padding: 5px;
    }
    .theme-toggle__track {
        width: 34px;
        height: 28px;
    }
    .theme-toggle__thumb {
        top: 3px;
        width: 22px;
        height: 22px;
        transform: translateX(6px);
    }
    html[data-theme="dark"] .theme-toggle__thumb {
        transform: translateX(0);
    }
    .lang-dd__menu {
        grid-template-columns: 1fr;
        width: min(190px, calc(100vw - 18px));
    }
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-domains {
        display: grid;
        width: 100%;
        gap: 8px;
    }
    .footer-domain-chip {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .top-nav-brand {
        flex: 1 1 auto;
    }
    .exchange-brand-title {
        max-width: calc(100vw - 210px);
    }
    .nav {
        flex: 0 0 auto;
    }
    .mobile-nav-toggle {
        min-height: 38px;
        padding: 6px 9px;
        font-size: 12px;
    }
    .lang-dd__btn {
        min-height: 38px;
        padding: 4px 5px;
    }
    .lang-dd__flag-wrap {
        width: 29px;
        height: 29px;
        flex-basis: 29px;
    }
}
