/* ==== theme ==== */

:root {
    --bg: #04070a;
    --bg-1: #080d11;
    --bg-2: #0c1318;
    --bg-3: #111b22;
    --line: #17302a;
    --line-2: #22473c;
    --fg: #c6f5dc;
    --dim: #5f8a77;
    --green: #39ff88;
    --green-2: #19c565;
    --cyan: #3ad7ff;
    --amber: #ffb000;
    --red: #ff4f5e;
    --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "DejaVu Sans Mono", Menlo, Consolas, monospace;
    --glow: 0 0 6px rgba(57, 255, 136, 0.55), 0 0 18px rgba(57, 255, 136, 0.18);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}
body {
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% -10%, rgba(57, 255, 136, 0.07), transparent 55%),
        radial-gradient(ellipse at 110% 110%, rgba(58, 215, 255, 0.06), transparent 50%);
    background-attachment: fixed;
    color: var(--fg);
    line-height: 1.5;
    margin: 0;
    padding: 10px;
    font-family: var(--mono);
    font-size: 13px;
}
a {
    color: var(--cyan);
    text-decoration: none;
    cursor: pointer;
}
a:hover {
    color: var(--green);
    text-shadow: var(--glow);
}
::selection {
    background: var(--green);
    color: #000;
}
.dim {
    color: var(--dim);
}
.glow {
    color: var(--green);
    text-shadow: var(--glow);
}
h4 {
    margin: 0 0 12px 0;
    color: var(--green);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 12px;
}
hr {
    border: 0;
    border-top: 1px dashed var(--line-2);
}
* {
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}

/* ==== controls ==== */

button, .file-button {
    font: inherit;
    color: var(--fg);
    background: linear-gradient(var(--bg-3), var(--bg-2));
    border: 1px solid var(--line-2);
    border-radius: 3px;
    padding: 4px 10px;
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s, box-shadow 0.12s, background 0.12s;
}
button:hover:not(:disabled), .file-button:hover {
    border-color: var(--green);
    color: var(--green);
    box-shadow: 0 0 0 1px rgba(57, 255, 136, 0.15), 0 0 12px rgba(57, 255, 136, 0.15);
}
button:active:not(:disabled) {
    background: var(--bg-1);
}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 1px solid var(--green);
    outline-offset: 1px;
}
button:disabled {
    opacity: 0.35;
    cursor: default;
}
button.ghost {
    background: transparent;
}
button.small {
    padding: 0 6px;
    font-size: 11px;
}
.tb-danger:hover:not(:disabled) {
    border-color: var(--red) !important;
    color: var(--red) !important;
    box-shadow: 0 0 12px rgba(255, 79, 94, 0.2) !important;
}
input[type=text], input[type=url], input[type=search], input[type=number], select, textarea {
    font: inherit;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--line-2);
    border-radius: 3px;
    padding: 4px 6px;
}
input:disabled {
    opacity: 0.45;
}
textarea {
    width: 100%;
    resize: vertical;
    line-height: 1.45;
}
input[type=number] {
    width: 80px;
}
input[type=checkbox] {
    accent-color: var(--green);
    vertical-align: middle;
    position: relative;
    bottom: 1px;
    margin: 0;
    width: 15px;
    height: 15px;
}
input[type=range] {
    accent-color: var(--green);
    flex: 1;
}
input[type=file] {
    font: inherit;
    color: var(--dim);
}
input[type=file]::file-selector-button {
    font: inherit;
    color: var(--fg);
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: 3px;
    padding: 2px 8px;
    margin-right: 8px;
    cursor: pointer;
}
label {
    user-select: none;
    white-space: nowrap;
}
.presets a {
    margin-right: 8px;
    white-space: nowrap;
}
.presets a::before {
    content: "[";
    color: var(--dim);
}
.presets a::after {
    content: "]";
    color: var(--dim);
}
.row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.row input[type=url] {
    flex: 1;
}
.tb-spacer {
    flex: 1;
}
.hint {
    color: var(--dim);
    font-size: 12px;
    white-space: normal;
}
.hint-error, .error-text {
    color: var(--red);
}
.error-text {
    white-space: pre-wrap;
    margin: 8px 0 0 0;
    font: inherit;
}
.error-text:empty {
    display: none;
}

