:root {
    --xv-bg: #07090d;
    --xv-surface: #0e1219;
    --xv-surface-2: #151b25;
    --xv-surface-3: #1b2430;
    --xv-border: rgba(255, 255, 255, 0.1);
    --xv-border-strong: rgba(255, 255, 255, 0.16);
    --xv-text: #f4f7fb;
    --xv-muted: #a3afbf;
    --xv-subtle: #7f8b9c;
    --xv-cyan: #53d8fb;
    --xv-purple: #b99cff;
    --xv-green: #63e6be;
    --xv-danger: #ff7b8b;
    --xv-radius-sm: 8px;
    --xv-radius: 14px;
    --xv-radius-lg: 22px;
    --xv-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
    --xv-max: 1400px;
}

html { color-scheme: dark; overflow-x: clip; }

body {
    background:
        radial-gradient(circle at 15% -10%, rgba(83, 216, 251, 0.08), transparent 30%),
        radial-gradient(circle at 85% 0%, rgba(185, 156, 255, 0.07), transparent 28%),
        var(--xv-bg);
    color: var(--xv-text);
    max-width: 100%;
    overflow-x: clip;
}

img { max-width: 100%; }

#three-canvas { display: none !important; }

.table-container,
.table-responsive,
.responsive-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

table { max-width: 100%; }

input,
select,
textarea,
button { font: inherit; }

input,
select,
textarea { min-height: 44px; }

button,
[role="button"] { min-height: 40px; }

iframe { max-width: 100%; }

.xv-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;
}

.site-header,
.site-header *,
.site-footer,
.site-footer * { box-sizing: border-box; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--xv-border);
    background: rgba(7, 9, 13, 0.9);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.26);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
}

.site-header__inner {
    width: min(100% - 32px, var(--xv-max));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-brand {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--xv-text) !important;
    text-decoration: none !important;
}

.site-brand__symbol {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(83, 216, 251, 0.38);
    border-radius: 11px;
    color: #071018;
    background: linear-gradient(135deg, var(--xv-cyan), var(--xv-purple));
    box-shadow: 0 0 24px rgba(83, 216, 251, 0.16);
    font-size: 14px;
    font-weight: 900;
}

.site-brand__name {
    font: 800 20px/1 Inter, ui-sans-serif, system-ui, sans-serif;
    letter-spacing: -0.045em;
}

.site-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav__viewport {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.site-nav__links {
    display: flex;
    align-items: center;
    gap: 3px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.site-nav__links::-webkit-scrollbar { display: none; }

.site-nav__link {
    flex: 0 0 auto;
    padding: 9px 11px;
    border-radius: var(--xv-radius-sm);
    color: #c8d1de !important;
    font: 600 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
    text-decoration: none !important;
    transition: color .18s ease, background .18s ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
    color: var(--xv-text) !important;
    background: var(--xv-surface-2);
}

.site-nav__scroll {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--xv-border);
    border-radius: 50%;
    color: var(--xv-muted);
    background: var(--xv-surface);
    cursor: pointer;
}

.site-header__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-header__action {
    padding: 9px 13px;
    border: 1px solid var(--xv-border);
    border-radius: 999px;
    color: var(--xv-text) !important;
    background: var(--xv-surface);
    font: 700 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.site-header__action:hover {
    transform: translateY(-1px);
    border-color: rgba(83, 216, 251, 0.4);
    background: var(--xv-surface-2);
}

.site-header__action--primary {
    border-color: transparent;
    color: #081018 !important;
    background: linear-gradient(135deg, var(--xv-cyan), #80edcf);
}

.site-menu-toggle {
    width: 42px;
    height: 42px;
    margin-left: auto;
    display: none;
    place-items: center;
    border: 1px solid var(--xv-border);
    border-radius: 12px;
    color: var(--xv-text);
    background: var(--xv-surface);
    cursor: pointer;
}

.site-drawer[hidden] { display: none !important; }

.site-drawer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
}

.site-drawer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.site-drawer__panel {
    position: relative;
    width: min(88vw, 360px);
    height: 100%;
    padding: 18px;
    display: flex;
    flex-direction: column;
    background: var(--xv-surface);
    border-right: 1px solid var(--xv-border-strong);
    box-shadow: var(--xv-shadow);
    animation: xv-drawer-in .22s ease both;
}

@keyframes xv-drawer-in {
    from { transform: translateX(-24px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.site-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--xv-border);
}

.site-drawer__title {
    margin: 0;
    color: var(--xv-text);
    font: 800 17px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
}

.site-drawer__close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--xv-border);
    border-radius: 11px;
    color: var(--xv-text);
    background: var(--xv-surface-2);
    cursor: pointer;
}

.site-drawer__body {
    flex: 1 1 auto;
    padding: 16px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.site-drawer__label {
    margin: 16px 8px 8px;
    color: var(--xv-subtle);
    font: 800 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.site-drawer__link {
    display: block;
    padding: 11px 12px;
    border-radius: 10px;
    color: #d5dce7 !important;
    font: 600 14px/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
    text-decoration: none !important;
}

.site-drawer__link:hover,
.site-drawer__link:focus-visible {
    color: var(--xv-text) !important;
    background: var(--xv-surface-2);
}

.site-drawer__actions {
    display: grid;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--xv-border);
}

.site-drawer__actions .site-header__action { text-align: center; }

.site-footer {
    margin-top: 56px;
    border-top: 1px solid var(--xv-border);
    background: linear-gradient(180deg, #0b0e14, #07090d);
    color: var(--xv-muted);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.site-footer__inner {
    width: min(100% - 32px, var(--xv-max));
    margin: 0 auto;
    padding: 44px 0 24px;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(180px, .75fr));
    gap: 42px;
}

.site-footer__title {
    margin: 0 0 12px;
    color: var(--xv-text);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.site-footer__text {
    max-width: 540px;
    margin: 0;
    color: var(--xv-muted);
    font-size: 13px;
    line-height: 1.75;
}

.site-footer__links { display: grid; gap: 9px; }
.site-footer__links a { color: var(--xv-muted) !important; font-size: 13px; text-decoration: none !important; }
.site-footer__links a:hover { color: var(--xv-cyan) !important; }

.site-footer__bottom {
    margin-top: 34px;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--xv-border);
    color: var(--xv-subtle);
    font-size: 12px;
}

.site-scroll-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 900;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(83, 216, 251, .3);
    border-radius: 50%;
    color: var(--xv-cyan);
    background: rgba(14, 18, 25, .9);
    box-shadow: 0 10px 25px rgba(0,0,0,.3);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: .2s ease;
}

.site-scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

:where(a, button, input, textarea, select):focus-visible {
    outline: 3px solid rgba(83, 216, 251, .55) !important;
    outline-offset: 3px;
}

body.xv-drawer-open { overflow: hidden; }

@media (max-width: 1120px) {
    .site-header__action:not(.site-header__action--primary) { display: none; }
}

@media (max-width: 767px) {
    .site-header__inner { width: min(100% - 24px, var(--xv-max)); min-height: 62px; }
    .site-nav, .site-header__actions { display: none; }
    .site-menu-toggle { display: grid; }
    .site-brand__symbol { width: 32px; height: 32px; }
    .site-brand__name { font-size: 19px; }
    .site-footer__grid { grid-template-columns: 1fr; gap: 28px; }
    .site-footer__bottom { flex-direction: column; }
    h1, h2, h3 { max-width: 100%; white-space: normal !important; overflow-wrap: anywhere; }
    .parameter-table { min-width: 560px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
