:root {
    color-scheme: dark;
    --ink: #f2f7f8;
    --muted: #a9b6bc;
    --dim: #728087;
    --line: rgba(217, 238, 242, 0.12);
    --line-strong: rgba(222, 244, 247, 0.24);
    --panel: rgba(255, 255, 255, 0.025);
    --panel-solid: #0d171b;
    --cyan: #68e0d3;
    --violet: #aea4ff;
    --gold: #f4c979;
    --rose: #ff8da6;
    --green: #98e3a6;
    --danger: #ff8585;
    --shadow: 0 32px 100px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    font-family: "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    min-width: 320px;
    min-height: 100%;
    background: #03080a;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: #03080a;
    letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

#galaxy-canvas,
.space-veil,
.glass-refraction-lines {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#galaxy-canvas {
    z-index: 0;
    display: block;
}

.space-veil {
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(1, 5, 16, 0.02) 0%, rgba(2, 7, 22, 0.045) 52%, rgba(1, 4, 14, 0.2) 100%),
        linear-gradient(90deg, rgba(1, 5, 16, 0.13) 0%, rgba(1, 6, 20, 0.015) 50%, rgba(2, 5, 18, 0.09) 100%);
}

.glass-refraction-lines {
    display: none;
}

body[data-gpu="fallback"] #galaxy-canvas {
    background:
        linear-gradient(154deg, transparent 26%, rgba(86, 91, 139, 0.17) 42%, rgba(233, 191, 130, 0.13) 50%, rgba(68, 133, 143, 0.11) 57%, transparent 72%),
        #03080a;
}