.blink {
    animation: blink 0.6s step-start infinite;
}
@keyframes blink {
    50% {
        color: transparent;
    }
}
.blinking-cursor {
    animation: blinking-cursor 0.6s step-start infinite;
}
@keyframes blinking-cursor {
    50% {
        background-color: transparent;
    }
}

/* ==== machine manager ==== */

#manager {
    position: relative;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 20px);
    min-height: 520px;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    background: rgba(6, 11, 14, 0.92);
    box-shadow: 0 0 0 1px #000, 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 80px rgba(57, 255, 136, 0.03);
    overflow: hidden;
}
#manager::after {
    /* scanlines */
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
    z-index: 5;
}
#manager.booting {
    opacity: 0.4;
    pointer-events: none;
}

.mgr-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    background: linear-gradient(#0e171c, #0a1115);
    border-bottom: 1px solid var(--line-2);
}
.brand {
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.04em;
}
.brand .dim {
    font-weight: normal;
    font-size: 12px;
    margin-left: 6px;
}
.brand-glyph {
    color: var(--green);
    text-shadow: var(--glow);
    margin-right: 6px;
}
.mgr-prompt {
    font-size: 12px;
    color: var(--green);
}

.mgr-toolbar {
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-1);
}
.tb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 66px;
    padding: 5px 8px 3px;
    background: transparent;
    border-color: transparent;
    font-size: 11px;
    letter-spacing: 0.04em;
}
.tb svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tb:hover:not(:disabled) {
    background: var(--bg-3);
}
.tb-start:not(:disabled) {
    color: var(--green);
}
.tb-start:not(:disabled) svg {
    fill: rgba(57, 255, 136, 0.2);
    filter: drop-shadow(0 0 4px rgba(57, 255, 136, 0.6));
}
.tb-sep {
    width: 1px;
    margin: 4px 4px;
    background: var(--line);
}
.search {
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: center;
}
.search input {
    width: 230px;
}

.mgr-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.mgr-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--bg-1);
}
.side-head {
    padding: 8px 12px 6px;
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--dim);
    border-bottom: 1px solid var(--line);
}
#vm_list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 6px;
}
.vm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 3px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
}
.vm-item:hover {
    background: var(--bg-2);
    border-color: var(--line);
}
.vm-item.selected {
    background: linear-gradient(90deg, rgba(57, 255, 136, 0.13), rgba(57, 255, 136, 0.03));
    border-color: var(--line-2);
    box-shadow: inset 2px 0 0 var(--green);
}
.vm-item-text {
    flex: 1;
    min-width: 0;
}
.vm-item-name {
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vm-item.selected .vm-item-name {
    color: var(--green);
}
.vm-item-sub {
    font-size: 11px;
    color: var(--dim);
}
.vm-empty {
    padding: 20px 10px;
    color: var(--dim);
    text-align: center;
}
.vm-badge {
    --badge: var(--green);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 5px;
    border: 1px solid var(--badge);
    color: var(--badge);
    background: color-mix(in srgb, var(--badge) 12%, transparent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--badge) 30%, transparent), inset 0 0 8px color-mix(in srgb, var(--badge) 20%, transparent);
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 0 6px var(--badge);
}
.vm-badge-big {
    width: 64px;
    height: 64px;
    font-size: 26px;
    border-radius: 8px;
}
.vm-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dim);
}
.vm-dot-ok {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}
.vm-dot-missing {
    background: var(--red);
    box-shadow: 0 0 6px var(--red);
}
.vm-dot-probing {
    background: var(--amber);
    animation: blink 0.8s step-start infinite;
}
.drop-hint {
    margin: 8px;
    padding: 10px;
    border: 1px dashed var(--line-2);
    border-radius: 4px;
    color: var(--dim);
    font-size: 11px;
    text-align: center;
}
.drop-hint b {
    color: var(--fg);
    font-weight: normal;
}

