/* ==========================================================================
   emu8086 4.08 — Exact 1:1 Classic Windows Desktop Chrome & Layout
   Faithfully mirrors Color.kt, Theme.kt, Type.kt, WinClassicChrome.kt,
   and all 5 Android reference screenshots.
   ========================================================================== */

:root {
    --win-bg: #ECE9D8;
    --panel-bg: #F0F0F0;
    --btn-face: #E4E1D0;
    --btn-pressed: #D4D0C8;
    --surface-white: #FFFFFF;
    --gutter-bg: #F2F0E4;

    --bevel-light: #FFFFFF;
    --bevel-shadow: #808080;
    --bevel-dark: #404040;
    --grid-line: #D0D0D0;
    --group-border: #A0A0A0;

    --title-blue: #0A246A;
    --title-bar-bg: #FFFFFF;
    --title-bar-border: #D4D4D4;
    --menu-bg: #F0F0F0;
    --toolbar-bg: #F0F0F0;

    --editor-margin-strip: #9E9E9E;
    --editor-line-gray: #7A7A7A;
    --scrollbar-track: #F0F0F0;
    --scrollbar-thumb: #C1C1C1;
    --bookmark-blue: #0066CC;

    --active-source-yellow: #FFFF00;
    --active-blue: #0000FF;
    --active-text: #FFFFFF;
    --reg-changed-blue: #ADD8E6;
    --mem-addr-gray: #5A5A5A;
    --mem-hex-green: #008000;

    --syn-inst: #0000FF;
    --syn-reg: #CC0000;
    --syn-cmt: #008000;
    --syn-num: #000000;
    --syn-str: #008080;
    --syn-lbl: #000000;

    --text-primary: #000000;
    --text-secondary: #3A3A3A;
    --err-red: #C00000;
    --ok-green: #008000;
    --warn-amber: #D4A017;

    --flag-zero: #0000FF;
    --flag-one: #CC0000;
    --chip-green: #2E7D32;
    --chip-gold: #E6C200;
    --invalid-pink: #FFD6D6;
    --close-red: #C75050;
    --close-cap-red: #D32F2F;
    --close-cap-pressed: #A81C1C;

    --font-ui: 'IBM Plex Sans', 'Segoe UI', Tahoma, Geneva, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
}

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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--toolbar-bg);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 12px;
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

#app-root {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

.mono { font-family: var(--font-mono); }
.bold { font-weight: 700; }
.err-text { color: var(--err-red); font-size: 11px; }

/* --- Classic Windows 3D Bevels --- */
.win-bevel-raised {
    border-top: 1px solid var(--bevel-light);
    border-left: 1px solid var(--bevel-light);
    border-right: 1px solid var(--bevel-dark);
    border-bottom: 1px solid var(--bevel-dark);
    box-shadow: inset -1px -1px 0 var(--bevel-shadow);
}

.win-bevel-sunken {
    border-top: 1px solid var(--bevel-shadow);
    border-left: 1px solid var(--bevel-shadow);
    border-right: 1px solid var(--bevel-light);
    border-bottom: 1px solid var(--bevel-light);
    box-shadow: inset 1px 1px 0 var(--bevel-dark);
}

/* Classic Scrollbar Styling (Chromium/WebKit/Firefox) */
::-webkit-scrollbar {
    width: 13px;
    height: 13px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-left: 1px solid var(--title-bar-border);
    border-top: 1px solid var(--title-bar-border);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: 1px solid var(--scrollbar-track);
}
::-webkit-scrollbar-thumb:hover {
    background: #A4A4A4;
}
::-webkit-scrollbar-button {
    background: var(--toolbar-bg);
    border: 1px solid var(--title-bar-border);
    width: 13px;
    height: 13px;
}

/* --- Common Screen Shell --- */
.screen-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--toolbar-bg);
    overflow: hidden;
}

/* --- Retro CPU Chip & [F] Badges --- */
.chip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--chip-green);
    border: 1px solid var(--chip-gold);
    flex-shrink: 0;
}

.flag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--surface-white);
    border: 1px solid var(--bevel-dark);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11px;
    color: var(--flag-zero);
    flex-shrink: 0;
}

/* --- Desktop Light Window Title Bar --- */
.win-desktop-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--title-bar-bg);
    border-bottom: 1px solid var(--title-bar-border);
    padding: 4px 8px;
    min-height: 30px;
    flex-shrink: 0;
}

