:root {
    color-scheme: dark;
    --ink: #f4f3ee;
    --muted: #aaaeb7;
    --dim: #777d89;
    --line: rgba(224, 228, 238, 0.14);
    --line-strong: rgba(224, 228, 238, 0.25);
    --panel: rgba(10, 11, 16, 0.76);
    --panel-solid: #101116;
    --cyan: #72dedb;
    --violet: #a7a2ff;
    --gold: #f0c777;
    --rose: #ff8fa7;
    --danger: #ff8585;
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
    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: #050608;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: #050608;
    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 {
    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(2, 3, 5, 0.08) 0%, rgba(2, 3, 5, 0.18) 52%, rgba(2, 3, 5, 0.72) 100%),
        linear-gradient(90deg, rgba(2, 3, 5, 0.62) 0%, rgba(2, 3, 5, 0.12) 47%, rgba(2, 3, 5, 0.32) 100%);
}

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%),
        #050608;
}

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

.topbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid rgba(229, 232, 240, 0.12);
}

.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(114, 222, 219, 0.56);
    border-radius: 6px;
    color: #071112;
    background: var(--cyan);
    box-shadow: 0 0 28px rgba(114, 222, 219, 0.18);
    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;
}

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

.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;
    border: 1px solid var(--line);
    background: var(--line);
}

.telemetry > div {
    min-width: 0;
    padding: 11px 13px;
    background: rgba(7, 8, 12, 0.68);
}

.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: 4px;
    background:
        linear-gradient(rgba(223, 226, 236, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(223, 226, 236, 0.035) 1px, transparent 1px),
        rgba(5, 6, 10, 0.48);
    background-size: 25% 25%;
}

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

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

.glass-panel {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(118%);
    -webkit-backdrop-filter: blur(18px) saturate(118%);
}

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

.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(3, 4, 7, 0.72);
    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:hover:not(:disabled) { background: #8ce8e5; }
.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-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.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;
    border: 1px solid var(--line);
    background: rgba(2, 3, 6, 0.38);
}

.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 { 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); }

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

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

.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 var(--line-strong);
    border-radius: 8px;
    color: var(--ink);
    background: rgba(12, 13, 18, 0.97);
    box-shadow: var(--shadow);
}

.glass-dialog::backdrop { background: rgba(1, 2, 4, 0.76); backdrop-filter: blur(5px); }
.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%; }
.help-dialog { width: min(760px, calc(100% - 32px)); }

.help-stage {
    position: relative;
    margin: 20px 0 14px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: #05070b;
}

#mouse-help-canvas {
    width: 100%;
    aspect-ratio: 2.05;
    display: block;
}

.help-render-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 7px;
    border: 1px solid rgba(114, 222, 219, 0.28);
    border-radius: 3px;
    color: var(--cyan);
    background: rgba(5, 8, 12, 0.78);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 8px;
    pointer-events: none;
}

.help-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
}

.help-mode {
    min-width: 0;
    min-height: 72px;
    padding: 12px;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.help-mode-front { border-right: 1px solid var(--line); }

.help-mode-key {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(224, 228, 238, 0.16);
    border-radius: 4px;
    color: var(--muted);
    background: rgba(2, 3, 6, 0.46);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 8px;
}

.help-mode-key i { color: var(--cyan); font-size: 14px; }
.help-mode-rear .help-mode-key i { color: var(--violet); }
.help-mode > span:nth-child(2) { min-width: 0; }
.help-mode strong, .help-mode small { display: block; }
.help-mode strong { color: var(--ink); font-size: 11px; }
.help-mode small { margin-top: 4px; color: var(--dim); font-size: 9px; }

.help-mode em {
    color: var(--cyan);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 16px;
    font-style: normal;
    text-align: center;
}

.help-mode-rear em { color: var(--violet); }

.help-wheel-note {
    margin: 12px 0 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 10px;
}

.help-wheel-note i { color: var(--gold); font-size: 16px; }
.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; }

@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; }
    .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: 70px; gap: 12px; }
    .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
    .brand-copy small, .system-state span:last-child { display: none; }
    .topbar-actions { gap: 10px; }
    .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 { margin-top: 24px; }
    .login-panel, .control-panel { padding: 24px 18px; }
    .settings-layout { grid-template-columns: 1fr; gap: 20px; }
    .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; }
    .help-mode-grid { grid-template-columns: 1fr; }
    .help-mode-front { border-right: 0; border-bottom: 1px solid var(--line); }
    .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; }
    .login-panel, .control-panel { padding: 20px 14px; }
    .key-field input { padding-left: 42px; font-size: 12px; }
    .glass-dialog form { padding: 20px 15px; }
    .help-mode { grid-template-columns: 62px minmax(0, 1fr) 24px; gap: 9px; }
}

@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); }
}