.mgr-details {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px 30px;
}
.details-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--dim);
}
.ascii-logo {
    color: var(--green);
    text-shadow: var(--glow);
    font-size: 14px;
    line-height: 1.15;
}
.details-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.details-title {
    flex: 1;
    min-width: 0;
}
.details-title h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
}
.details-subtitle {
    color: var(--dim);
    margin: 2px 0 6px;
}
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pill {
    font-size: 10px;
    letter-spacing: 0.12em;
    padding: 1px 7px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--dim);
}
.pill-ok {
    color: var(--green);
    border-color: var(--green-2);
}
.pill-missing {
    color: var(--red);
    border-color: var(--red);
}
.pill-probing, .pill-warn {
    color: var(--amber);
    border-color: var(--amber);
}
.pill-info {
    color: var(--cyan);
    border-color: var(--cyan);
}
.big-start {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 26px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.08em;
    color: #001b0c;
    background: linear-gradient(#5dffa0, var(--green-2));
    border: 1px solid var(--green);
    border-radius: 4px;
    box-shadow: 0 0 18px rgba(57, 255, 136, 0.35);
}
.big-start:hover:not(:disabled) {
    color: #000;
    background: linear-gradient(#8bffbd, var(--green));
    box-shadow: 0 0 28px rgba(57, 255, 136, 0.6);
}
.big-start-icon {
    font-size: 13px;
}

.details-warning {
    margin: 0 0 14px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 176, 0, 0.5);
    border-left: 3px solid var(--amber);
    background: rgba(255, 176, 0, 0.06);
    color: var(--amber);
    border-radius: 3px;
}

.term-preview {
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #010302;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    color: var(--green);
    box-shadow: inset 0 0 30px rgba(57, 255, 136, 0.06);
    text-shadow: 0 0 5px rgba(57, 255, 136, 0.45);
    overflow-x: auto;
}
.term-line {
    white-space: pre;
    overflow: hidden;
    animation: term-in 0.22s steps(24, end) both;
    animation-delay: calc(var(--i) * 70ms);
}
.term-prompt {
    color: var(--cyan);
}
.term-cursor {
    display: inline-block;
    width: 0.6em;
    background: var(--green);
}
@keyframes term-in {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 12px;
}
.detail-box {
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--bg-1);
    min-width: 0;
}
.detail-wide {
    grid-column: 1 / -1;
}
.detail-span2 {
    grid-column: span 2;
}
@media (max-width: 1100px) {
    .detail-span2 {
        grid-column: 1 / -1;
    }
}
.detail-head {
    margin: 0;
    padding: 5px 10px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(57, 255, 136, 0.08), transparent);
}
.detail-icon {
    display: inline-block;
    width: 1.6em;
    color: var(--cyan);
}
.detail-rows {
    display: grid;
    grid-template-columns: minmax(110px, max-content) 1fr;
    gap: 3px 14px;
    margin: 0;
    padding: 8px 12px 10px;
}
.detail-rows dt {
    color: var(--dim);
}
.detail-rows dt:empty {
    display: none;
}
.detail-rows dt:empty + dd {
    grid-column: 1 / -1;
}
.detail-rows dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
.description-text {
    margin: 0;
    white-space: pre-wrap;
}
.media-name {
    color: var(--fg);
}
.media-meta {
    color: var(--dim);
}
.media-status-ok {
    color: var(--green);
}
.media-status-missing {
    color: var(--red);
}
.media-status-probing {
    color: var(--amber);
}
code, .cmdline {
    font-family: var(--mono);
    color: var(--cyan);
    font-size: 12px;
}

.mgr-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 12px;
    border-top: 1px solid var(--line);
    background: var(--bg-1);
    font-size: 11px;
    color: var(--dim);
    white-space: nowrap;
    overflow: hidden;
}
#mgr_status {
    overflow: hidden;
    text-overflow: ellipsis;
}
.mgr-links {
    display: flex;
    gap: 12px;
    align-items: center;
}
.mgr-links code {
    color: var(--dim);
    font-size: 11px;
}