.win-desktop-title {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-filename {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.home-back-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: #111111;
    text-decoration: none;
    padding: 2px 8px;
    background: var(--btn-face);
    border-top: 1px solid var(--bevel-light);
    border-left: 1px solid var(--bevel-light);
    border-right: 1px solid var(--bevel-dark);
    border-bottom: 1px solid var(--bevel-dark);
    box-shadow: inset -1px -1px 0 var(--bevel-shadow);
    white-space: nowrap;
    margin-left: 4px;
}
.home-back-link:hover {
    color: var(--title-blue);
    background: var(--win-bg);
}
.home-back-link:active {
    color: #111111;
    background: var(--btn-pressed);
    border-top: 1px solid var(--bevel-shadow);
    border-left: 1px solid var(--bevel-shadow);
    border-right: 1px solid var(--bevel-light);
    border-bottom: 1px solid var(--bevel-light);
    box-shadow: inset 1px 1px 0 var(--bevel-dark);
}

.dbg-status-badge {
    font-size: 10.5px;
    color: var(--title-blue);
    margin-right: 6px;
    white-space: nowrap;
}
.dbg-status-badge.is-fault {
    color: var(--err-red);
}

/* Unified "back to editor | red X" button in Debugger Title Bar */
.win-return-editor {
    display: inline-flex;
    align-items: stretch;
    height: 28px;
    padding: 1px;
    background: var(--toolbar-bg);
    cursor: pointer;
    flex-shrink: 0;
}
.win-return-editor:active {
    background: var(--btn-pressed);
}
.ret-label {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 11.5px;
    color: var(--close-cap-pressed);
    white-space: nowrap;
}
.ret-sep {
    width: 1px;
    background: var(--bevel-shadow);
}
.ret-x-cap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    background: var(--close-cap-red);
    color: var(--surface-white);
}
.win-return-editor:hover .ret-x-cap {
    background: var(--close-cap-pressed);
}

/* Hide chunky horizontal scrollbars on sleek chrome strips while keeping touch/wheel horizontal scroll */
.win-menubar,
.win-toolbar,
.emu-bottom-bar,
.quick-keys-scroll {
    scrollbar-width: none;
}
.win-menubar::-webkit-scrollbar,
.win-toolbar::-webkit-scrollbar,
.emu-bottom-bar::-webkit-scrollbar,
.quick-keys-scroll::-webkit-scrollbar {
    display: none;
    height: 0;
}

/* --- Classic Lowercase Menu Bar --- */
.win-menubar {
    display: flex;
    align-items: center;
    background: var(--menu-bg);
    border-bottom: 1px solid var(--title-bar-border);
    padding: 0 3px;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    z-index: 400;
}

.menu-item-wrap, .tb-dropdown-wrap, .bottom-drop-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.menu-label-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
}
.menu-label-btn:hover,
.menu-label-btn.is-open {
    background: var(--active-blue);
    color: var(--active-text);
}

/* Classic Dropdown Menu (anchored cleanly via fixed/absolute) */
.win-dropdown {
    display: none;
    position: fixed;
    min-width: 190px;
    max-width: calc(100vw - 8px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    background: var(--menu-bg);
    border-top: 1px solid var(--bevel-light);
    border-left: 1px solid var(--bevel-light);
    border-right: 1px solid var(--bevel-dark);
    border-bottom: 1px solid var(--bevel-dark);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.25);
    padding: 2px;
    z-index: 9800;
    flex-direction: column;
}
.win-dropdown.is-open {
    display: flex;
}

.win-dropdown-item {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 12px;
    text-align: left;
    padding: 5px 12px;
    cursor: pointer;
    white-space: nowrap;
}
.win-dropdown-item:hover:not(:disabled) {
    background: var(--active-blue);
    color: var(--active-text);
}
.win-dropdown-item:disabled {
    color: var(--bevel-shadow);
    cursor: default;
}

/* Ensure menubar/toolbar dropdowns aren't clipped horizontally on desktop */
@media (min-width: 720px) {
    .win-menubar, .win-toolbar, .emu-bottom-bar {
        overflow: visible;
    }
}

/* --- Classic Icon-Above-Label Toolbars --- */
.win-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--toolbar-bg);
    border-bottom: 1px solid var(--bevel-shadow);
    padding: 2px 5px;
    flex-shrink: 0;
    overflow-x: auto;
    position: relative;
    z-index: 300;
}

.dbg-exec-toolbar {
    gap: 4px;
    padding: 3px 5px;
    border-bottom-color: var(--title-bar-border);
}

.tb-icon-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 44px;
    padding: 3px 7px;
    cursor: pointer;
    color: var(--text-primary);
    font-family: var(--font-ui);
    flex-shrink: 0;
}
.tb-icon-btn.has-drop {
    flex-direction: row;
    gap: 1px;
}
.tb-ic-col {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.tb-drop-arrow {
    display: inline-flex;
    align-items: center;
    margin-left: 1px;
}
.tb-icon-btn:hover:not(:disabled) {
    border-top: 1px solid var(--bevel-light);
    border-left: 1px solid var(--bevel-light);
    border-right: 1px solid var(--bevel-shadow);
    border-bottom: 1px solid var(--bevel-shadow);
}
.tb-icon-btn.is-raised {
    background: var(--toolbar-bg);
    border-top: 1px solid var(--bevel-light);
    border-left: 1px solid var(--bevel-light);
    border-right: 1px solid var(--bevel-dark);
    border-bottom: 1px solid var(--bevel-dark);
    box-shadow: inset -1px -1px 0 var(--bevel-shadow);
}
.tb-icon-btn:active:not(:disabled),
.tb-icon-btn.is-open {
    background: var(--btn-pressed);
    border-top: 1px solid var(--bevel-shadow);
    border-left: 1px solid var(--bevel-shadow);
    border-right: 1px solid var(--bevel-light);
    border-bottom: 1px solid var(--bevel-light);
    box-shadow: inset 1px 1px 0 var(--bevel-dark);
}
.tb-icon-btn:disabled {
    cursor: default;
    opacity: 0.45;
}
.tb-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 19px;
}
.tb-lbl {
    font-size: 11px;
    line-height: 13px;
    margin-top: 1px;
    white-space: nowrap;
}

