.vm-page {
    padding-top: 0;
}

.vm-wrap {
    width: min(calc(100% - 32px), 1120px);
    margin: 0 auto;
    padding: clamp(18px, 4vw, 40px) 0 28px;
}

.vm-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 10px;
    font-weight: 600;
}

.vm-panel {
    padding: clamp(18px, 3vw, 34px);
    margin-bottom: 14px;
}

.vm-panel h1 {
    font-size: clamp(1.65rem, 3vw, 2.4rem);
    line-height: 1.25;
}

.vm-intro {
    margin-top: 11px;
    color: var(--muted);
}

.vm-intro code {
    white-space: nowrap;
}

.vm-panel fieldset {
    min-width: 0;
    margin: 24px 0 0;
    padding: 0;
    border: 0;
}

.vm-panel legend {
    padding: 0;
    margin-bottom: 8px;
    color: var(--navy);
    font-weight: 600;
}

.vm-system-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.vm-system {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    line-height: 1.45;
    cursor: pointer;
}

.vm-system:has(input:checked) {
    border-color: var(--link-hover);
    background: #edf3fa;
}

.vm-system:has(input:disabled) {
    cursor: default;
}

.vm-system input {
    flex: none;
    margin: 0;
    accent-color: var(--navy);
}

.vm-system small {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.vm-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-top: 16px;
}

.vm-wrap button {
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
    font: 600 0.95rem/1.35 "Segoe UI", "Noto Sans SC", sans-serif;
    cursor: pointer;
}

.vm-wrap button:disabled {
    opacity: 0.55;
    cursor: default;
}

.vm-wrap button:enabled:hover {
    background: var(--link-hover);
}

.vm-wrap .vm-secondary {
    border-color: var(--panel-border);
    background: #fff;
    color: var(--navy);
}

.vm-wrap .vm-secondary:enabled:hover {
    background: #edf3fa;
}

.vm-footer a,
.vm-local-options a {
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.vm-wrap :is(a, button, input, select, .vm-screen):focus-visible {
    outline: 2px solid var(--link-hover);
    outline-offset: 3px;
}

.vm-status, .vm-footer {
    color: var(--muted);
    font: 0.88rem/1.6 "Segoe UI", "Noto Sans SC", sans-serif;
}

.vm-status {
    margin-top: 12px;
}

.vm-screen {
    overflow: auto;
    margin-top: 14px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    background: #0b1422;
    color: #ecf3fd;
}

.vm-console {
    height: clamp(220px, 48vh, 500px);
    height: clamp(220px, 48dvh, 500px);
    padding: 15px 16px;
    font: 0.9rem/1.55 Consolas, 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.vm-display {
    min-height: 100px;
    padding: 8px;
    background: #080d16;
    touch-action: pan-y;
}

.vm-display canvas {
    max-width: 100%;
    height: auto !important;
    margin: 0 auto;
}

.vm-display > div {
    width: max-content;
    margin: 0 auto;
    font: clamp(7px, 1.8vw, 14px)/1.05 Consolas, 'Courier New', monospace;
    white-space: pre;
}

.vm-command,
.vm-local-options,
.vm-shortcuts:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.vm-local-options[hidden] {
    display: none;
}

.vm-image-format:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vm-command label {
    width: 100%;
}

.vm-command input,
.vm-local-options select {
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid #b4c0d1;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.vm-command input {
    flex: 1 1 9rem;
    min-width: 0;
    font-family: Consolas, 'Courier New', monospace;
}

.vm-local-options input {
    max-width: 100%;
}

.vm-file-label {
    width: 100%;
}

@media (max-width: 620px) {
    .vm-wrap {
        width: calc(100% - 20px);
    }

    .vm-system-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .vm-screen {
        margin-inline: -8px;
    }
}