#mgr_toasts {
    position: absolute;
    right: 16px;
    bottom: 36px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    z-index: 10;
    pointer-events: none;
}
.toast {
    max-width: 520px;
    padding: 7px 12px;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-left: 3px solid var(--cyan);
    border-radius: 3px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    white-space: pre-wrap;
    animation: toast-in 0.18s ease-out;
    transition: opacity 0.4s, transform 0.4s;
}
.toast-ok {
    border-left-color: var(--green);
}
.toast-error {
    border-left-color: var(--red);
    color: #ffc9ce;
}
.toast-out {
    opacity: 0;
    transform: translateX(20px);
}
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

#drop_overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 8, 4, 0.82);
    pointer-events: none;
}
#drop_overlay.visible {
    display: flex;
}
.drop-box {
    padding: 40px 60px;
    border: 2px dashed var(--green);
    border-radius: 10px;
    text-align: center;
    max-width: 520px;
    box-shadow: 0 0 40px rgba(57, 255, 136, 0.25), inset 0 0 40px rgba(57, 255, 136, 0.08);
    animation: drop-pulse 1.2s ease-in-out infinite alternate;
}
.drop-glyph {
    font-size: 48px;
    color: var(--green);
    text-shadow: var(--glow);
}
.drop-box .glow {
    font-size: 18px;
    margin-bottom: 8px;
}
@keyframes drop-pulse {
    to {
        box-shadow: 0 0 70px rgba(57, 255, 136, 0.45), inset 0 0 60px rgba(57, 255, 136, 0.14);
    }
}

/* ==== dialogs ==== */

dialog.win {
    padding: 0;
    width: min(620px, calc(100vw - 30px));
    max-height: calc(100dvh - 40px);
    color: var(--fg);
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: 6px;
    box-shadow: 0 0 0 1px #000, 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(57, 255, 136, 0.08);
}
dialog.win[open] {
    display: flex;
    flex-direction: column;
    animation: win-in 0.14s ease-out;
}
dialog.win-wide {
    width: min(860px, calc(100vw - 30px));
}
dialog::backdrop {
    background: rgba(0, 4, 2, 0.72);
    backdrop-filter: blur(2px);
}
@keyframes win-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
}
.win-title {
    padding: 8px 14px;
    font-weight: bold;
    color: var(--green);
    text-shadow: var(--glow);
    background: linear-gradient(#0e171c, #0a1115);
    border-bottom: 1px solid var(--line-2);
}
.win-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 14px 0;
    border-bottom: 1px solid var(--line);
}
.win-tab {
    border-radius: 3px 3px 0 0;
    border-bottom: 0;
    background: transparent;
    color: var(--dim);
}
.win-tab.active {
    color: var(--green);
    background: var(--bg-3);
    border-color: var(--line-2);
}
.win-body {
    padding: 14px 16px;
    overflow-y: auto;
}
.win-body p {
    margin-top: 0;
}
.win-buttons {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    background: var(--bg);
}
.win-buttons button:last-child:not(.ghost) {
    border-color: var(--green-2);
    color: var(--green);
}
.file-drop {
    display: block;
    padding: 26px;
    border: 1px dashed var(--line-2);
    border-radius: 5px;
    text-align: center;
    color: var(--dim);
    cursor: pointer;
    white-space: normal;
}
.file-drop:hover {
    border-color: var(--green);
    color: var(--green);
}
.file-drop input, .file-button input {
    display: none;
}
.file-drop span {
    display: block;
}

.settings-layout {
    display: flex;
    min-height: 380px;
    overflow: hidden;
}
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 8px;
    min-width: 180px;
    border-right: 1px solid var(--line);
    background: var(--bg);
}
.settings-nav .win-tab {
    text-align: left;
    border-radius: 3px;
    border: 1px solid transparent;
}
.settings-nav .win-tab.active {
    border-color: var(--line-2);
    box-shadow: inset 2px 0 0 var(--green);
}
.settings-body {
    flex: 1;
}
.field {
    display: grid;
    grid-template-columns: 190px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.field-top {
    align-items: start;
}
.field > span:first-child {
    color: var(--dim);
    white-space: normal;
}
.field input[type=text], .field textarea, .field select {
    width: 100%;
}
.field input[type=checkbox] {
    justify-self: start;
}
.slider {
    display: flex;
    align-items: center;
    gap: 10px;
}
.local-file {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: var(--cyan);
}
#set_json {
    min-height: 340px;
    font-size: 12px;
}