.win-vdiv {
    width: 2px;
    height: 34px;
    margin: 0 3px;
    border-left: 1px solid var(--bevel-shadow);
    border-right: 1px solid var(--bevel-light);
    flex-shrink: 0;
}
.win-vdiv-sm {
    height: 20px;
}

/* --- Classic Windows Push Button --- */
.win-btn {
    appearance: none;
    background: var(--toolbar-bg);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 11px;
    min-height: 28px;
    padding: 3px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    border-top: 1px solid var(--bevel-light);
    border-left: 1px solid var(--bevel-light);
    border-right: 1px solid var(--bevel-dark);
    border-bottom: 1px solid var(--bevel-dark);
    box-shadow: inset -1px -1px 0 var(--bevel-shadow);
    flex-shrink: 0;
}
.win-btn:active:not(:disabled),
.win-btn.is-active,
.win-btn.is-open {
    background: var(--btn-pressed);
    font-weight: 700;
    border-top: 1px solid var(--bevel-shadow);
    border-left: 1px solid var(--bevel-shadow);
    border-right: 1px solid var(--bevel-light);
    border-bottom: 1px solid var(--bevel-light);
    box-shadow: inset 1px 1px 0 var(--bevel-dark);
}
.win-btn:disabled {
    color: var(--bevel-shadow);
    cursor: default;
}
.win-btn-sm { min-height: 24px; padding: 2px 8px; }
.win-btn-xs { min-height: 21px; padding: 1px 6px; font-size: 10.5px; }
.win-btn-wide { min-width: 82px; min-height: 30px; }
.win-btn-icon { padding: 2px 5px; }

/* --- Find/Replace & Compile Error Strips --- */
.find-replace-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: var(--menu-bg);
    border-bottom: 1px solid var(--bevel-shadow);
    flex-shrink: 0;
}
.find-replace-strip .win-input {
    flex: 1;
    min-width: 80px;
}
.fr-icon { color: var(--text-secondary); display: inline-flex; }

.compile-error-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-white);
    border: 1px solid var(--err-red);
    padding: 3px 8px;
    flex-shrink: 0;
}
.compile-error-msg {
    flex: 1;
    font-size: 11px;
    color: var(--err-red);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Editor Code Canvas with Classic Gutter --- */
.editor-screen {
    --ed-font-size: 13px;
    --ed-line-height: 18px;
    --base-editor-pad-bottom: 48px;
    --editor-kb-inset: 0px;
}

.editor-canvas-frame {
    flex: 1;
    min-height: 0;
    background: var(--surface-white);
    display: flex;
    overflow: hidden;
}

.editor-scroll-viewport {
    flex: 1;
    overflow: auto;
    background: var(--surface-white);
}

.editor-inner-row {
    display: flex;
    min-height: 100%;
    min-width: 100%;
}

.editor-bookmark-strip {
    width: 16px;
    flex-shrink: 0;
    background: var(--editor-margin-strip);
    padding: 4px 0 calc(var(--base-editor-pad-bottom, 16px) + var(--editor-kb-inset, 0px)) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ed-bm {
    width: 16px;
    height: var(--ed-line-height);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.ed-bm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bookmark-blue);
}

.editor-linenums {
    width: 28px;
    flex-shrink: 0;
    background: var(--surface-white);
    padding: 4px 4px calc(var(--base-editor-pad-bottom, 16px) + var(--editor-kb-inset, 0px)) 2px;
    text-align: right;
    color: var(--editor-line-gray);
    font-size: var(--ed-font-size);
    line-height: var(--ed-line-height);
}
.ed-ln {
    height: var(--ed-line-height);
}
.ed-ln.is-err {
    color: var(--err-red);
    font-weight: 700;
}

.editor-code-stack {
    position: relative;
    flex: 1;
    min-width: 0;
}

.editor-highlight-layer,
.editor-textarea {
    margin: 0;
    padding: 4px 48px calc(var(--base-editor-pad-bottom, 16px) + var(--editor-kb-inset, 0px)) 4px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: var(--ed-font-size);
    line-height: var(--ed-line-height);
    letter-spacing: 0;
    tab-size: 4;
    white-space: pre;
    overflow-wrap: normal;
    border: none;
    outline: none;
}

.editor-code-stack.is-wrapped .editor-highlight-layer,
.editor-code-stack.is-wrapped .editor-textarea {
    white-space: pre-wrap;
    overflow-wrap: break-word;
    padding-right: 8px;
}

.editor-highlight-layer {
    pointer-events: none;
    color: var(--syn-num);
    min-height: 100%;
}

.editor-textarea {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    color: transparent;
    caret-color: #000000;
    resize: none;
    overflow: hidden;
    user-select: text;
}
.editor-textarea::selection {
    background: rgba(0, 0, 255, 0.22);
    color: transparent;
}

/* Exact emu8086 4.08 Syntax Colors */
.syn-inst { color: var(--syn-inst); }
.syn-reg  { color: var(--syn-reg); }
.syn-cmt  { color: var(--syn-cmt); }
.syn-str  { color: var(--syn-str); }
.syn-num  { color: var(--syn-num); }
.syn-lbl  { color: var(--syn-lbl); }
.syn-def  { color: var(--syn-num); }

/* Quick Keys Bar — shown only on narrow touch viewports */
.quick-keys-bar {
    display: none;
    align-items: center;
    gap: 3px;
    background: var(--btn-pressed);
    padding: 2px 4px;
    flex-shrink: 0;
}
.quick-keys-scroll {
    flex: 1;
    display: flex;
    gap: 3px;
    overflow-x: auto;
}
@media (max-width: 767px) and (pointer: coarse) {
    .quick-keys-bar { display: flex; }
}

/* --- Classic Recessed Editor Status Bar --- */
/* Reserves 38px on the right so the bottom-right fixed Fullscreen toggle NEVER overlaps! */
.editor-status-bar {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--toolbar-bg);
    padding: 3px 38px 3px 4px;
    min-height: 30px;
    flex-shrink: 0;
}