.app-shell {
    position: relative;
    z-index: 2;
    width: min(1320px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.topbar {
    position: relative;
    overflow: hidden;
    min-height: 78px;
    margin-top: 18px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 4px 90px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.topbar::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent 0%, #fff 34%, #fff 89%, transparent 100%);
    opacity: 0.3;
    filter: blur(0.5px);
    mix-blend-mode: hard-light;
}

.brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(104, 224, 211, 0.52);
    border-radius: 6px;
    color: #061012;
    background: linear-gradient(135deg, var(--cyan), #a8ead2 54%, var(--gold));
    box-shadow: 0 0 30px rgba(104, 224, 211, 0.16);
    font-size: 13px;
    font-weight: 800;
}

.brand-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.brand-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    color: var(--dim);
    font-size: 10px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hotkey-trigger {
    height: 34px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    font-size: 10px;
    font-weight: 720;
}

.hotkey-trigger i { color: var(--gold); font-size: 16px; }
.hotkey-trigger:hover { border-color: rgba(244, 201, 121, 0.4); color: var(--ink); background: rgba(244, 201, 121, 0.07); }
.hotkey-trigger:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.language-switch {
    height: 32px;
    padding: 3px;
    display: inline-grid;
    grid-template-columns: repeat(2, 34px);
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(5, 6, 9, 0.62);
}

.language-switch button {
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    color: var(--dim);
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    font-weight: 750;
}

.language-switch button.active {
    color: #0a1112;
    background: var(--cyan);
}

.language-switch button:focus-visible,
.button:focus-visible,
.icon-button:focus-visible,
.step-button:focus-visible,
.preset-control button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.system-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.state-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 4px rgba(114, 222, 219, 0.1), 0 0 15px rgba(114, 222, 219, 0.7);
}

.main-stage {
    display: grid;
    grid-template-columns: minmax(330px, 0.9fr) minmax(480px, 1.1fr);
    align-items: center;
    gap: clamp(48px, 7vw, 106px);
    padding: 46px 3.2vw 56px;
}

body.login-only .app-shell {
    width: min(500px, calc(100% - 32px));
    grid-template-rows: 1fr;
}

body.login-only .topbar,
body.login-only .identity-pane,
body.login-only .footer-line {
    display: none;
}

body.login-only .main-stage {
    min-height: 100vh;
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.login-only .login-panel {
    width: 100%;
}

.identity-pane { min-width: 0; }

.eyebrow,
.panel-kicker {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--cyan);
    font-size: 10px;
    font-weight: 750;
}

.eyebrow > span:first-child {
    width: 30px;
    height: 1px;
    flex: 0 0 30px;
    background: var(--cyan);
}

.panel-kicker i { font-size: 17px; }

.identity-pane h1 {
    max-width: 540px;
    margin: 17px 0 8px;
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.04;
    font-weight: 690;
}

.identity-pane h1 span,
.identity-pane h1 b {
    display: block;
    overflow-wrap: anywhere;
}

.identity-pane h1 span {
    color: #fffdf7;
}

.identity-pane h1 b {
    color: var(--muted);
    font-weight: 430;
}

.identity-sub {
    margin: 0;
    color: var(--muted);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 11px;
}

.telemetry {
    max-width: 440px;
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.telemetry > div {
    min-width: 0;
    padding: 11px 13px;
    background: rgba(7, 15, 18, 0.5);
}

.telemetry span,
.telemetry strong { display: block; }

.telemetry span {
    overflow: hidden;
    color: var(--dim);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.telemetry strong {
    margin-top: 4px;
    color: var(--gold);
    font-size: 12px;
}

.trajectory-visual {
    width: min(438px, 100%);
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.trajectory-mode {
    position: relative;
    min-width: 0;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid rgba(223, 226, 236, 0.15);
    border-radius: 8px;
    background:
        linear-gradient(rgba(222, 244, 247, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(222, 244, 247, 0.045) 1px, transparent 1px),
        rgba(5, 14, 18, 0.42);
    background-size: 25% 25%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 50px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.trajectory-mode::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(167, 162, 255, 0.08);
    pointer-events: none;
}

.trajectory-mode-label {
    position: absolute;
    z-index: 4;
    top: 11px;
    left: 12px;
    color: var(--dim);
    font-family: Consolas, monospace;
    font-size: 9px;
}

.trajectory-mode-label strong { color: var(--violet); }

.axis-line,
.trajectory-origin,
.recoil-boundary,
.trajectory-field,
.trajectory-bullet { position: absolute; }

.axis-line { z-index: 1; background: rgba(224, 228, 238, 0.14); }
.axis-x { top: 68%; left: 12%; width: 76%; height: 1px; }
.axis-y { top: 13%; left: 50%; width: 1px; height: 75%; }

.trajectory-origin {
    z-index: 3;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border: 1px solid var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(114, 222, 219, 0.55);
    animation: targetPulse 2.4s ease-in-out infinite;
}

.trajectory-linear-origin { left: 50%; top: 68%; }
.trajectory-range-origin { left: 50%; top: 50%; }
.trajectory-field { z-index: 3; inset: 0; }

.trajectory-bullet {
    width: 3px;
    height: 3px;
    margin: -1.5px 0 0 -1.5px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 7px rgba(240, 199, 119, 0.62);
    transition: left 180ms ease, top 180ms ease;
}

.trajectory-bullet-range {
    background: var(--violet);
    box-shadow: 0 0 7px rgba(167, 162, 255, 0.58);
}

.recoil-boundary {
    z-index: 2;
    left: 50%;
    top: 50%;
    min-width: 12px;
    min-height: 12px;
    border: 1px solid rgba(167, 162, 255, 0.46);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 180ms ease, height 180ms ease;
}

.axis-label {
    position: absolute;
    z-index: 4;
    color: var(--dim);
    font-family: Consolas, monospace;
    font-size: 8px;
}

.axis-label-up { top: 14%; left: calc(50% + 7px); }
.axis-label-right { right: 13%; top: calc(68% + 7px); }

.mouse-guide-visual {
    position: relative;
    width: min(438px, 100%);
    min-height: 210px;
    margin-top: 28px;
    padding: 34px 16px 16px;
    display: grid;
    grid-template-columns: minmax(108px, 1fr) 104px minmax(108px, 1fr);
    align-items: center;
    gap: 12px;
    overflow: hidden;
    border: 1px solid rgba(223, 226, 236, 0.15);
    border-radius: 8px;
    background:
        linear-gradient(rgba(222, 244, 247, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(222, 244, 247, 0.045) 1px, transparent 1px),
        rgba(5, 14, 18, 0.42);
    background-size: 25% 25%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 50px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.mouse-guide-visual::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(167, 162, 255, 0.08);
    pointer-events: none;
}

.mouse-guide-mode {
    position: absolute;
    z-index: 4;
    top: 11px;
    left: 12px;
    display: flex;
    gap: 7px;
    color: var(--dim);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 9px;
}

.mouse-guide-mode strong { color: var(--violet); font-weight: 650; }

.mouse-device {
    position: relative;
    z-index: 2;
    width: 96px;
    height: 150px;
    justify-self: center;
}

.mouse-shell {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(222, 244, 247, 0.46);
    border-radius: 48px 48px 40px 40px;
    background: rgba(4, 13, 17, 0.78);
    box-shadow: inset 0 0 24px rgba(104, 224, 211, 0.06), 0 0 22px rgba(0, 0, 0, 0.22);
}

.mouse-shell::before,
.mouse-shell::after {
    content: "";
    position: absolute;
    background: rgba(222, 244, 247, 0.2);
}

.mouse-shell::before { top: 52px; right: 0; left: 0; height: 1px; }
.mouse-shell::after { top: 0; left: 50%; width: 1px; height: 52px; }

.mouse-wheel {
    position: absolute;
    z-index: 3;
    top: 13px;
    left: 50%;
    width: 20px;
    height: 34px;
    padding: 3px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    border: 1px solid rgba(240, 199, 119, 0.6);
    border-radius: 10px;
    color: var(--gold);
    background: rgba(240, 199, 119, 0.08);
    font-size: 8px;
    line-height: 1;
    transform: translateX(-50%);
    box-shadow: 0 0 12px rgba(240, 199, 119, 0.12);
}

.mouse-wheel i { font-style: normal; }

.mouse-side-button {
    position: absolute;
    z-index: 4;
    left: -8px;
    width: 18px;
    height: 25px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(104, 224, 211, 0.54);
    border-radius: 4px 0 0 4px;
    color: var(--cyan);
    background: rgba(104, 224, 211, 0.1);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 8px;
    box-shadow: 0 0 10px rgba(104, 224, 211, 0.1);
}

.mouse-side-upper { top: 61px; }
.mouse-side-lower { top: 92px; border-color: rgba(167, 162, 255, 0.58); color: var(--violet); background: rgba(167, 162, 255, 0.1); }

.mouse-guide-action { position: relative; z-index: 3; min-width: 0; }

.mouse-guide-action > strong {
    display: block;
    color: var(--ink);
    font-size: 9px;
    line-height: 1.4;
}

.mouse-guide-action > span {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.mouse-guide-action b {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    color: var(--gold);
    font-size: 9px;
}

.mouse-guide-action em { color: var(--muted); font-size: 9px; font-style: normal; line-height: 1.35; }
.mouse-guide-horizontal { text-align: right; }
.mouse-guide-horizontal > span { justify-content: flex-end; }
.mouse-guide-vertical { text-align: left; }

.mouse-guide-horizontal::after,
.mouse-guide-vertical::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 12px;
    height: 1px;
    background: var(--line-strong);
}

.mouse-guide-horizontal::after { right: -12px; }
.mouse-guide-vertical::before { left: -12px; }

.numpad-trajectory-visual {
    position: relative;
    width: min(438px, 100%);
    min-height: 210px;
    margin-top: 28px;
    padding: 34px 16px 16px;
    display: grid;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(223, 226, 236, 0.15);
    border-radius: 8px;
    background:
        linear-gradient(rgba(222, 244, 247, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(222, 244, 247, 0.045) 1px, transparent 1px),
        rgba(5, 14, 18, 0.42);
    background-size: 25% 25%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 50px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.numpad-trajectory-visual::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(167, 162, 255, 0.08);
    pointer-events: none;
}

.numpad-trajectory-mode {
    position: absolute;
    z-index: 4;
    top: 11px;
    left: 12px;
    display: flex;
    gap: 7px;
    color: var(--dim);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 9px;
}

.numpad-trajectory-mode strong { color: var(--violet); font-weight: 650; }
.numpad-trajectory-body { position: relative; z-index: 2; display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 18px; }
.numpad-trajectory-visual .numpad-device { justify-self: center; }
.numpad-trajectory-visual .numpad-actions { grid-template-columns: 1fr; gap: 4px; }
.numpad-trajectory-visual .numpad-action { min-height: 52px; border-bottom: 0; }

.glass-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 4px 90px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-panel::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent 0%, #fff 34%, #fff 89%, transparent 100%);
    opacity: 0.3;
    filter: blur(0.5px);
    mix-blend-mode: hard-light;
}

.login-panel { padding: clamp(28px, 4vw, 48px); }

.login-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.login-language-switch {
    flex: 0 0 auto;
}

.login-panel h2,
.control-panel h2 {
    margin: 12px 0 5px;
    font-size: 26px;
    line-height: 1.2;
}

.panel-subtitle {
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 13px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.key-field {
    position: relative;
    height: 54px;
    display: flex;
    align-items: center;
}

.key-field > i {
    position: absolute;
    left: 16px;
    z-index: 1;
    color: var(--cyan);
    font-size: 19px;
}

.key-field input {
    width: 100%;
    height: 54px;
    padding: 0 66px 0 46px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    color: var(--ink);
    background: rgba(2, 10, 13, 0.56);
    box-shadow: inset 0 1px 18px rgba(0, 0, 0, 0.17);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 14px;
    text-transform: uppercase;
}

.key-field input::placeholder { color: #626874; }
.key-field input:focus { border-color: rgba(114, 222, 219, 0.65); }

.key-count {
    position: absolute;
    right: 14px;
    color: var(--dim);
    font-family: Consolas, monospace;
    font-size: 10px;
}

.form-message {
    min-height: 36px;
    padding-top: 9px;
    color: var(--danger);
    font-size: 12px;
}

.form-message.success { color: var(--cyan); }

.login-actions,
.control-actions,
.download-dialog-actions {
    display: flex;
    gap: 10px;
}

.button {
    min-height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 720;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.58; }
.button-primary { color: #071112; background: var(--cyan); }
.button-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 12px 28px rgba(104, 224, 211, 0.1); }
.button-primary:hover:not(:disabled) { background: #8ce8df; }
.button-secondary { border-color: var(--line-strong); color: var(--ink); background: rgba(255, 255, 255, 0.035); }
.button-secondary:hover:not(:disabled) { border-color: rgba(167, 162, 255, 0.54); background: rgba(167, 162, 255, 0.09); }
.login-actions .button { flex: 1 1 0; }

.control-panel { padding: clamp(24px, 3vw, 34px); }

.control-head,
.dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.control-head h2 { margin-bottom: 0; }

.control-logout {
    min-height: 36px;
    padding: 0 12px;
    color: var(--muted);
}

.control-logout:hover:not(:disabled) {
    border-color: rgba(255, 133, 133, 0.5);
    color: #ffd4d4;
    background: rgba(255, 133, 133, 0.08);
}

.icon-button,
.step-button {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
}

.icon-button:hover,
.step-button:hover { border-color: var(--line-strong); color: var(--cyan); }

.license-strip {
    margin: 22px 0;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr 1fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(2, 10, 13, 0.35);
}

.license-strip > div {
    min-width: 0;
    padding: 11px 12px;
    border-right: 1px solid var(--line);
}

.license-strip > div:last-child { border-right: 0; }
.license-strip span, .license-strip strong { display: block; }
.license-strip span { color: var(--dim); font-size: 9px; }

.license-strip strong {
    margin-top: 5px;
    overflow: hidden;
    color: var(--gold);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mono { font-family: Consolas, "Cascadia Mono", monospace; }

.portal-notice {
    margin: -7px 0 20px;
    padding: 10px 12px;
    border-left: 2px solid var(--gold);
    color: #e3d7bd;
    background: rgba(240, 199, 119, 0.07);
    font-size: 12px;
}

.settings-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}

.setting-section,
.preset-section,
.visual-settings-section { min-width: 0; }

.section-title {
    margin-bottom: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title > span {
    color: var(--violet);
    font-family: Consolas, monospace;
    font-size: 10px;
}

.section-title h3 {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
}

.control-row {
    padding: 10px 0 12px;
    border-top: 1px solid var(--line);
}

.control-meta {
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.control-meta label { color: var(--muted); font-size: 11px; }

.control-meta output {
    min-width: 26px;
    color: var(--cyan);
    font-family: Consolas, monospace;
    font-size: 12px;
    text-align: right;
}

.control-inputs {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 9px;
}

.step-button {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 14px;
}

input[type="range"] {
    --fill: 20%;
    width: 100%;
    height: 18px;
    margin: 0;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 0;
    background: linear-gradient(90deg, var(--cyan) 0 var(--fill), rgba(224, 228, 238, 0.18) var(--fill) 100%);
}

input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    margin-top: -4.5px;
    appearance: none;
    border: 2px solid #0b1113;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 1px var(--cyan);
}

input[type="range"]::-moz-range-track { height: 3px; background: rgba(224, 228, 238, 0.18); }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--cyan); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #0b1113; border-radius: 50%; background: var(--cyan); }

.visual-settings-section { margin-top: 22px; }

.visual-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 26px;
    border-top: 1px solid var(--line);
}

.config-setting {
    min-width: 0;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.config-setting > strong {
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 560;
    line-height: 1.4;
}

.toggle-control {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
}

.toggle-control input {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.toggle-track {
    position: absolute;
    inset: 0;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.045);
    transition: border-color 150ms ease, background-color 150ms ease;
}

.toggle-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--dim);
    transition: transform 150ms ease, background-color 150ms ease;
}

.toggle-control input:checked + .toggle-track {
    border-color: rgba(104, 224, 211, 0.58);
    background: rgba(104, 224, 211, 0.14);
}

.toggle-control input:checked + .toggle-track::after { background: var(--cyan); transform: translateX(16px); }
.toggle-control input:focus-visible + .toggle-track { outline: 2px solid rgba(167, 162, 255, 0.66); outline-offset: 2px; }

.color-control {
    min-width: 106px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.color-control input[type="color"] {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 3px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: rgba(2, 10, 13, 0.56);
    cursor: pointer;
}

.color-control input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-control input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 2px; }
.color-control input[type="color"]::-moz-color-swatch { border: 0; border-radius: 2px; }

.color-control output {
    width: 63px;
    color: var(--dim);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 9px;
    text-align: right;
    text-transform: lowercase;
}

.preset-section { margin-top: 22px; }

.preset-control {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
}

.preset-control button {
    min-width: 0;
    min-height: 52px;
    padding: 8px 9px;
    border: 0;
    border-right: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
}

.preset-control button:last-child { border-right: 0; }
.preset-control button:hover { color: var(--ink); background: rgba(167, 162, 255, 0.08); }
.preset-control button.active { color: #0a1013; background: var(--violet); }
.preset-control strong, .preset-control small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-control strong { font-size: 10px; }
.preset-control small { margin-top: 4px; color: inherit; font-family: Consolas, monospace; font-size: 8px; opacity: 0.72; }

.control-actions { margin-top: 22px; }
.control-actions .button { flex: 1 1 0; }
.button-download { border-color: rgba(240, 199, 119, 0.45); color: var(--gold); background: rgba(240, 199, 119, 0.07); }
.button-download:hover:not(:disabled) { background: rgba(240, 199, 119, 0.13); }
.button-save { color: #071112; background: var(--cyan); }

.footer-line {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(229, 232, 240, 0.1);
    color: var(--dim);
    font-size: 9px;
}

.footer-rule { width: 24px; height: 1px; background: var(--line-strong); }

.glass-dialog {
    width: min(500px, calc(100% - 32px));
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 8px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 4px 90px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-dialog::backdrop { background: rgba(1, 5, 7, 0.76); backdrop-filter: blur(8px); }
.glass-dialog form { padding: 24px; }
.dialog-head { align-items: center; }
.dialog-head h3 { margin: 0; font-size: 17px; }
.dialog-body { margin: 20px 0; border-top: 1px solid var(--line); }

.dialog-row {
    padding: 10px 0;
    display: grid;
    grid-template-columns: minmax(80px, 0.42fr) minmax(0, 1fr);
    gap: 16px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
}

.dialog-row span { color: var(--dim); }
.dialog-row strong { overflow-wrap: anywhere; text-align: right; }
.glass-dialog > form > .button-primary { width: 100%; }

.hotkey-dialog {
    width: min(920px, calc(100% - 32px));
    max-height: min(820px, calc(100vh - 32px));
}

.hotkey-dialog > form { padding: clamp(20px, 3vw, 30px); }
.hotkey-dialog-head h3 { margin-top: 7px; font-size: 22px; }

.hotkey-intro {
    margin: 12px 0 20px;
    color: var(--muted);
    font-size: 11px;
}

.hotkey-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 28px;
}

.hotkey-group { min-width: 0; }
.hotkey-group-wide { grid-column: 1 / -1; }

.hotkey-group-title {
    min-height: 28px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid var(--line-strong);
}

.hotkey-group-title span {
    color: var(--gold);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 9px;
}

.hotkey-group-title h4 {
    margin: 0;
    color: var(--ink);
    font-size: 11px;
}

.hotkey-list { display: grid; }
.hotkey-list-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.hotkey-sidewheel .hotkey-line { grid-template-columns: 132px minmax(0, 1fr); }

.numpad-device {
    width: 136px;
    padding: 9px;
    border: 1px solid rgba(222, 244, 247, 0.24);
    border-radius: 7px;
    background: rgba(5, 14, 18, 0.76);
    box-shadow: inset 0 0 18px rgba(104, 224, 211, 0.06), 0 8px 20px rgba(0, 0, 0, 0.16);
}

.numpad-label {
    display: block;
    margin-bottom: 7px;
    color: var(--dim);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 8px;
    letter-spacing: 0.08em;
}

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.numpad-grid kbd,
.numpad-action-keys kbd {
    min-width: 0;
    min-height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(222, 244, 247, 0.18);
    border-bottom-color: rgba(244, 201, 121, 0.42);
    border-radius: 3px;
    color: var(--cyan);
    background: rgba(1, 8, 11, 0.62);
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.025);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 8px;
    line-height: 1;
}

.numpad-grid kbd:nth-child(4n),
.numpad-action-keys kbd { color: var(--gold); }
.numpad-grid kbd:nth-child(4n) { background: rgba(240, 199, 119, 0.08); }

.numpad-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.numpad-action {
    min-width: 0;
    min-height: 48px;
    padding: 7px 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid var(--line);
}

.numpad-action-keys {
    display: inline-flex;
    gap: 4px;
}

.numpad-action-keys kbd {
    width: 24px;
    min-height: 28px;
    font-size: 10px;
}

.numpad-action strong,
.numpad-action small { display: block; }
.numpad-action strong { color: var(--ink); font-size: 11px; }
.numpad-action small { margin-top: 4px; color: var(--dim); font-size: 9px; line-height: 1.45; }

.hotkey-line {
    position: relative;
    min-width: 0;
    min-height: 58px;
    padding: 10px 2px;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.hotkey-line::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(104, 224, 211, 0.42), transparent);
    opacity: 0;
    transform: scaleX(0.3);
}

.hotkey-dialog[open] .hotkey-line::after { animation: hotkeyScan 4.8s ease-in-out infinite; }
.hotkey-dialog[open] .hotkey-group:nth-child(2) .hotkey-line::after { animation-delay: 1.2s; }
.hotkey-dialog[open] .hotkey-group:nth-child(3) .hotkey-line::after { animation-delay: 2.4s; }

.hotkey-line kbd {
    min-width: 0;
    min-height: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(222, 244, 247, 0.2);
    border-bottom-color: rgba(244, 201, 121, 0.42);
    border-radius: 5px;
    color: var(--cyan);
    background: rgba(1, 8, 11, 0.55);
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.025);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 9px;
    white-space: nowrap;
}

.hotkey-line > span { min-width: 0; }
.hotkey-line strong,
.hotkey-line small { display: block; }
.hotkey-line strong { color: var(--ink); font-size: 11px; }
.hotkey-line small { margin-top: 4px; color: var(--dim); font-size: 9px; line-height: 1.45; }

.hotkey-instructions { margin-top: 22px; }

.hotkey-instruction-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    list-style: none;
}

.hotkey-instruction-list li {
    min-width: 0;
    padding: 10px 2px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    border-bottom: 1px solid var(--line);
}

.hotkey-instruction-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.hotkey-instruction-list li > span { color: var(--gold); font-family: Consolas, "Cascadia Mono", monospace; font-size: 9px; }
.hotkey-instruction-list strong { color: var(--muted); font-size: 10px; font-weight: 560; line-height: 1.55; }

.hotkey-dialog-footer {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.hotkey-dialog-footer > span {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--dim);
    font-size: 9px;
}

.hotkey-dialog-footer > span i { color: var(--gold); font-size: 15px; }
.hotkey-dialog-footer .button { min-width: 150px; }

.download-dialog { width: min(680px, calc(100% - 32px)); }
.download-dialog .dialog-head h3 { margin-top: 6px; }

.download-command-block {
    margin: 20px 0 16px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #06070a;
}

.download-command-block pre {
    min-height: 104px;
    margin: 0;
    padding: 14px;
    color: #d9d9e3;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: all;
}

.download-dialog-actions .button { flex: 1 1 0; }

.download-copy-status {
    margin-top: 12px;
    color: var(--cyan);
    font-size: 12px;
    text-align: center;
}

.download-copy-status.error { color: var(--danger); }

.toast {
    position: fixed;
    z-index: 20;
    right: 24px;
    bottom: 24px;
    max-width: min(360px, calc(100% - 48px));
    padding: 12px 16px;
    border: 1px solid rgba(114, 222, 219, 0.42);
    border-radius: 5px;
    color: var(--ink);
    background: rgba(11, 16, 18, 0.96);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 160ms ease, transform 160ms ease;
    font-size: 12px;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255, 133, 133, 0.5); color: #ffd4d4; }

@keyframes glassRefraction {
    0% { background-position: 0 0, 0% 50%; }
    100% { background-position: 210px -210px, 180% 50%; }
}

@keyframes targetPulse {
    0%, 100% { transform: scale(0.92); opacity: 0.72; }
    50% { transform: scale(1.18); opacity: 1; }
}

@keyframes hotkeyScan {
    0%, 72%, 100% { opacity: 0; transform: scaleX(0.3); }
    82% { opacity: 0.8; transform: scaleX(1); }
}

@media (max-width: 1040px) {
    .main-stage { grid-template-columns: minmax(290px, 0.8fr) minmax(450px, 1.2fr); gap: 40px; padding-inline: 0; }
    .identity-pane h1 { font-size: 44px; }
}

@media (max-width: 880px) {
    .app-shell { width: min(720px, calc(100% - 36px)); }
    .main-stage { grid-template-columns: 1fr; gap: 34px; align-items: start; padding: 40px 0 48px; }
    .identity-pane { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr); column-gap: 30px; align-items: end; }
    .identity-pane .eyebrow, .identity-pane h1, .identity-pane .identity-sub, .identity-pane .telemetry { grid-column: 1; }
    .trajectory-visual { grid-column: 2; grid-row: 1 / span 4; margin: 0; gap: 12px; }
    .numpad-trajectory-visual { grid-column: 2; grid-row: 1 / span 4; margin: 0; }
    .mouse-guide-visual { grid-column: 1 / -1; grid-row: 5; margin-top: 24px; }
    .identity-pane h1 { font-size: 38px; }
    .telemetry { margin-top: 22px; }
}

@media (max-width: 650px) {
    .app-shell { width: min(calc(100% - 28px), 560px); }
    .topbar { min-height: 64px; margin-top: 10px; padding: 0 11px; gap: 10px; }
    .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
    .brand-copy small, .system-state span:last-child { display: none; }
    .topbar-actions { gap: 7px; }
    .hotkey-trigger { width: 34px; padding: 0; justify-content: center; }
    .hotkey-trigger span { display: none; }
    .language-switch { grid-template-columns: repeat(2, 31px); }
    .main-stage { padding: 30px 0 38px; }
    .identity-pane { display: block; }
    .identity-pane h1 { margin-top: 14px; font-size: 34px; }
    .trajectory-visual, .numpad-trajectory-visual, .mouse-guide-visual { margin-top: 24px; }
    .login-panel, .control-panel { padding: 24px 18px; }
    .settings-layout { grid-template-columns: 1fr; gap: 20px; }
    .visual-settings-grid { grid-template-columns: 1fr; }
    .license-strip { grid-template-columns: 1fr 1fr; }
    .license-strip > div { border-bottom: 1px solid var(--line); }
    .license-strip > div:nth-child(2) { border-right: 0; }
    .license-strip > div:last-child { grid-column: 1 / -1; border-bottom: 0; }
    .preset-control { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .preset-control button:nth-child(2) { border-right: 0; }
    .preset-control button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .login-actions, .control-actions { flex-direction: column; }
    .hotkey-board { grid-template-columns: 1fr; gap: 18px; }
    .hotkey-group-wide { grid-column: auto; }
    .hotkey-list-compact { grid-template-columns: 1fr; }
    .hotkey-instruction-list { grid-template-columns: 1fr; }
    .hotkey-instruction-list li:last-child:nth-child(odd) { grid-column: auto; }
    .hotkey-dialog-footer { align-items: stretch; flex-direction: column; }
    .hotkey-dialog-footer .button { width: 100%; }
    .footer-line { justify-content: center; }
    .toast { right: 14px; bottom: 14px; max-width: calc(100% - 28px); }
}

@media (max-width: 390px) {
    .app-shell { width: calc(100% - 20px); }
    .brand { gap: 8px; }
    .brand-copy strong { max-width: 130px; }
    .trajectory-visual { gap: 10px; }
    .trajectory-mode-label { top: 8px; left: 8px; }
    .mouse-guide-visual { min-height: 196px; padding: 32px 10px 12px; grid-template-columns: minmax(92px, 1fr) 88px minmax(92px, 1fr); gap: 6px; }
    .mouse-device { width: 82px; height: 132px; }
    .mouse-shell { border-radius: 42px 42px 35px 35px; }
    .mouse-shell::before { top: 47px; }
    .mouse-shell::after { height: 47px; }
    .mouse-wheel { top: 10px; }
    .mouse-side-upper { top: 54px; }
    .mouse-side-lower { top: 83px; }
    .mouse-guide-action > strong, .mouse-guide-action em { font-size: 8px; }
    .mouse-guide-action > span { gap: 5px; }
    .mouse-guide-horizontal::after, .mouse-guide-vertical::before { width: 6px; }
    .mouse-guide-horizontal::after { right: -6px; }
    .mouse-guide-vertical::before { left: -6px; }
    .login-panel, .control-panel { padding: 20px 14px; }
    .key-field input { padding-left: 42px; font-size: 12px; }
    .glass-dialog form { padding: 20px 15px; }
    .hotkey-line { grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
    .numpad-trajectory-visual { min-height: 196px; padding: 32px 10px 12px; }
    .numpad-trajectory-body { grid-template-columns: 118px minmax(0, 1fr); gap: 10px; }
    .numpad-trajectory-visual .numpad-action { grid-template-columns: 1fr; gap: 4px; }
    .numpad-trajectory-visual .numpad-action-keys { gap: 3px; }
    .numpad-trajectory-visual .numpad-action-keys kbd { width: 20px; min-height: 22px; font-size: 8px; }
    .numpad-trajectory-visual .numpad-action strong { font-size: 9px; }
    .numpad-trajectory-visual .numpad-action small { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-panel { background: rgba(12, 13, 18, 0.94); }
}