#setup {
    border-collapse: collapse;
    width: 100%;
}
#setup td {
    padding: 3px 8px;
}
#setup td:first-child {
    width: 240px;
    color: var(--dim);
}
#start_emulation {
    font-weight: bold;
}

/* ==== running machine ==== */

#runtime_options {
    margin-bottom: 10px;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    background: var(--bg-1);
    overflow: hidden;
}
.rt-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-weight: bold;
    background: linear-gradient(#0e171c, #0a1115);
    border-bottom: 1px solid var(--line);
}
.rt-state {
    color: var(--dim);
    font-weight: normal;
}
.rt-back {
    padding: 2px 10px;
    margin-right: 6px;
    font-size: 12px;
    font-weight: normal;
}
#rt_brand {
    font-weight: normal;
}
#rt_brand:hover {
    color: var(--green);
}
/* until the machine is running, only the title bar (with the way back) is shown */
#runtime_options.rt-loading .rt-groups {
    display: none;
}
#runtime_options.rt-loading .rt-title {
    border-bottom: 0;
}
.rt-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 6px 10px;
}
.rt-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}
.rt-label {
    color: var(--dim);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-right: 2px;
}
.rt-group + .rt-group {
    padding-left: 14px;
    border-left: 1px solid var(--line);
}
.rt-group button {
    padding: 2px 8px;
    font-size: 12px;
}
.rt-scale input {
    width: 60px;
    padding: 1px 4px;
}
#loading {
    margin: 10px 0;
    padding: 12px 14px;
    font-family: var(--mono);
    color: var(--green);
    text-shadow: 0 0 5px rgba(57, 255, 136, 0.45);
    background: #010302;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    white-space: pre-wrap;
}

#log, #runtime_infos, #serial, #filesystem_panel, #debug_panel {
    font-family: var(--mono);
    font-size: 12px;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    background-color: #010302;
    padding: 8px;
    color: var(--fg);
}
.info-head {
    color: var(--green);
    letter-spacing: 0.16em;
    font-size: 11px;
    margin-bottom: 4px;
}
#runtime_infos b, #filesystem_panel label {
    color: var(--cyan);
    font-weight: normal;
}
#screen_container:fullscreen {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
#screen_container:fullscreen #vga {
    width: auto !important;
    height: 100% !important;
}
#runtime_infos, #filesystem_panel {
    float: left;
    width: 250px;
    margin-bottom: 7px;
    margin-right: 7px;
    padding-bottom: 7px;
}
#log {
    height: 100px;
    width: 550px;
}
#debug_panel {
    white-space: pre;
    float: left;
}
#serial {
    margin: 0;
}
#serial:focus {
    outline: 1px solid var(--amber);
}
#screen {
    white-space: pre;
    position: relative;
    font-family: Liberation Mono, DejaVu Sans Mono, Courier New, monospace;
    font-weight: bold;
    font-size: 15px;
    line-height: normal;
}
#screen, #vga {
    -webkit-transform-origin: top left;
    -moz-transform-origin: top left;
    transform-origin: top left;
}
#vga {
    background-color: #000;
    touch-action: none;
}
#screen_container {
    float: left;
    margin-right: 10px;
    margin-bottom: 10px;
    background: #000;
    outline: 1px solid var(--line-2);
    box-shadow: 0 0 0 4px var(--bg-1), 0 0 0 5px var(--line), 0 0 40px rgba(57, 255, 136, 0.08);
}
.phone_keyboard {
    width: 0;
    height: 0;
    resize: none;
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    z-index: -10;
    white-space: nowrap;
    overflow: hidden;
}
#terminal {
    max-width: 1024px;
}

/* debug.html */
#boot_options > button, #debug_profiles button {
    margin: 0 4px 4px 0;
}