.status-cell {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--toolbar-bg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-ins-btn {
    cursor: pointer;
    color: var(--title-blue);
}
.status-ins-btn.is-ovr {
    color: var(--err-red);
}
.status-msg {
    flex: 1;
    min-width: 0;
}

/* ==========================================================================
   DEBUGGER / EMULATOR SCREEN
   ========================================================================== */

.delay-slider-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 156px;
    padding: 0 6px;
    flex-shrink: 0;
}
.delay-slider-track-area {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.win-slider {
    width: 100%;
    height: 16px;
    margin: 0;
    accent-color: var(--title-blue);
    cursor: pointer;
}
.slider-ticks {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: calc(100% - 14px);
    height: 6px;
    pointer-events: none;
}
.s-tick {
    width: 1px;
    height: 3px;
    background: var(--bevel-shadow);
}
.s-tick.tall {
    height: 5px;
}
.delay-slider-label {
    font-size: 11px;
    color: var(--text-primary);
    margin-top: 1px;
    white-space: nowrap;
}

.steps-counter {
    font-size: 10.5px;
    color: var(--text-secondary);
    padding: 3px 7px;
    margin-left: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cpu-fault-banner {
    background: var(--err-red);
    color: var(--surface-white);
    font-size: 11px;
    padding: 2px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* --- 3-Column Classic Debugger Workspace --- */
.dbg-workspace {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    padding: 2px 3px;
    overflow: hidden;
}

.dbg-three-cols {
    display: flex;
    gap: 4px;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.dbg-col-regs {
    width: 132px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
}

.win-groupbox {
    border: 1px solid var(--group-border);
    margin: 0;
    padding: 3px 4px 4px;
    min-width: 0;
}
.win-groupbox > legend {
    font-size: 11px;
    padding: 0 4px;
    color: var(--text-primary);
}
.regs-groupbox {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.regs-scroll-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    position: relative;
}
.regs-inner {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 1px 1px 4px;
}
.reg-hl-hdr {
    display: flex;
    align-items: center;
    font-size: 10px;
    text-align: center;
}
.reg-hl-hdr > span:not(.reg-lbl-sp) { flex: 1; }
.reg-lbl-sp { width: 24px; flex-shrink: 0; }
.reg-row {
    display: flex;
    align-items: center;
    gap: 3px;
}
.reg-lbl {
    appearance: none;
    border: none;
    background: transparent;
    width: 24px;
    padding: 0;
    text-align: left;
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.reg-val {
    appearance: none;
    flex: 1;
    min-width: 0;
    background: var(--surface-white);
    color: var(--text-primary);
    font-size: 11.5px;
    padding: 2px 3px;
    text-align: center;
    cursor: pointer;
}
.reg-val.is-changed {
    background: var(--reg-changed-blue);
}
.reg-gap { height: 4px; }
.regs-scroll-hint {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(240, 240, 240, 0.94);
    color: var(--title-blue);
    font-size: 9.5px;
    font-weight: 700;
    justify-content: center;
    padding: 1px 0;
    pointer-events: none;
}

/* Column 2: Memory & Column 3: Disassembler */
.dbg-col-mem {
    width: 194px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dbg-col-disasm {
    flex: 1;
    min-width: 220px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.addr-input-row {
    display: flex;
    justify-content: center;
    padding: 0 4px;
}
.addr-input-left {
    justify-content: flex-start;
    padding-left: 14px;
}
.addr-input {
    width: 96px;
    background: var(--surface-white);
    color: var(--text-primary);
    font-size: 12px;
    text-align: center;
    padding: 2px 4px;
    outline: none;
}

.mem-list-well,
.disasm-list-well {
    flex: 1;
    min-height: 0;
    background: var(--surface-white);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1px;
}

.mem-row {
    font-size: 11px;
    line-height: 15px;
    padding: 0.5px 4px;
    white-space: nowrap;
    cursor: pointer;
}
.mem-row:hover:not(.is-active) {
    background: #F4F7FF;
}
.m-addr { color: var(--mem-addr-gray); }
.m-hex  { color: var(--mem-hex-green); }
.m-dec  { color: var(--mem-addr-gray); }
.m-asc  { color: var(--text-primary); }
.mem-row.is-active {
    background: var(--active-blue);
    color: var(--active-text);
}
.mem-row.is-active span {
    color: var(--active-text);
}

.disasm-row {
    font-size: 11.5px;
    line-height: 15.5px;
    padding: 0.5px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.disasm-row.is-active {
    background: var(--active-blue);
    color: var(--active-text);
}

/* --- Floating Clamped Sub-Windows --- */
.float-win {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--toolbar-bg);
    padding: 2px;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.win-sub-titlebar {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--title-bar-bg);
    border-bottom: 1px solid var(--title-bar-border);
    padding: 2px 5px;
    min-height: 24px;
    flex-shrink: 0;
}
.float-drag-handle {
    cursor: move;
    touch-action: none;
}
.win-sub-title-text {
    flex: 1;
    font-size: 11.5px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.win-sub-close {
    appearance: none;
    border: none;
    background: var(--title-bar-bg);
    color: var(--text-primary);
    width: 22px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.win-sub-close:hover {
    background: #E8E8E8;
}
.win-sub-close.is-red {
    background: var(--close-red);
    color: var(--surface-white);
}
.win-sub-close.is-red:hover {
    background: var(--close-cap-pressed);
}

.float-win-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.float-win.is-resizing {
    user-select: none;
}

/* Classic Windows 95/98/XP bottom resize strip + diagonal 3-line corner grip */
.float-win-resize-bar {
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    background: var(--toolbar-bg);
    border-top: 1px solid var(--title-bar-border);
}

#fw-viewer .float-win-resize-bar {
    background: var(--win-bg);
}

.float-resize-handle {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 1px;
    cursor: nwse-resize;
    touch-action: none;
    user-select: none;
}

.float-resize-handle .grip-hi {
    stroke: var(--bevel-light);
}

.float-resize-handle .grip-sh {
    stroke: var(--bevel-shadow);
}

.float-resize-handle:hover .grip-sh,
.float-win.is-resizing .float-resize-handle .grip-sh {
    stroke: var(--bevel-dark);
}

/* Original Source Code Floating Panel */
.orig-src-well {
    flex: 1;
    min-height: 0;
    background: var(--surface-white);
    overflow: auto;
    margin: 2px;
}
.orig-src-row {
    display: flex;
    align-items: center;
    min-width: max-content;
}
.orig-src-margin {
    width: 10px;
    height: 17px;
    background: var(--editor-margin-strip);
    flex-shrink: 0;
}
.orig-src-ln {
    width: 24px;
    padding-right: 4px;
    text-align: right;
    font-size: 11px;
    color: var(--editor-line-gray);
    flex-shrink: 0;
}
.orig-src-code {
    flex: 1;
    font-size: 11.5px;
    line-height: 15px;
    padding: 1px 4px;
    white-space: pre;
}
.orig-src-code.is-active {
    background: var(--active-source-yellow);
}

/* Vertical Flags Floating Window */
.flags-panel-col {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--toolbar-bg);
}
.flags-rows-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.flag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.flag-code {
    font-size: 12px;
    width: 26px;
}
.flag-combo-wrap {
    position: relative;
}
.flag-combo {
    appearance: none;
    display: inline-flex;
    align-items: stretch;
    width: 66px;
    height: 24px;
    padding: 1px;
    background: var(--surface-white);
    cursor: pointer;
}
.flag-val {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.flag-val.is-zero, .flag-opt.is-zero { color: var(--flag-zero); }
.flag-val.is-one,  .flag-opt.is-one  { color: var(--flag-one); }
.flag-arrow {
    width: 18px;
    background: var(--btn-face);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}
.flag-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 66px;
    background: var(--surface-white);
    border: 1px solid var(--bevel-dark);
    z-index: 200;
    display: flex;
    flex-direction: column;
}
.flag-opt {
    appearance: none;
    border: none;
    background: var(--surface-white);
    padding: 4px 0;
    font-size: 13px;
    cursor: pointer;
}
.flag-opt:hover {
    background: #E8F0FE;
}
.flags-analyse-footer {
    padding: 4px 5px;
    flex-shrink: 0;
    border-top: 1px solid var(--title-bar-border);
}
.flags-analyse-btn {
    width: 100%;
    min-height: 26px;
}

/* Lexical Flag Analyser Window */
.analyser-well {
    flex: 1;
    min-height: 0;
    background: var(--surface-white);
    margin: 2px;
    padding: 6px 8px;
    overflow: auto;
}
.analyser-text {
    margin: 0;
    font-size: 11.5px;
    line-height: 15.5px;
    color: var(--text-primary);
    white-space: pre;
    user-select: text;
}

/* Extended Value Viewer Window */
#fw-viewer, #fw-viewer .float-win-body {
    background: var(--win-bg);
}
.vv-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--win-bg);
}
.vv-top-watch {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vv-lbl { font-size: 12px; }
.vv-watch-wrap { position: relative; }
.vv-watch-combo {
    appearance: none;
    display: inline-flex;
    align-items: stretch;
    width: 104px;
    height: 25px;
    padding: 2px;
    background: var(--surface-white);
    cursor: pointer;
}
.vv-watch-blue {
    flex: 1;
    display: inline-flex;
    align-items: center;
    padding: 0 5px;
    background: var(--active-blue);
    color: var(--surface-white);
    font-size: 12px;
    outline: 1px dotted rgba(255, 255, 0, 0.75);
    outline-offset: -2px;
}
.vv-combo-arrow {
    width: 18px;
    margin-left: 1px;
    background: var(--btn-face);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}
.vv-watch-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 104px;
    max-height: 180px;
    overflow-y: auto;
    background: var(--surface-white);
    border: 1px solid var(--bevel-dark);
    z-index: 500;
    flex-direction: column;
}
.vv-watch-menu.is-open { display: flex; }
.vv-watch-opt {
    appearance: none;
    border: none;
    background: var(--surface-white);
    color: var(--text-primary);
    text-align: left;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}
.vv-watch-opt:hover,
.vv-watch-opt.is-selected {
    background: var(--active-blue);
    color: var(--surface-white);
}

.vv-radios {
    display: flex;
    justify-content: center;
    gap: 40px;
}
.vv-outer-box {
    border: 1px solid var(--group-border);
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.vv-col-headers {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vv-col-hdr {
    flex: 1;
    text-align: center;
    font-weight: 500;
    font-size: 12px;
}
.vv-field-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.vv-row-lbl {
    width: 60px;
    font-size: 11px;
    flex-shrink: 0;
}
.vv-input {
    flex: 1;
    min-width: 0;
    height: 25px;
    background: var(--surface-white);
    color: var(--text-primary);
    font-size: 12px;
    text-align: center;
    padding: 2px 3px;
    outline: none;
    user-select: text;
}
.vv-bin-input { font-size: 11px; }
.vv-input.is-invalid,
.win-input.is-invalid {
    background: var(--invalid-pink);
}
.vv-sub-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    background: var(--win-bg);
}
.vv-sub-group > legend {
    background: var(--win-bg);
    font-size: 11px;
}

/* Stack Floating Window */
.stack-panel-col, .vars-panel-col, .console-panel-col {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--win-bg);
    padding: 3px;
    gap: 3px;
}
.stack-hdr {
    display: flex;
    background: var(--btn-face);
    border: 1px solid var(--bevel-shadow);
    padding: 2px 6px;
    font-size: 10.5px;
}
.stack-list-well {
    flex: 1;
    min-height: 0;
    background: var(--surface-white);
    overflow-y: auto;
    padding: 2px;
}
.stack-row {
    display: flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 11px;
}
.stack-row.is-top {
    background: var(--active-blue);
    color: var(--active-text);
}
.stack-ptr { width: 36px; font-weight: 700; }
.stack-row.is-top .stack-ptr { color: var(--active-source-yellow); }
.stack-addr { flex: 1; }
.stack-val { width: 74px; }

/* Variables Floating Window */
.vars-fmt-bar {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding: 1px 0;
}
.vars-list-well {
    flex: 1;
    min-height: 0;
    background: var(--surface-white);
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.vars-empty {
    margin: auto;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}
.var-card {
    background: var(--panel-bg);
    border: 1px solid var(--bevel-shadow);
    padding: 5px 6px;
}
.var-card-hdr {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 2px;
}
.var-name { color: var(--title-blue); }
.var-addr { color: var(--text-secondary); font-size: 10px; }
.var-val { font-size: 11px; word-break: break-all; user-select: text; }

/* 80x25 DOS Emulator Screen Floating Window */
.dos-crt-well {
    flex: 1;
    min-height: 0;
    background: #000000;
    overflow: auto;
    padding: 6px;
    outline: none;
}
.dos-crt-grid {
    font-size: var(--crt-font-size, 11px);
    line-height: var(--crt-line-height, 14px);
    white-space: pre;
    width: max-content;
    user-select: text;
}
.crt-line {
    height: var(--crt-line-height, 14px);
}
.dos-status-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--panel-bg);
    border: 1px solid var(--bevel-shadow);
    padding: 2px 2px 2px 6px;
    min-height: 24px;
    flex-shrink: 0;
}
.dos-status-bar .float-resize-handle {
    align-self: flex-end;
    margin-left: 2px;
}
.dos-status-bar.is-waiting {
    background: var(--active-source-yellow);
    font-weight: 700;
}
.dos-status-lbl {
    flex: 1;
    font-size: 10.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dos-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dos-key-input {
    width: 120px;
    padding: 2px 5px;
    font-size: 12px;
}

/* --- Fixed Bottom 8-Button Action Bar --- */
/* Reserves 40px on the right so the fixed Fullscreen toggle NEVER overlaps `flags`! */
.emu-bottom-bar {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--toolbar-bg);
    border-top: 1px solid var(--title-bar-border);
    padding: 3px 40px 3px 4px;
    min-height: 34px;
    flex-shrink: 0;
    overflow-x: auto;
    position: relative;
    z-index: 300;
}
.bottom-bar-btn {
    min-height: 26px;
    padding: 2px 11px;
}

/* ==========================================================================
   MODAL DIALOGS (z-index: 10000, cleanly above bottom-right Fullscreen button)
   ========================================================================== */

.win-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    z-index: 10000;
}

.win-dialog-frame {
    width: 100%;
    max-height: 90dvh;
    background: var(--win-bg);
    padding: 3px;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 6px 18px rgba(0, 0, 0, 0.35);
}

.win-dialog-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.dlg-text { font-size: 12px; color: var(--text-primary); line-height: 1.4; }
.dlg-icon-row { display: flex; align-items: flex-start; gap: 10px; }
.dlg-row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.dlg-actions-end { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.dlg-actions-center { display: flex; justify-content: center; gap: 12px; margin-top: 6px; }

.win-input {
    background: var(--surface-white);
    color: var(--text-primary);
    font-size: 12.5px;
    padding: 5px 7px;
    outline: none;
    user-select: text;
}

/* Classic Custom Radio & Checkbox */
.win-radio-row, .win-checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 12px;
    padding: 3px 2px;
}
.win-radio-row input, .win-checkbox-row input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.win-radio-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface-white);
    border: 1.5px solid var(--bevel-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.win-radio-row input:checked + .win-radio-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #000000;
}
.win-checkbox-box {
    width: 15px;
    height: 15px;
    background: var(--surface-white);
    border-top: 1px solid var(--bevel-shadow);
    border-left: 1px solid var(--bevel-shadow);
    border-right: 1px solid var(--bevel-light);
    border-bottom: 1px solid var(--bevel-light);
    box-shadow: inset 1px 1px 0 var(--bevel-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.win-checkbox-row input:checked + .win-checkbox-box::after {
    content: '✓';
    font-size: 12px;
    font-weight: 700;
    color: #000000;
    line-height: 1;
}

.tpl-list { display: flex; flex-direction: column; gap: 3px; }
.tpl-inline-radios {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 4px;
}
.tpl-fasm-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}
.tpl-link-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--syn-inst);
    font-family: var(--font-mono);
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
    text-align: left;
    padding: 0 0 0 22px;
}

.dlg-scroll-well {
    background: var(--surface-white);
    max-height: 320px;
    overflow-y: auto;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dlg-example-card {
    appearance: none;
    text-align: left;
    background: var(--panel-bg);
    padding: 7px 8px;
    cursor: pointer;
    width: 100%;
}
.dlg-example-card:hover { background: #E9EEF8; }
.dlg-example-top { display: flex; justify-content: space-between; gap: 8px; }
.dlg-example-title { font-weight: 700; font-size: 12px; color: var(--title-blue); }
.dlg-example-file { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.dlg-example-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.dlg-empty-msg { margin: auto; text-align: center; font-size: 12px; color: var(--text-secondary); padding: 14px; }
.dlg-saved-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--panel-bg);
    border: 1px solid var(--bevel-shadow);
    padding: 6px 8px;
}
.dlg-saved-info { flex: 1; cursor: pointer; }
.dlg-saved-name { font-family: var(--font-mono); font-weight: 700; font-size: 12px; color: var(--title-blue); }
.dlg-saved-meta { font-size: 10.5px; color: var(--text-secondary); }

.dlg-compile-ok {
    margin: 0;
    background: var(--surface-white);
    color: var(--ok-green);
    font-size: 12px;
    padding: 10px;
    white-space: pre-wrap;
    user-select: text;
}
.dlg-error-card {
    appearance: none;
    width: 100%;
    text-align: left;
    background: var(--panel-bg);
    border: 1px solid var(--err-red);
    padding: 6px 8px;
    cursor: pointer;
}
.dlg-error-title { color: var(--err-red); font-weight: 700; font-size: 11.5px; }
.dlg-error-tok { color: var(--text-secondary); font-size: 11px; }

.bc-grid {
    display: grid;
    grid-template-columns: 98px 1fr;
    gap: 6px 8px;
    align-items: center;
}
.bc-grid label { font-size: 12px; }

.calc-ops-inputs { display: flex; align-items: center; gap: 6px; }
.calc-col { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.calc-lbl { font-size: 10.5px; color: var(--text-secondary); }
.calc-op-sym { font-size: 13px; color: var(--syn-inst); padding-top: 14px; }
.calc-result-box {
    background: var(--surface-white);
    padding: 8px;
    font-size: 11.5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    user-select: text;
}

.ascii-grid {
    background: var(--surface-white);
    max-height: 350px;
    overflow-y: auto;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 3px;
}
.ascii-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-bg);
    border: 1px solid var(--bevel-shadow);
    padding: 3px 5px;
}
.ascii-code { font-size: 10px; color: var(--text-secondary); }
.ascii-char { font-size: 13px; color: var(--title-blue); }