.theatre_screen_container {
    position: fixed;
    transform: translate(-50%, -50%);
    top: 50dvh;
    left: 50vw;
    z-index: 2;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    float: none;
}
.theatre_runtime_options {
    position: fixed;
    width: 100vw;
    top: 0;
    left: 0;
    border-radius: 0 !important;
    z-index: 3;
    background-color: black;
    transform: translate(0%, -50%);
}
.theatre_runtime_options:hover {
    transform: translate(0%, 0%);
}
.theatre_runtime_infos {
    position: fixed;
    bottom: 0;
    z-index: 4;
    margin: 0 !important;
    transform: translate(-10px, calc(100% - 65px));
    opacity: 40%;
}
.theatre_runtime_infos:hover {
    transform: translate(-10px, -5px);
}
.theatre_filesystem_panel {
    position: fixed;
    bottom: 0;
    z-index: 4;
    margin: 0 !important;
    transform: translate(0%, 75%);
    left: 280px;
}
.theatre_filesystem_panel:hover {
    transform: translate(0%, -5px);
}
#theatre_background {
    position: fixed;
    width: 100vw;
    height: 100dvh;
    top: 0;
    left: 0;
    background-color: black;
    display: none;
    z-index: 1;
}
#toggle_ui {
    display: none;
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 5;
}
.theatre_filesystem_panel {
    opacity: 40%;
}
#toggle_ui, .theatre_runtime_options {
    opacity: 25%;
}
#toggle_ui,
.theatre_runtime_options,
.theatre_runtime_infos,
.theatre_filesystem_panel {
    transition: 0.25s;
}
#toggle_ui:hover,
.theatre_runtime_options:hover,
.theatre_runtime_infos:hover,
.theatre_filesystem_panel:hover {
    opacity: 100%;
}

@media (max-width: 900px) {
    .mgr-sidebar {
        width: 220px;
    }
    .search input {
        width: 140px;
    }
    .brand .dim, .mgr-links > a, .tb span {
        display: none;
    }
    .tb {
        min-width: 40px;
    }
    .details-header {
        flex-wrap: wrap;
    }
}
@media (max-width: 640px) {
    #manager {
        height: auto;
    }
    .mgr-body {
        flex-direction: column;
    }
    .mgr-sidebar {
        width: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    #vm_list {
        max-height: 40vh;
    }
    .field {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .settings-layout {
        flex-direction: column;
    }
    .settings-nav {
        flex-direction: row;
        flex-wrap: wrap;
        border-right: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .term-line, .toast, dialog.win[open], .drop-box {
        animation: none;
    }
}

/* the code below was copied from xterm.css */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
    outline: none;
}

.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    /**
     * The z-index of the helpers must be higher than the canvases in order for
     * IMEs to appear on top.
     */
    z-index: 5;
}

.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    /* Move textarea out of the screen to the far left, so that the cursor is not visible */
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    /** Prevent wrapping so the IME appears against the textarea at the correct position */
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}

.xterm .composition-view {
    /* TODO: Composition position got messed up somewhere */
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.xterm .composition-view.active {
    display: block;
}

.xterm .xterm-viewport {
    /* On OS X this is required in order for the scroll bar to appear fully opaque */
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}

.xterm .xterm-screen {
    position: relative;
}

.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}

.xterm .xterm-scroll-area {
    visibility: hidden;
}

.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}

.xterm.enable-mouse-events {
    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
    cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}

.xterm.column-select.focus {
    /* Column selection mode */
    cursor: crosshair;
}

.xterm .xterm-accessibility,
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
    pointer-events: none;
}

.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.xterm-dim {
    /* Dim should not apply to background, so the opacity of the foreground color is applied
     * explicitly in the generated class and reset to 1 here */
    opacity: 1 !important;
}

.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }

.xterm-overline {
    text-decoration: overline;
}

.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }

.xterm-strikethrough {
    text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
	z-index: 6;
	position: absolute;
}

.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
	z-index: 7;
}

.xterm-decoration-overview-ruler {
    z-index: 8;
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: none;
}

.xterm-decoration-top {
    z-index: 2;
    position: relative;
}