.ref-card {
    background: var(--panel-bg);
    border: 1px solid var(--bevel-shadow);
    padding: 6px;
}
.ref-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.ref-desc { font-size: 11px; margin-top: 2px; }

.opt-row { display: flex; justify-content: space-between; align-items: center; }
.opt-font-block { display: flex; flex-direction: column; gap: 5px; }
.about-shortcuts {
    background: var(--surface-white);
    padding: 8px;
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
    user-select: text;
}

/* ==========================================================================
   FLOATING BOTTOM-RIGHT FULLSCREEN TOGGLE BUTTON (Web Enhancement)
   Anchored inside the reserved bottom-right slot of the bottom chrome strip
   so it NEVER overlaps editor lines, scrollbars, floating windows, bottom bar
   buttons (`flags`), status bar text, or modal dialogs.
   ========================================================================== */

.fullscreen-fab {
    position: fixed;
    right: 4px;
    bottom: 3px;
    z-index: 9500;
    width: 30px;
    height: 24px;
    padding: 0;
    background: var(--toolbar-bg);
    color: var(--title-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-top: 1px solid var(--bevel-light);
    border-left: 1px solid var(--bevel-light);
    border-right: 1px solid var(--bevel-dark);
    border-bottom: 1px solid var(--bevel-dark);
    box-shadow: inset -1px -1px 0 var(--bevel-shadow);
    transition: opacity 150ms ease;
}
.fullscreen-fab.is-kb-hidden,
.fullscreen-hint-tooltip.is-kb-hidden {
    opacity: 0;
    pointer-events: none;
}
.fullscreen-fab:hover {
    background: var(--btn-face);
}
.fullscreen-fab:active,
.fullscreen-fab.is-active {
    background: var(--btn-pressed);
    border-top: 1px solid var(--bevel-shadow);
    border-left: 1px solid var(--bevel-shadow);
    border-right: 1px solid var(--bevel-light);
    border-bottom: 1px solid var(--bevel-light);
    box-shadow: inset 1px 1px 0 var(--bevel-dark);
}

/* Classic Windows once-per-session tooltip hint anchored above the bottom-right Fullscreen button */
.fullscreen-hint-tooltip {
    position: fixed;
    right: 4px;
    bottom: 37px;
    z-index: 9500;
    max-width: calc(100vw - 12px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 5px 4px 8px;
    background: #FFFFE1;
    color: #000000;
    border: 1px solid #000000;
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.25);
    font-family: var(--font-ui);
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 220ms ease, transform 220ms ease;
    user-select: none;
}

.fullscreen-hint-tooltip.is-hiding {
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
}

/* Crisp downward arrow centered dead-on the 30px Fullscreen button (19px from viewport right edge) */
.fullscreen-hint-tooltip::before,
.fullscreen-hint-tooltip::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    box-sizing: content-box;
    pointer-events: none;
}

.fullscreen-hint-tooltip::before {
    right: 8px;
    bottom: -7px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #000000;
}

.fullscreen-hint-tooltip::after {
    right: 8px;
    bottom: -6px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #FFFFE1;
}

.fullscreen-hint-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.fullscreen-hint-close {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    color: #000000;
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1;
    width: 16px;
    height: 16px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.fullscreen-hint-close:hover {
    background: #EFEBC0;
    border-color: #808080;
}

.fullscreen-hint-close:active {
    background: #DFDAA8;
    border-color: #404040;
}

@media (prefers-reduced-motion: reduce) {
    .fullscreen-hint-tooltip {
        transition: none;
    }
}

/* ==========================================================================
   RESPONSIVE COMPACT BREAKPOINTS (Phones & Short Landscape Screens)
   ========================================================================== */

@media (max-width: 820px), (max-height: 520px) {
    .win-desktop-titlebar { padding: 2px 6px; min-height: 26px; }
    .win-desktop-title { font-size: 11px; }
    .menu-label-btn { font-size: 11px; padding: 2px 6px; }
    .tb-icon-btn { min-width: 44px; min-height: 36px; padding: 2px 5px; }
    .tb-lbl { font-size: 10px; }
    .win-vdiv { height: 26px; }
    .delay-slider-wrap { width: 128px; }
    .delay-slider-label { font-size: 10px; }
    .dbg-col-regs { width: 114px; }
    .dbg-col-mem { width: 158px; }
    .reg-val { font-size: 10.5px; padding: 1.5px 2px; }
    .mem-row { font-size: 10px; line-height: 13px; }
    .disasm-row { font-size: 10.5px; line-height: 13.5px; }
    .bottom-bar-btn { min-height: 24px; padding: 2px 8px; }
    .win-return-editor { height: 24px; }
    .ret-label { font-size: 10.5px; padding: 0 7px; }
    .ret-x-cap { width: 28px; }
    .home-back-link { font-size: 10px; padding: 1.5px 6px; }
}

@media (max-width: 540px) {
    .editor-filename { display: none; }
    .dbg-col-regs { width: 106px; }
    .dbg-col-mem { width: 146px; }
    .dbg-col-disasm { min-width: 170px; }
}
