/*
 * CSVisualizer Unified — the one stylesheet of visualizer.html.
 * The banner comes from css/header-preview.css (the approved banner of index.html, not changed);
 * everything of this page uses the `uv-` prefix so it never collides with the old pages' CSS.
 * Fixed layout: editor LEFT, visualization RIGHT, in every UI language.
 */

:root {
    --uv-font: Arial, "Segoe UI", sans-serif;      /* the same stack as the banner (css/header-preview.css) */
    --uv-mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, "Liberation Mono", monospace;
    --uv-bg: #e7ecf4;
    --uv-panel: #ffffff;
    --uv-bar: #f5f7fb;
    --uv-border: #d7dfeb;
    --uv-border-soft: #e6ebf3;
    --uv-text: #17233c;
    --uv-muted: #5d6b84;
    --uv-faint: #94a3b8;
    --uv-accent: #1c5bb8;
    --uv-accent-strong: #154a99;
    --uv-accent-soft: #e5eefb;
    --uv-active-line: #fff3cf;
    --uv-active-mark: #e59a0b;
    --uv-changed: #fff1c2;
    --uv-temp-bg: #fff7df;
    --uv-temp-border: #efd28a;
    --uv-temp-text: #7a5200;
    --uv-radius: 8px;
    --uv-code-size: 14px;
    --uv-code-line: 21px;
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------------ page frame */

html, body.uv-page { height: 100%; }
body.uv-page {
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--uv-bg);
    color: var(--uv-text);
}
.uv-page button { font-family: var(--uv-font); }
/* page icons only — the banner keeps its own icon sizes from css/header-preview.css */
.uv-workspace .bi, .uv-fs-bar .bi { width: 16px; height: 16px; flex: none; display: block; }
.uv-page [data-icon] { display: inline-flex; align-items: center; justify-content: center; }
body.uv-dragging-x, body.uv-dragging-x * { cursor: col-resize !important; user-select: none !important; }
body.uv-dragging-y, body.uv-dragging-y * { cursor: ns-resize !important; user-select: none !important; }

/* ------------------------------------------------------------------ banner additions (the banner itself is unchanged) */

.uv-banner { flex: none; position: relative; z-index: 5; }
/* the header of this page (stage G3) is at the end of this file */

/* fullscreen: one minimal line instead of the banner */
.uv-fs-bar {
    flex: none;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    background: linear-gradient(105deg, #091934 0%, #102d63 54%, #164a91 100%);
    color: #fff;
    font-size: 13px;
}
.uv-fs-brand { font-weight: 800; letter-spacing: -.3px; }
.uv-fs-sep { width: 1px; height: 14px; background: #ffffff55; }
.uv-fs-example { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; color: #e3eeff; }
.uv-fs-exit {
    margin-right: auto;
    display: inline-flex; align-items: center; gap: 6px;
    height: 24px; padding: 0 10px;
    border: 1px solid #ffffff55; border-radius: 6px;
    background: #ffffff18; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
}
.uv-fs-exit:hover { background: #ffffff2e; }
body.uv-fullscreen .uv-banner { display: none; }

/* ------------------------------------------------------------------ workspace: two columns + splitter */

.uv-workspace {
    --uv-left: 50%;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, var(--uv-left)) 8px minmax(0, 1fr);
    padding: 6px;
    direction: ltr;
}
.uv-col {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--uv-panel);
    border: 1px solid var(--uv-border);
    border-radius: var(--uv-radius);
    overflow: hidden;
}
.uv-splitter {
    display: grid;
    place-items: center;
    cursor: col-resize;
    color: #a3b1c6;
    border-radius: 4px;
    touch-action: none;
    outline: none;
}
.uv-splitter .bi { width: 12px; height: 12px; }
.uv-splitter:hover, .uv-splitter:focus-visible, body.uv-dragging-x .uv-splitter { background: #d6e2f3; color: var(--uv-accent); }

/* editor maximize: the editor takes the whole width, the visualization is hidden */
.uv-workspace.uv-max-editor { grid-template-columns: minmax(0, 1fr); }
.uv-workspace.uv-max-editor .uv-splitter,
.uv-workspace.uv-max-editor .uv-visual-col { display: none; }

/* ------------------------------------------------------------------ bars, tabs, small buttons */

.uv-bar {
    flex: none;
    height: 32px;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0 4px;
    background: var(--uv-bar);
    border-bottom: 1px solid var(--uv-border);
}
.uv-bar-spacer { flex: 1 1 auto; min-width: 4px; }
.uv-icon-btn {
    flex: none;
    align-self: center;
    width: 26px; height: 26px;
    display: inline-grid; place-items: center;
    padding: 0;
    border: 1px solid transparent; border-radius: 6px;
    background: transparent; color: #44546f; cursor: pointer;
}
.uv-icon-btn:hover { background: #e4eaf4; color: var(--uv-accent); }
.uv-icon-btn[aria-pressed="true"] { background: var(--uv-accent-soft); color: var(--uv-accent); border-color: #c4d6f2; }
.uv-icon-btn:disabled { opacity: .4; cursor: default; }
.uv-page :focus-visible { outline: 2px solid var(--uv-accent); outline-offset: -2px; }

.uv-tab {
    position: relative;
    flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    height: 100%;
    padding: 0 10px;
    border: 0; background: transparent;
    color: var(--uv-muted);
    font: 600 13.5px var(--uv-font);
    white-space: nowrap;
    cursor: pointer;
}
.uv-tab:hover { color: var(--uv-text); background: #edf1f8; }
.uv-tab .bi { width: 15px; height: 15px; }
.uv-tab.is-active { color: var(--uv-accent); background: var(--uv-panel); }
.uv-tab.is-active::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--uv-accent); }
.uv-badge {
    min-width: 18px; height: 16px; padding: 0 5px;
    display: inline-grid; place-items: center;
    border-radius: 8px; background: #e2e8f1; color: #334155;
    font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ left column: file tabs + editor */

.uv-filebar { padding: 0 4px 0 0; }
.uv-file-tabs { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.uv-file-tabs::-webkit-scrollbar { display: none; }
.uv-file-tab {
    position: relative;
    flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    height: 100%;
    padding: 0 8px 0 10px;
    border-right: 1px solid var(--uv-border-soft);
    color: var(--uv-muted);
    font: 600 13px var(--uv-mono);
    cursor: pointer;
    user-select: none;
}
.uv-file-tab:hover { color: var(--uv-text); background: #edf1f8; }
.uv-file-tab.is-active { color: var(--uv-text); background: var(--uv-panel); }
.uv-file-tab.is-active::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--uv-accent); }
.uv-file-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--uv-panel); }
.uv-file-icon .bi { width: 13px; height: 13px; color: #6b84ab; }
.uv-file-close {
    width: 18px; height: 18px; margin-left: 2px;
    display: inline-grid; place-items: center;
    padding: 0; border: 0; border-radius: 4px;
    background: transparent; color: var(--uv-faint); cursor: pointer;
}
.uv-file-close:hover { background: #dfe6f1; color: #b42318; }
.uv-file-close .bi { width: 14px; height: 14px; }
.uv-add-file { margin-left: 2px; }
/* v0.5: the file actions (icon + menu, left of the file tabs), the format button, the unsaved mark, the messages */
.uv-doc-anchor { position: relative; flex: none; display: flex; align-items: center; }
.uv-doc-btn { margin: 0 2px; }
.uv-doc-menu { left: 2px; right: auto; min-width: 230px; }
.uv-doc-menu .uv-menu-item { white-space: nowrap; }
.uv-doc-menu kbd { margin-inline-start: auto; padding-inline-start: 12px; font: 11px var(--uv-mono); color: var(--uv-faint); }
/* v0.6.4: the editor's context menu (fixed at the pointer; js-unified/editor-menu.js places it inside the window) */
.uv-menu.uv-ed-ctx { position: fixed; top: 0; left: 0; right: auto; z-index: 60; min-width: 190px; }
.uv-ed-ctx .uv-menu-item { white-space: nowrap; }
.uv-ed-ctx kbd { margin-inline-start: auto; padding-inline-start: 16px; font: 11px var(--uv-mono); color: var(--uv-faint); }
.uv-ed-ctx .uv-menu-item:disabled { color: var(--uv-faint); opacity: .55; cursor: default; background: transparent; }
.uv-ed-ctx-sep { height: 1px; margin: 4px 6px; background: var(--uv-border-soft); }
.uv-file-tab.is-dirty .uv-file-name::after { content: "\2022"; margin-left: 5px; color: var(--uv-accent); font-weight: 800; }
.uv-format-btn { margin-inline-end: 4px; }
/* v0.9.6: editor font size shortcuts (A+ / A−) */
.uv-font-btn { width: auto; min-width: 26px; padding: 0 4px; }
.uv-font-glyph { font: 700 13px/1 var(--uv-font); direction: ltr; unicode-bidi: isolate; }
.uv-font-glyph.is-small { font-size: 11px; }
.uv-editor { position: relative; }
.uv-doc-toast {
    position: absolute; z-index: 15; top: 40px; left: 50%; transform: translateX(-50%);
    max-width: min(88%, 560px); padding: 7px 12px; border-radius: 8px;
    background: #17233c; color: #fff; box-shadow: 0 8px 22px #06172d40;
    font: 600 12.5px/1.45 var(--uv-font); direction: rtl; text-align: start; pointer-events: none;
}
.uv-doc-toast.is-error { background: #b42318; }
html[data-ui-lang="en"] .uv-doc-toast { direction: ltr; }
html[data-theme="dark"] .uv-doc-toast:not(.is-error) { background: #2b3a55; }
.uv-noimpl-note { flex: none; margin: 0; padding: 6px 10px; background: #fff7e6; color: #8a4b00; border-bottom: 1px solid #f3d9a4; font-size: 13px; font-weight: 600; }
html[data-theme="dark"] .uv-noimpl-note, html[data-theme="mixed"] .uv-noimpl-note { background: #3a2a10; color: #ffd38a; border-color: #5a4320; }
.uv-editor {
    flex: 1 1 auto;
    min-height: 90px;
    min-width: 0;
    display: flex;
    direction: ltr;
    /* v0.3 II-G: CodeMirror 6. Colours of the light theme; mixed and dark redefine them (end of this file) */
    --uv-ed-bg: var(--uv-panel); --uv-ed-gutter: #f6f8fb; --uv-ed-border: var(--uv-border-soft); --uv-ed-text: #1b2537;
    --uv-ed-ln: #64748b; --uv-ed-active: var(--uv-active-line); --uv-ed-active-ln: #a35f00; --uv-ed-sel: #cfe0fb;
    --uv-ed-caret: var(--uv-accent); --uv-ed-error: #fde4e1; --uv-ed-error-ln: #b42318; --uv-ed-match: #fde9a8;
    --uv-tok-keyword: #1c4fb0; --uv-tok-type: #0f6e66; --uv-tok-string: #a1361b; --uv-tok-number: #8a4b00;
    --uv-tok-comment: #6b7a90; --uv-tok-meta: #7a3e9d;
    background: var(--uv-ed-bg);
}
/* v0.6.5: the exact source range of an error of the run (ed.setDiagnostics): a wavy underline, never a colour of the text */
.uv-editor .cm-editor .cm-uv-diag { text-decoration: underline wavy #d92d20; text-decoration-skip-ink: none; text-underline-offset: 3px; background: #d92d2014; }
.uv-editor .cm-editor .cm-uv-diag.is-runtime { text-decoration-color: #c4320a; }
html:is([data-theme="mixed"], [data-theme="dark"]) .uv-editor .cm-editor .cm-uv-diag { text-decoration-color: #ff6b5e; background: #ff6b5e1f; }
/* specificity: three classes, above the CodeMirror base theme (adopted style sheets come last in the cascade) */
.uv-editor .cm-editor { flex: 1 1 auto; min-width: 0; height: 100%; background: transparent; color: var(--uv-ed-text); font-size: var(--uv-code-size); }
.uv-editor .cm-editor.cm-focused { outline: none; }
.uv-editor .cm-editor .cm-scroller { font-family: var(--uv-mono); line-height: var(--uv-code-line); scrollbar-width: thin; }
.uv-editor .cm-editor .cm-content { padding: 10px 0 40px; caret-color: var(--uv-ed-caret); }
.uv-editor .cm-editor .cm-line { padding: 0 14px 0 6px; }
.uv-editor .cm-editor .cm-cursor { border-left-color: var(--uv-ed-caret); border-left-width: 2px; }
.uv-editor .cm-editor .cm-selectionBackground, .uv-editor .cm-editor.cm-focused .cm-selectionBackground { background: var(--uv-ed-sel); }
/* v0.6.4: CodeMirror's own rule for the focused selection (.cm-focused > .cm-scroller > .cm-selectionLayer, specificity 0-5-0)
   beat the rule above, so a focused editor showed its default light #d7d4f0 also in the dark editor. This one wins. */
.uv-editor .cm-editor.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground { background: var(--uv-ed-sel); }
.uv-editor .cm-editor .cm-gutters { background: var(--uv-ed-gutter); border-right: 1px solid var(--uv-ed-border); color: var(--uv-ed-ln); user-select: none; }
.uv-editor .cm-editor .cm-gutter.cm-lineNumbers .cm-gutterElement { min-width: 34px; padding: 0 8px 0 6px; }
.uv-editor .cm-editor .cm-gutter.cm-foldGutter .cm-gutterElement { padding: 0 4px; cursor: pointer; color: var(--uv-ed-ln); }
/* the step line (amber) and the error line (red): the line and its number */
.uv-editor .cm-editor .cm-line.cm-uv-step { background: var(--uv-ed-active); }
.uv-editor .cm-editor .cm-line.cm-uv-step.cm-uv-error { background: var(--uv-ed-error); }
.uv-editor .cm-editor .cm-gutterElement.cm-uv-step-gutter { color: var(--uv-ed-active-ln); font-weight: 700; background: var(--uv-ed-active); box-shadow: inset 3px 0 0 var(--uv-active-mark); }
.uv-editor .cm-editor .cm-gutterElement.cm-uv-step-gutter.cm-uv-error { color: var(--uv-ed-error-ln); background: var(--uv-ed-error); box-shadow: inset 3px 0 0 #d92d20; }
.uv-editor .cm-editor .cm-foldGutter .cm-gutterElement.cm-uv-step-gutter { box-shadow: none; }
.uv-editor .cm-editor .cm-matchingBracket { background: var(--uv-ed-match); color: inherit; }
.uv-editor .cm-editor .cm-selectionMatch { background: var(--uv-ed-match); }
.uv-editor .cm-editor .cm-foldPlaceholder { background: var(--uv-ed-gutter); border-color: var(--uv-ed-border); color: var(--uv-ed-ln); }
.uv-editor .cm-editor .cm-panels { background: var(--uv-ed-gutter); color: var(--uv-ed-text); border-color: var(--uv-ed-border); font-family: inherit; }
.uv-editor .cm-editor .cm-tooltip { background: var(--uv-panel); color: var(--uv-text); border: 1px solid var(--uv-border); font-family: var(--uv-mono); }
/* syntax colours (classHighlighter tok-* classes) */
.uv-editor .cm-editor .tok-keyword, .uv-editor .cm-editor .tok-bool, .uv-editor .cm-editor .tok-null { color: var(--uv-tok-keyword); }
.uv-editor .cm-editor .tok-typeName, .uv-editor .cm-editor .tok-className { color: var(--uv-tok-type); }
.uv-editor .cm-editor .tok-string, .uv-editor .cm-editor .tok-string2 { color: var(--uv-tok-string); }
.uv-editor .cm-editor .tok-number, .uv-editor .cm-editor .tok-atom { color: var(--uv-tok-number); }
.uv-editor .cm-editor .tok-comment { color: var(--uv-tok-comment); font-style: italic; }
.uv-editor .cm-editor .tok-meta, .uv-editor .cm-editor .tok-annotation { color: var(--uv-tok-meta); }

/* ------------------------------------------------------------------ run controls: ONE row */

.uv-controls {
    flex: none;
    height: 40px;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    background: var(--uv-bar);
    border-top: 1px solid var(--uv-border);
    white-space: nowrap;
    overflow: hidden;
}
.uv-ctl {
    flex: none;
    width: 32px; height: 30px;
    display: inline-grid; place-items: center;
    padding: 0;
    border: 1px solid transparent; border-radius: 6px;
    background: transparent; color: #1e3a6b; cursor: pointer;
}
.uv-ctl:hover:not(:disabled) { background: #e2e9f5; }
.uv-ctl:disabled { opacity: .35; cursor: default; }
.uv-ctl .bi { width: 17px; height: 17px; }
.uv-ctl-play { width: auto; min-width: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; background: var(--uv-accent); color: #fff; }
.uv-play-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.uv-ctl-play:hover:not(:disabled) { background: var(--uv-accent-strong); }
.uv-ctl-play .bi { width: 18px; height: 18px; }
.uv-ctl-play.is-playing { background: #0f3f86; }
.uv-ctl-sep { flex: none; width: 1px; height: 20px; margin: 0 6px; background: var(--uv-border); }
.uv-speed {
    flex: 0 1 auto;
    min-width: 0;
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--uv-muted); font-size: 13px;
    cursor: pointer;
}
.uv-speed-icon .bi { width: 15px; height: 15px; }
.uv-speed input { width: 92px; min-width: 40px; margin: 0; accent-color: var(--uv-accent); cursor: pointer; }
.uv-speed output { min-width: 16px; font-weight: 700; color: var(--uv-text); font-variant-numeric: tabular-nums; text-align: center; }
.uv-step {
    flex: none;
    margin-right: auto;      /* RTL row: pushed to the far left */
    color: #334155; font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}
.uv-step b { font-weight: 700; color: var(--uv-text); }
.uv-step-desc {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--uv-muted);
}
.uv-step-desc:empty { display: none; }

/* v0.9.2: the binary view of the step's C bitwise operations (js-unified/visual-bits.js).
   v0.9.4: it is the "bitwise" view pane ("תצוגת סיביות", js-unified/views.js bitwiseHtml), no longer a fixed area under the
   step bar: it fills its pane (one pane or a split one), follows the theme tokens and the generic zoom of the pane. The 32
   bits never wrap or get cut: a narrow pane scrolls the table sideways. The digits and the decimal values are always
   written; the tint of a 1 bit only helps the eye. */
.uv-bits {
    display: block;
    width: max-content;
    min-width: 100%;
    box-sizing: border-box;
    font-size: 12.5px;
    color: var(--uv-text);
}
.uv-bits-view-empty { min-height: 100%; display: flex; }
.uv-bits-view-empty .uv-placeholder { flex: 1; }
.uv-bits-table { white-space: nowrap; }
.uv-bits-head { margin-bottom: 4px; }
.uv-bits-type { color: var(--uv-muted); font-size: 12px; }
.uv-bits-op { padding: 4px 0 6px; border-top: 1px dashed var(--uv-border); }
.uv-bits-op:first-of-type { border-top: 0; }
.uv-bits-title, .uv-bits-shift, .uv-bits-explain { margin: 2px 0; }
.uv-bits-title code { font-family: var(--uv-mono, ui-monospace, Consolas, monospace); font-weight: 700; unicode-bidi: isolate; }
.uv-bits-line { color: var(--uv-muted); font-size: 11.5px; }
.uv-bits-shift { font-weight: 600; }
.uv-bits-explain { color: var(--uv-muted); }
.uv-bits-scroll { overflow-x: visible; }
.uv-bits-table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.uv-bits-table .uv-bit, .uv-bits-table .uv-bit-pos, .uv-bits-table tbody .uv-bits-dec { font-family: var(--uv-mono, ui-monospace, Consolas, monospace); }
.uv-bits-table th, .uv-bits-table td { padding: 1px 0; text-align: center; }
.uv-bits-table .uv-bits-role { padding: 1px 8px 1px 0; text-align: start; font-weight: 600; white-space: nowrap; }
.uv-bits-table thead .uv-bits-role, .uv-bits-table thead .uv-bits-dec { font-weight: 400; color: var(--uv-muted); font-size: 10.5px; }
.uv-bits-table .uv-bits-dec { padding: 1px 8px; text-align: right; white-space: nowrap; }
.uv-bit-pos { min-width: 13px; font-size: 9px; font-weight: 400; color: var(--uv-muted); }
.uv-bit { min-width: 13px; border: 1px solid var(--uv-border); }
.uv-bit-0 { color: var(--uv-muted); }
.uv-bit-1 { font-weight: 700; background: rgba(37, 99, 235, .14); }
.uv-bit-byte { border-left: 3px solid var(--uv-border); }
.uv-bits-res .uv-bits-role, .uv-bits-res .uv-bits-dec { font-weight: 700; }
.uv-bits-res .uv-bit { border-top: 2px solid var(--uv-text); }

.uv-editor-col { container-type: inline-size; }
@container (max-width: 430px) {
    .uv-speed input { width: 60px; }
    .uv-ctl-sep { margin: 0 3px; }
}
@container (max-width: 370px) {
    .uv-step-word, .uv-speed-icon { display: none; }
    .uv-speed input { width: 48px; }
}

/* ------------------------------------------------------------------ input / output (collapsed by default) */

.uv-io {
    position: relative;
    flex: none;
    height: 30px;
    display: flex;
    flex-direction: column;
    background: var(--uv-panel);
    border-top: 1px solid var(--uv-border);
}
.uv-io-resizer {
    position: absolute; left: 0; right: 0; top: -5px;
    height: 9px;
    z-index: 3;
    cursor: ns-resize;
    touch-action: none;
    outline: none;
}
.uv-io-resizer::after { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: transparent; }
.uv-io-resizer:hover::after, .uv-io-resizer:focus-visible::after, body.uv-dragging-y .uv-io-resizer::after { background: var(--uv-accent); }
.uv-io-bar { height: 30px; border-bottom: 0; padding: 0 4px; }
.uv-io[data-state="open"] .uv-io-bar { border-bottom: 1px solid var(--uv-border); }
.uv-io-tabs { display: flex; }
.uv-io-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.uv-io-pane { height: 100%; }
.uv-console {
    box-sizing: border-box;
    min-height: 100%;
    margin: 0;
    padding: 8px 12px;
    color: #0f172a;
    font: 14px/1.6 var(--uv-mono);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    direction: ltr;
    text-align: left;
}
.uv-console-error { color: #b42318; font-weight: 700; }
.uv-badge.is-error { background: #fde4e1; color: #b42318; }
/* v0.9.1: the empty mark in the interface language (data-empty, js-unified/layout.js) */
.uv-console.is-empty::before { content: attr(data-empty); color: var(--uv-faint); font-family: var(--uv-font); }
/* v0.9.1: the Console tab — the input mode of the run, and the input line typed in the console itself */
.uv-io-pane#uv-io-pane-output { display: flex; flex-direction: column; }
.uv-io-pane#uv-io-pane-output[hidden] { display: none; }
.uv-io-pane#uv-io-pane-output .uv-console { flex: 1 1 auto; min-height: 0; }
.uv-console-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 3px 10px; border-bottom: 1px solid var(--uv-border-soft); font: 12.5px/1.5 var(--uv-font); color: var(--uv-faint); direction: rtl; }
.uv-console-mode { flex: 1 1 auto; }
.uv-console-input {
    box-sizing: border-box;
    min-width: 12ch; width: 40%; max-width: 100%;
    margin: 0; padding: 0 4px;
    border: 0; border-bottom: 2px solid var(--uv-accent); border-radius: 0;
    background: transparent; color: inherit;
    font: inherit; direction: ltr; text-align: left;
    outline: none;
}
.uv-console-input:focus { background: rgba(37, 99, 235, 0.06); }
/* v0.9.1: the send-input button at the end of the active input line (only while the program waits) */
.uv-console-send { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; margin: 0 0 0 4px; padding: 0; vertical-align: middle; border: 1px solid var(--uv-accent); border-radius: 4px; background: transparent; color: var(--uv-accent); cursor: pointer; }
.uv-console-send:hover { background: rgba(37, 99, 235, 0.08); }
.uv-console-send:focus-visible { outline: 2px solid var(--uv-accent); outline-offset: 2px; }
.uv-console-send:disabled { opacity: 0.5; cursor: default; }
.uv-console-send .bi { width: 14px; height: 14px; }
.uv-console-waiting { display: block; margin-top: 2px; unicode-bidi: plaintext; text-align: start; color: var(--uv-faint); font-family: var(--uv-font); font-size: 12.5px; }
/* v0.6.5: the diagnostics under the output (js-unified/diagnostics.js). The console no longer fills the pane then. */
.uv-io-pane.has-diag .uv-console { min-height: 0; }
.uv-io-pane.has-diag .uv-console.is-empty { display: none; }
.uv-diag { padding: 6px 12px 12px; border-top: 1px solid var(--uv-border-soft); font: 13.5px/1.55 var(--uv-font); color: var(--uv-text); }
.uv-diag-title { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; font-size: 13px; font-weight: 700; }
.uv-diag-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.uv-diag-item { padding: 8px 10px; border: 1px solid #f3c7c1; border-inline-start: 4px solid #d92d20; border-radius: 6px; background: #fff8f7; }
.uv-diag-item.is-runtime { border-color: #f5d0a9; border-inline-start-color: #c4320a; background: #fffaf3; }
.uv-diag-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uv-diag-kind { font-size: 12px; font-weight: 700; color: #b42318; }
.uv-diag-loc { padding: 1px 6px; border: 1px solid #d7dfeb; border-radius: 4px; background: #fff; color: #1d5fd1; font: 12.5px var(--uv-mono); cursor: pointer; unicode-bidi: isolate; }
.uv-diag-loc:hover { background: #eef3ff; }
.uv-diag-loc:focus-visible, .uv-diag-fix:focus-visible { outline: 2px solid #1d5fd1; outline-offset: 2px; }
.uv-diag-noloc { font-size: 12px; color: var(--uv-muted); font-style: italic; }
.uv-diag-msg { margin: 4px 0 2px; font-weight: 700; color: #7a1b12; }
.uv-diag-code { padding: 0 3px; border-radius: 3px; background: #0f172a0d; font-family: var(--uv-mono); font-size: .95em; font-weight: 600; unicode-bidi: isolate; white-space: pre; }
.uv-diag-why, .uv-diag-check, .uv-diag-suggest { margin: 3px 0; }
/* the page sets a muted colour on every <p>; the explanation is body text of the panel (readable in dark too) */
.uv-diag .uv-diag-why, .uv-diag .uv-diag-check { color: inherit; }
.uv-diag-suggest { color: #0f5132; }
/* v0.9.5: the knowledge source item of the error (knowledge/language-knowledge.js) and its link to the language page */
.uv-diag .uv-diag-lang { margin: 3px 0; color: inherit; }
.uv-diag-lang-status { font-weight: 700; }
.uv-diag-lang-status.is-unsupported { color: #a3262e; }
.uv-diag-lang-status.is-partial { color: #8a5a00; }
.uv-diag-lang-link { color: #1d5fd1; }
html[data-theme="dark"] .uv-diag-lang-status.is-unsupported { color: #ff9aa1; }
html[data-theme="dark"] .uv-diag-lang-status.is-partial { color: #f3c76a; }
html[data-theme="dark"] .uv-diag-lang-link { color: #8bb9ff; }
.uv-diag-fixrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.uv-diag-fix { padding: 3px 10px; border: 1px solid #1d5fd1; border-radius: 5px; background: #1d5fd1; color: #fff; font: 600 12.5px var(--uv-font); cursor: pointer; }
.uv-diag-fix:hover { background: #174ea6; }
.uv-diag-fix .uv-diag-code { background: #ffffff2e; }
.uv-diag-fixnote { font-size: 12px; color: var(--uv-muted); }
.uv-diag-details { margin-top: 4px; font-size: 12.5px; color: var(--uv-muted); }
.uv-diag-details summary { cursor: pointer; }
.uv-diag-details dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 4px 0 0; }
.uv-diag-details dt { font-weight: 700; }
.uv-diag-details dd { margin: 0; unicode-bidi: plaintext; overflow-wrap: anywhere; }
html[data-theme="dark"] .uv-diag { border-color: #253148; }
html[data-theme="dark"] .uv-diag-item { background: #2a1a1c; border-color: #5a2a2c; border-inline-start-color: #ff6b5e; }
html[data-theme="dark"] .uv-diag-item.is-runtime { background: #2b2015; border-color: #5a4320; border-inline-start-color: #ffa94d; }
html[data-theme="dark"] .uv-diag-kind { color: #ff9b8f; }
html[data-theme="dark"] .uv-diag-msg { color: #ffc4bd; }
html[data-theme="dark"] .uv-diag-code { background: #ffffff1a; }
html[data-theme="dark"] .uv-diag-loc { background: #202a3c; border-color: #34425b; color: #8fb6ff; }
html[data-theme="dark"] .uv-diag-suggest { color: #8fe0b0; }

.uv-placeholder {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 12px 14px;
    color: var(--uv-muted); font-size: 13.5px; line-height: 1.55;
    direction: rtl;
}
.uv-placeholder .bi { margin-top: 2px; color: #7d8fae; }
.uv-placeholder-center { height: 100%; box-sizing: border-box; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.uv-placeholder-center .bi { width: 28px; height: 28px; color: #b3c0d4; }

/* ------------------------------------------------------------------ right column: view tabs + panes */

.uv-viewbar { padding: 0 2px 0 4px; }
.uv-view-tabs { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.uv-view-tabs::-webkit-scrollbar { display: none; }
.uv-view-tab { padding: 0 8px; }
.uv-tab-close {
    width: 18px; height: 18px; margin-right: 2px;
    display: inline-grid; place-items: center;
    padding: 0; border: 0; border-radius: 4px;
    background: transparent; color: var(--uv-faint); cursor: pointer;
}
.uv-tab-close:hover { background: #dfe6f1; color: #b42318; }
.uv-tab-close .bi { width: 14px; height: 14px; }
.uv-add-view { position: relative; display: flex; align-items: center; flex: none; }
.uv-add-view-btn {
    display: inline-flex; align-items: center; gap: 3px;
    height: 24px; margin: 0 6px; padding: 0 9px 0 7px;
    border: 1px dashed #b5c4da; border-radius: 6px;
    background: transparent; color: #1d4f9c;
    font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.uv-add-view-btn:hover:not(:disabled) { background: var(--uv-accent-soft); border-style: solid; }
.uv-add-view-btn:disabled { opacity: .45; cursor: default; }
.uv-add-view-btn .bi { width: 15px; height: 15px; }
.uv-menu {
    position: absolute; top: calc(100% + 2px); right: 6px;
    z-index: 20;
    min-width: 200px;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--uv-border); border-radius: 8px;
    box-shadow: 0 10px 28px #10264a26;
    direction: rtl;
}
.uv-menu-item {
    width: 100%;
    display: flex; align-items: center; gap: 8px;
    height: 32px; padding: 0 10px;
    border: 0; border-radius: 6px;
    background: transparent; color: var(--uv-text);
    font-size: 14px; text-align: right; cursor: pointer;
}
.uv-menu-item:hover, .uv-menu-item:focus-visible { background: var(--uv-accent-soft); color: var(--uv-accent); outline: none; }
.uv-menu-item .bi { color: #6b84ab; }

.uv-view-panes { position: relative; flex: 1 1 auto; min-height: 0; background: #f7f9fc; }
.uv-view-pane { position: absolute; inset: 0; overflow: auto; padding: 10px; direction: rtl; }

/* visual-tab maximize: the selected tab's content takes the whole right column; the editor stays */
.uv-max-visual .uv-viewbar { display: none; }
.uv-restore-visual {
    position: absolute; top: 8px; left: 8px; z-index: 6;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    padding: 0;
    border: 1px solid var(--uv-border); border-radius: 6px;
    background: #ffffffe8; color: var(--uv-accent);
    box-shadow: 0 2px 8px #10264a1f; cursor: pointer;
}
.uv-restore-visual:hover { background: var(--uv-accent-soft); }

/* ------------------------------------------------------------------ the "visual" tab: cards in a fixed order */

.uv-cards:empty { display: none; }
.uv-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));   /* a single card uses the whole width */
    gap: 10px;
    align-items: start;
}
.uv-card {
    min-width: 0;
    background: var(--uv-panel);
    border: 1px solid var(--uv-border);
    border-radius: var(--uv-radius);
    overflow: hidden;
}
.uv-card-head {
    display: flex; align-items: center; justify-content: space-between;
    height: 30px; padding: 0 4px 0 6px; padding-right: 10px;
    border-bottom: 1px solid var(--uv-border-soft);
    background: #fbfcfe;
}
.uv-card-title { font-size: 14px; font-weight: 700; color: #26385a; }
.uv-card-head .uv-icon-btn { width: 24px; height: 24px; }
.uv-card-head .uv-icon-btn .bi { width: 14px; height: 14px; }
.uv-card-body { padding: 10px; }
/* fit layer (BUG-VV-18): content wider than the card is laid out at its natural width and zoomed down to the card */
.uv-fit { display: block; min-width: 0; }
.uv-card.is-max .uv-card-body > .uv-fit { flex: 0 0 auto; }           /* the maximized body is a flex box: do not shrink it */
.uv-card-body.is-fit-min { overflow-x: auto; }                        /* below the smallest scale the body scrolls as before */
.uv-cards.has-max .uv-card:not(.is-max) { display: none; }
.uv-card.is-max { position: absolute; inset: 10px; z-index: 4; display: flex; flex-direction: column; }
.uv-card.is-max .uv-card-body { flex: 1 1 auto; overflow: auto; display: flex; align-items: center; justify-content: center; }

/* preview content styles (stage D replaces them with the ported renderers) */
.uv-var {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 4px 8px; border-radius: 5px;
    font: 14.5px/1.5 var(--uv-mono);
    direction: ltr;
}
.uv-var + .uv-var { margin-top: 2px; }
.uv-var-name { color: #1d4f9c; font-weight: 700; }
.uv-var-value { color: #0f172a; }
.uv-var.is-changed { background: var(--uv-changed); }
.uv-array { direction: ltr; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.uv-array-name { font: 700 14.5px var(--uv-mono); color: #1d4f9c; }
.uv-array-cells, .uv-string { display: flex; gap: 0; }
.uv-cell, .uv-char {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    border: 1px solid #b8c6db; margin-left: -1px;
    background: #fff;
}
.uv-cell { width: 50px; }
.uv-char { width: 28px; }
.uv-cell-value, .uv-char-value { display: block; width: 100%; padding: 8px 0 6px; text-align: center; font: 700 16px var(--uv-mono); color: #0f172a; }
.uv-char-value { padding: 5px 0 3px; font-size: 14.5px; }
.uv-cell-index { display: block; width: 100%; padding: 1px 0; text-align: center; font: 11.5px var(--uv-mono); color: var(--uv-faint); background: #f4f7fb; border-top: 1px solid #e3e9f2; }
.uv-cell.is-pointed { background: #eaf2ff; border-color: var(--uv-accent); z-index: 1; }
.uv-cell-pointer {
    position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
    padding: 0 5px; border-radius: 4px;
    background: var(--uv-accent); color: #fff;
    font: 700 12px var(--uv-mono);
}
.uv-card[data-card="arrays"] .uv-card-body { padding-top: 24px; }

/* ------------------------------------------------------------------ stage D1: arrays, matrices, strings (engine data) */

.uv-card-body { overflow: hidden; }
.uv-ds-item + .uv-ds-item { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--uv-border-soft); }
.uv-ds-name {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
    margin-bottom: 4px;
    font: 14px/1.4 var(--uv-mono); color: #1d4f9c;
    direction: ltr; text-align: left;
}
.uv-ds-name b { font-weight: 700; }
.uv-ds-meta { font: 12px var(--uv-font); color: var(--uv-muted); direction: rtl; }
.uv-str-lit { color: #0f172a; font-weight: 600; }
/* large structures scroll inside their card (the page never scrolls sideways) */
.uv-ds-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; scrollbar-width: thin; direction: ltr; text-align: left; }
.uv-cells { display: inline-flex; align-items: stretch; gap: 0; direction: ltr; padding: 0 1px; }
/* a column is as wide as its cell or its pointer names (names never run together) */
.uv-acol { display: flex; flex-direction: column; align-items: stretch; flex: none; }
.uv-aptr {
    height: 26px; padding: 0 4px;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    font: 700 12px var(--uv-mono); color: var(--uv-accent); white-space: nowrap;
}
.uv-ptr-mark { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--uv-accent); margin-top: 1px; }
.uv-acell, .uv-ccell {
    display: grid; place-items: center;
    flex: 1 1 auto;
    min-width: 50px; min-height: 44px; padding: 0 6px;
    margin-left: -1px;
    border: 1px solid #b8c6db; background: #fff;
    font: 700 16px var(--uv-mono); color: #0f172a;
    white-space: nowrap;
}
.uv-ccell { min-width: 32px; min-height: 38px; padding: 0 4px; font-size: 15px; }
.uv-acol:first-child .uv-acell, .uv-acol:first-child .uv-ccell { margin-left: 0; }
.uv-acell.is-read { background: #eef4ff; border-color: #8fb0e6; position: relative; z-index: 1; }
.uv-acell.is-changed { background: var(--uv-changed); border-color: #e0b100; position: relative; z-index: 2; }
.uv-acell.is-pointed, .uv-ccell.is-pointed { box-shadow: inset 0 0 0 2px var(--uv-accent); position: relative; z-index: 3; }
/* C: an element nothing was written to yet (indeterminate, shown as "?") */
.uv-acell.is-unset, .uv-mcell.is-unset { color: var(--uv-faint); font-style: italic; }
.uv-acell.is-null .uv-null { color: var(--uv-faint); font-weight: 600; font-size: 13px; }
.uv-acell.is-object { height: auto; min-height: 44px; padding: 4px 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 12px; font-weight: 600; }
.uv-obj-badge { color: #1d4f9c; font-weight: 700; }
.uv-obj-fields { display: flex; flex-direction: column; gap: 1px; color: #334155; font-weight: 500; }
.uv-aidx { margin-top: 3px; font: 11.5px var(--uv-mono); color: var(--uv-faint); text-align: center; }
.uv-matrix { border-collapse: collapse; direction: ltr; margin-top: 2px; }
.uv-matrix th { padding: 2px 6px; font: 11.5px var(--uv-mono); color: var(--uv-faint); font-weight: 600; text-align: center; }
.uv-matrix td { padding: 0; }
.uv-mcell {
    min-width: 46px; height: 40px; padding: 0 6px;
    display: grid; place-items: center;
    margin: -1px 0 0 -1px;
    border: 1px solid #b8c6db; background: #fff;
    font: 700 15px var(--uv-mono); color: #0f172a;
}
.uv-mcell.is-diag-main { background: #f2f6ff; }
.uv-mcell.is-diag-sec { background: #f6f2ff; }
.uv-mcell.is-diag-main.is-diag-sec { background: #eef0ff; }
.uv-mcell.is-active { background: var(--uv-changed); border-color: #e0b100; box-shadow: inset 0 0 0 2px #e0b100; position: relative; z-index: 1; }
.uv-card.is-max .uv-card-body { flex-direction: column; align-items: stretch; justify-content: flex-start; }

/* ------------------------------------------------------------------ stage D2: queues and stacks (engine data) */

.uv-op {
    padding: 0 7px; border-radius: 9px;
    background: var(--uv-changed); color: #8a5a00;
    font: 700 11.5px var(--uv-font); line-height: 18px;
}
.uv-empty-inline { padding: 10px 12px; color: var(--uv-faint); font: 600 13px var(--uv-font); white-space: nowrap; }
.uv-item-val { font: 700 15px var(--uv-mono); color: #0f172a; white-space: nowrap; }
.uv-obj-title { display: block; font: 700 12.5px var(--uv-mono); color: #1d4f9c; margin-bottom: 2px; }
.uv-obj-fields { display: flex; flex-direction: column; gap: 1px; }
.uv-obj-field { font: 12px var(--uv-mono); color: #334155; white-space: nowrap; }
.uv-obj-field[data-access="private"] .uv-obj-key::before { content: "-"; color: #b42318; margin-right: 3px; }
.uv-obj-field[data-access="protected"] .uv-obj-key::before { content: "#"; color: #b45309; margin-right: 3px; }

/* queue: Head on the left, Tail on the right (as index-ds.html) */
.uv-qtrack { display: inline-flex; align-items: stretch; gap: 8px; min-width: 100%; box-sizing: border-box; padding: 4px 0 2px; direction: ltr; }
.uv-qgate {
    flex: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    width: 58px; padding: 6px 2px;
    border: 1px dashed #b8c6db; border-radius: 6px;
    background: #f8fafc; color: var(--uv-muted);
    font: 11px var(--uv-font);
}
.uv-qgate b { font-size: 12.5px; color: var(--uv-text); }
.uv-qgate-head { border-color: #f1a7a7; }
.uv-qgate-tail { border-color: #8fd3a8; }
.uv-qgate.is-op { background: var(--uv-changed); border-style: solid; border-color: #e0b100; }
.uv-qflow { display: flex; align-items: flex-end; gap: 6px; flex: 1 1 auto; padding: 0 2px; }
.uv-qitem { display: flex; flex-direction: column; align-items: center; flex: none; }
.uv-role { height: 16px; font: 700 11px var(--uv-font); color: var(--uv-accent); white-space: nowrap; }
.uv-qbox {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 46px; min-height: 42px; padding: 4px 8px; box-sizing: border-box;
    border: 1px solid #b8c6db; border-radius: 6px; background: #fff;
}
.uv-qitem.is-head .uv-qbox { border-color: #e26d6d; }
.uv-qitem.is-tail .uv-qbox { border-color: #3fae6b; }
.uv-qitem.is-op .uv-qbox { background: var(--uv-changed); box-shadow: inset 0 0 0 2px #e0b100; }
.uv-qitem.is-object .uv-qbox, .uv-qitem.is-nested .uv-qbox { align-items: flex-start; }
.uv-nested-title { font: 700 12px var(--uv-mono); color: #6d28d9; white-space: nowrap; }
.uv-nested-count { color: var(--uv-muted); font-weight: 500; }
.uv-nested-flow { display: flex; align-items: center; gap: 3px; margin-top: 3px; }
.uv-nested-item { padding: 1px 6px; border: 1px solid #d4c4f5; border-radius: 4px; background: #faf7ff; font: 600 12.5px var(--uv-mono); }
.uv-nested-end { font: 700 10.5px var(--uv-font); color: var(--uv-faint); }
.uv-nested-sep { width: 6px; height: 1px; background: #c4b5fd; }

/* stack: vertical, bottom -> top, Top above (items are in bottom -> top order in the DOM) */
.uv-ds-item.uv-stack { direction: ltr; }
.uv-stack-wrap { display: flex; flex-direction: column; align-items: stretch; width: 240px; max-width: 100%; }
.uv-stop {
    align-self: center;
    padding: 1px 10px; margin-bottom: 4px;
    border: 1px dashed #c4b5fd; border-radius: 6px;
    font: 700 12px var(--uv-font); color: #6d28d9;
}
.uv-stop.is-op { background: var(--uv-changed); border: 1px solid #e0b100; color: #8a5a00; }
.uv-canister {
    display: flex; flex-direction: column-reverse; gap: 4px;
    max-height: 320px; overflow-y: auto;
    padding: 6px;
    border: 2px solid #c4b5fd; border-top: 0; border-radius: 0 0 10px 10px;
    background: #fbf9ff;
}
.uv-sitem {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 36px; padding: 4px 10px;
    border: 1px solid #c9b8f3; border-radius: 6px; background: #fff;
}
.uv-sitem.is-object, .uv-sitem.is-nested { align-items: flex-start; }
.uv-sitem.is-top { border-color: #7c3aed; }
.uv-sitem.is-op { background: var(--uv-changed); box-shadow: inset 0 0 0 2px #e0b100; }
.uv-sitem .uv-role { position: absolute; top: 2px; right: 6px; height: auto; color: #7c3aed; }
.uv-canister .uv-empty-inline { text-align: center; }

/* ------------------------------------------------------------------ stage D3: Node chains and binary trees (engine data) */

.uv-chain-flow { display: inline-flex; align-items: flex-end; gap: 0; padding: 2px 0; direction: ltr; }
.uv-cnode { display: flex; flex-direction: column; align-items: flex-start; flex: none; }
.uv-cptrs { display: flex; gap: 3px; min-height: 22px; align-items: flex-end; padding-bottom: 3px; padding-left: 4px; }
.uv-ptr-tag {
    padding: 0 6px; border-radius: 9px;
    background: #e5eefb; color: var(--uv-accent);
    font: 700 11.5px/18px var(--uv-mono); white-space: nowrap;
}
.uv-ptr-tag.is-null { background: #f1f5f9; color: var(--uv-muted); }
.uv-crow { display: flex; align-items: center; }
.uv-capsule { display: flex; align-items: stretch; height: 40px; border: 1px solid #b8c6db; border-radius: 6px; background: #fff; overflow: hidden; }
.uv-cnode.is-head .uv-capsule { border-color: var(--uv-accent); box-shadow: inset 0 0 0 1px var(--uv-accent); }
.uv-cval { display: grid; place-items: center; min-width: 42px; padding: 0 8px; font: 700 15px var(--uv-mono); color: #0f172a; }
.uv-cnext { width: 18px; border-left: 1px solid #d5deea; background: #f4f7fb; position: relative; }
.uv-cnext::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #64748b; }
.uv-carrow { position: relative; width: 26px; height: 2px; margin: 0 3px; background: #64748b; }
.uv-carrow::after { content: ""; position: absolute; right: -1px; top: -4px; border-left: 7px solid #64748b; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.uv-cnull {
    display: grid; place-items: center;
    height: 40px; min-width: 46px; padding: 0 8px; box-sizing: border-box;
    border: 1px dashed #b8c6db; border-radius: 6px;
    font: 700 13px var(--uv-mono); color: var(--uv-muted); background: #f8fafc;
}
.uv-cend.is-cycle .uv-cnull { color: #6d28d9; border-color: #c4b5fd; }

/* the tree keeps the old page's geometry (viewBox); it is scaled down to fit a narrow card, never cut */
.uv-tsvg { display: block; max-width: 100%; height: auto; }
.uv-tedge { stroke: #94a3b8; stroke-width: 2.5; stroke-linecap: round; }
.uv-tedge.is-on { stroke: #e0a100; stroke-width: 3.5; }
.uv-tedge-label { fill: #94a3b8; font: 700 11px var(--uv-font); }
.uv-tedge-label.is-on { fill: #b45309; }
.uv-tcircle { fill: #ffffff; stroke: #64748b; stroke-width: 2.5; }
.uv-tnode.is-marked .uv-tcircle { stroke: #e0a100; stroke-width: 3; }
.uv-tnode.is-primary .uv-tcircle { fill: var(--uv-changed); stroke: #b45309; stroke-width: 3.5; }
.uv-thalo { fill: none; stroke: #e0a100; stroke-width: 2; stroke-dasharray: 5 3; }
.uv-tnode.is-shared .uv-tcircle { stroke-dasharray: 4 3; }
.uv-tval { fill: #0f172a; font: 700 14px var(--uv-mono); }
.uv-tptr rect { fill: #e5eefb; stroke: #9db8e6; stroke-width: 1; }
.uv-tnode.is-primary .uv-tptr rect { fill: var(--uv-changed); stroke: #e0a100; }
.uv-tptr text { fill: var(--uv-accent); font: 700 11.5px var(--uv-mono); }
.uv-null-chip { background: #fde4e1; color: #b42318; }

/* ------------------------------------------------------------------ smaller screens */


@media (max-width: 760px) {
    body.uv-page { overflow: auto; height: auto; min-height: 100%; }
    html { height: auto; }
    .uv-workspace { display: flex; flex-direction: column; gap: 6px; flex: none; }
    .uv-splitter { display: none; }
    .uv-editor-col { height: 72vh; min-height: 420px; }
    /* long code lines scroll inside the editor (the page itself never scrolls sideways) */
    .uv-editor .cm-editor .cm-gutter.cm-lineNumbers .cm-gutterElement { min-width: 26px; padding: 0 6px 0 4px; }
    .uv-visual-col { height: 72vh; min-height: 380px; }
    .uv-workspace.uv-max-editor .uv-editor-col { height: calc(100vh - 110px); }
}

/* ------------------------------------------------------------------ stage D4: objects, Stack / Heap, references (engine data) */

/* reference chip: engine heap id + class (+ the configured identifying field); null is explicit */
.uv-ref {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 1px 7px; border-radius: 10px;
    background: #eef0ff; border: 1px solid #c7cdfa;
    font: 600 12px/18px var(--uv-mono); color: #3730a3; white-space: nowrap;
}
.uv-ref-id { font-weight: 700; }
.uv-ref-cls { color: #1d4f9c; }
.uv-ref-key { color: #0f172a; font-weight: 500; }
.uv-ref-null { display: inline-block; padding: 0 7px; border-radius: 10px; border: 1px dashed #b8c6db; color: var(--uv-muted); font: 600 12px/18px var(--uv-mono); }
.uv-lit { font: 600 12.5px var(--uv-mono); color: #0f172a; white-space: nowrap; }
.uv-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #4f46e5; box-shadow: 0 0 0 2px #fff; }
.uv-acell.is-object { align-items: center; justify-content: center; padding: 4px 6px; }

/* the Stack and Heap card: Stack on the right (RTL page), Heap on the left, arrows between them */
.uv-card[data-card="memory"] .uv-card-body { container-type: inline-size; }
.uv-mem {
    position: relative;
    display: grid; grid-template-columns: minmax(170px, 0.8fr) minmax(0, 2fr);
    gap: 12px 44px; align-items: start;
}
@container (max-width: 560px) {
    /* Stack above Heap: the stack dots sit in a left gutter, outside the frame boxes, so the arrows never cross rows */
    .uv-mem { grid-template-columns: minmax(0, 1fr); padding-left: 16px; }
    .uv-mem .uv-svar .uv-dot { left: -18px; }
}
.uv-mem-title { margin-bottom: 6px; padding-bottom: 3px; border-bottom: 1px solid var(--uv-border-soft); font: 700 13px var(--uv-font); color: #26385a; }
.uv-mem-title span { font-weight: 400; font-size: 12px; color: var(--uv-muted); }
.uv-mem-empty { padding: 8px; color: var(--uv-faint); font: 600 12.5px var(--uv-font); text-align: center; }
.uv-mem-empty.is-small { padding: 2px 4px; font-size: 11.5px; text-align: start; }
.uv-mem-stack, .uv-mem-heap { min-width: 0; }
.uv-sframe { margin-bottom: 8px; padding: 4px 6px 6px; border: 1px solid var(--uv-border-soft); border-radius: 6px; background: #fbfcfe; }
.uv-sframe.is-top { border-color: #a9bfe3; }
.uv-sframe-title { font: 700 12px var(--uv-mono); color: #26385a; text-align: left; }
.uv-svar {
    position: relative;
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px;
    margin-top: 4px; padding: 3px 8px 3px 12px;
    border: 1px solid #e3e9f2; border-radius: 5px; background: #fff;
    font: 12.5px var(--uv-mono);
}
.uv-svar-name { font-weight: 700; color: #1d4f9c; }
.uv-svar-type { color: var(--uv-muted); font-size: 11.5px; }
.uv-svar-val { margin-left: auto; }
.uv-svar.is-target { background: var(--uv-changed); border-color: #e0b100; }
/* the stack's pointer dot sits on the edge that faces the heap */
.uv-svar .uv-dot { position: absolute; left: -5px; top: calc(50% - 4.5px); }
.uv-heap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 26px; direction: ltr; text-align: left; }
/* OOP Heap: one column in allocation order, next to the Stack (arrows never cross other objects) */
.uv-mem .uv-heap { flex-direction: column; flex-wrap: nowrap; align-items: flex-end; gap: 12px; padding-right: 2px; }
.uv-mem .uv-hobj { max-width: 100%; }
.uv-hobj {
    position: relative; flex: 0 1 auto; min-width: 170px; max-width: 340px;
    border: 1.5px solid #c9d4e5; border-radius: 8px; background: #fff; overflow: hidden;
}
.uv-hobj-head { display: flex; align-items: baseline; gap: 8px; padding: 4px 9px; background: #334155; color: #fff; font: 12.5px var(--uv-mono); }
.uv-hobj.is-array .uv-hobj-head { background: #475569; }
.uv-hobj-id { margin-left: auto; color: #cbd5e1; }
.uv-hobj-meta { color: #e2e8f0; font: 11.5px var(--uv-font); direction: rtl; }
.uv-hobj-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; padding: 3px 9px; border-bottom: 1px solid var(--uv-border-soft); background: #f8fafc; direction: rtl; }
.uv-hobj-refs-l { font: 11px var(--uv-font); color: var(--uv-muted); direction: rtl; }
.uv-hobj-ref { direction: ltr; unicode-bidi: isolate; padding: 0 4px; border-radius: 4px; background: #eef0ff; color: #3730a3; font: 600 11.5px var(--uv-mono); }
.uv-hfields { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 6px; }
.uv-hfield { display: flex; align-items: center; gap: 6px; padding: 2px 5px; border-radius: 4px; font: 12.5px var(--uv-mono); }
.uv-hfield-name { font-weight: 700; color: #334155; }
.uv-hfield-val { margin-left: auto; display: inline-flex; align-items: center; }
.uv-hfield-val .uv-dot { margin-left: 2px; }
.uv-hfield.is-changed { background: var(--uv-changed); box-shadow: inset 0 0 0 1px #e0b100; }
.uv-acc { width: 9px; font-weight: 700; text-align: center; }
.uv-acc-public { color: #15803d; }
.uv-acc-private { color: #b42318; }
.uv-acc-protected { color: #b45309; }
/* ------------------------------------------------------------------ stage D5: inheritance layers, construction, dispatch */

/* nested layers ("Russian dolls"): derived outside, base inside — the old page's colours per level */
.uv-dolls { padding: 5px 6px 6px; }
.uv-doll { border: 1.5px solid #cbd5e1; border-radius: 7px; background: #fff; padding: 0 0 4px; }
.uv-doll .uv-doll { margin: 4px 5px 0; }
.uv-doll-head { display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-bottom: 1px solid #0000000f; font: 700 11.5px var(--uv-mono); }
.uv-hlayer-name { font: 700 11.5px var(--uv-mono); }
.uv-doll-badge { margin-left: auto; padding: 0 6px; border-radius: 9px; color: #fff; font: 600 10.5px/16px var(--uv-font); }
.uv-doll > .uv-hfields { padding: 3px 5px 0; }
.uv-doll.is-base { border-color: #3b82f6; background: #eff6ff; }
.uv-doll.is-base > .uv-doll-head { color: #1d4ed8; }
.uv-doll.is-base > .uv-doll-head .uv-doll-badge { background: #1d4ed8; }
.uv-doll.is-mid { border-color: #8b5cf6; background: #f5f3ff; }
.uv-doll.is-mid > .uv-doll-head { color: #6d28d9; }
.uv-doll.is-mid > .uv-doll-head .uv-doll-badge { background: #6d28d9; }
.uv-doll.is-leaf { border-color: #ec4899; background: #fdf2f8; }
.uv-doll.is-leaf > .uv-doll-head { color: #be185d; }
.uv-doll.is-leaf > .uv-doll-head .uv-doll-badge { background: #be185d; }
.uv-doll .uv-hfield { background: #ffffffbf; }
/* construction (engine states) and dispatch (the layer whose implementation runs) — static marks, no animation */
.uv-doll.is-constructing, .uv-hobj.is-constructing { border-style: dashed; }
.uv-doll.is-active-ctor { box-shadow: 0 0 0 2px #a5b4fc; }
.uv-doll.is-dispatch-hit, .uv-hobj.is-dispatch-hit { border-color: #10b981; box-shadow: 0 0 0 2px #6ee7b7; }
.uv-doll-hit { padding: 0 5px; border-radius: 9px; background: #d1fae5; color: #047857; font: 700 10.5px/16px var(--uv-font); }
.uv-state { padding: 0 5px; border-radius: 9px; font: 600 10.5px/16px var(--uv-font); background: #f1f5f9; color: var(--uv-muted); border: 1px solid #e2e8f0; }
.uv-state-default { background: #fff; border-style: dashed; color: var(--uv-faint); }
.uv-state-initializing { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.uv-state-constructing { background: var(--uv-changed); color: #8a5a00; border-color: #e0b100; }
.uv-state-constructed { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.uv-hobj-head .uv-state { margin-left: 4px; }
.uv-ctor-chain, .uv-dispatch {
    display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px;
    padding: 3px 9px; border-bottom: 1px solid var(--uv-border-soft);
    font: 11.5px var(--uv-mono);
}
.uv-ctor-chain { background: #eef2ff; }
.uv-dispatch { background: #ecfdf5; }
.uv-strip-l { font: 600 11px var(--uv-font); color: var(--uv-muted); direction: rtl; }
.uv-ctor { padding: 0 5px; border-radius: 4px; background: #fff; border: 1px solid #c7d2fe; color: #3730a3; }
.uv-ctor.is-active { background: #4338ca; border-color: #4338ca; color: #fff; font-weight: 700; }
.uv-ctor.is-called { border-style: dashed; }
.uv-ctor-arrow { color: var(--uv-faint); }
.uv-disp-ct { padding: 0 5px; border-radius: 4px; background: #fff; border: 1px solid #cbd5e1; color: #334155; }
.uv-disp-sel { padding: 0 5px; border-radius: 4px; background: #047857; color: #fff; font-weight: 700; }
.uv-disp-kind { padding: 0 5px; border-radius: 9px; background: #d1fae5; color: #047857; font: 700 10.5px var(--uv-font); }
.uv-disp-types { color: var(--uv-muted); font-size: 11px; }
/* polymorphism: declared type of the variable vs the runtime type of the object */
.uv-ref.is-poly { background: #fdf2f8; border-color: #f9a8d4; }
.uv-ref-poly { font: 600 10.5px var(--uv-font); color: #9d174d; direction: rtl; }
/* English labels of the memory card read left to right (BUG-VV-08); the page layout stays RTL */
html[data-ui-lang="en"] .uv-strip-l, html[data-ui-lang="en"] .uv-ref-poly { direction: ltr; }
.uv-ref.is-poly .uv-ref-cls { color: #be185d; font-weight: 700; }
.uv-hobj.is-target { border-color: #e0b100; box-shadow: 0 0 0 2px #fde68a; }
.uv-hobj.is-linked { box-shadow: 0 0 0 3px #a5b4fc; }
.uv-mem-arrows { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 2; }
.uv-arrow { fill: none; stroke: #4f46e5; stroke-width: 2; opacity: 0.85; }
.uv-arrow.is-heap { stroke: #0f766e; stroke-width: 1.6; }
.uv-arrow.is-target { stroke-dasharray: 4 4; stroke-width: 2.5; }
.uv-arrow.is-linked { stroke-width: 3; opacity: 1; }
.uv-hfield .uv-dot { background: #0f766e; }

/* ------------------------------------------------------------------ stage E: trace / variables / call stack / inheritance */

.uv-trace-note { margin: 0 0 8px; padding: 5px 9px; border-radius: 6px; background: #eef3fb; color: #3b4a66; font: 12.5px/1.5 var(--uv-font); direction: rtl; }
.uv-badge-top { padding: 0 6px; border-radius: 9px; background: var(--uv-accent); color: #fff; font: 600 11px/17px var(--uv-font); }
/* trace */
.uv-trace { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.uv-trace-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; margin-bottom: 8px; }
.uv-trace-count { font: 600 12.5px var(--uv-font); color: var(--uv-muted); margin-left: 4px; }
.uv-trace-chips { display: contents; }
.uv-chip {
    display: inline-flex; align-items: center; gap: 4px;
    height: 24px; padding: 0 8px; border-radius: 12px;
    border: 1px solid #c9d4e5; background: #fff; color: #5d6b84;
    font: 600 12.5px var(--uv-mono); cursor: pointer;
}
.uv-chip small { font: 10.5px var(--uv-font); color: var(--uv-faint); }
.uv-chip.is-on { background: var(--uv-accent-soft); border-color: #9db8e3; color: #1d4f9c; }
.uv-chip.is-add { font-family: var(--uv-font); color: var(--uv-accent); border-style: dashed; }
.uv-chip.is-watch { background: #fff7df; border-color: #efd28a; color: #7a5200; cursor: default; }
.uv-chip.is-watch button { border: 0; background: transparent; color: #b42318; cursor: pointer; font-size: 14px; padding: 0 0 0 2px; }
.uv-watch-form { display: inline-flex; gap: 4px; margin-right: 4px; }
.uv-watch-input { width: 130px; height: 24px; box-sizing: border-box; padding: 0 7px; border: 1px solid #c9d4e5; border-radius: 6px; font: 12.5px var(--uv-mono); }
.uv-trace-scroll { flex: 1 1 auto; min-height: 120px; overflow: auto; direction: ltr; border: 1px solid var(--uv-border); border-radius: var(--uv-radius); background: #fff; }
.uv-trace-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font: 12.5px var(--uv-mono); }
.uv-trace-table th, .uv-trace-table td { padding: 4px 8px; border-bottom: 1px solid #edf1f7; border-left: 1px solid #f1f4f9; white-space: nowrap; text-align: center; }
.uv-trace-table thead th { position: sticky; top: 0; z-index: 1; background: #f5f7fb; color: #26385a; font-weight: 700; }
.uv-trace-table thead tr.uv-trace-groups th { position: static; background: #eef2f8; font: 600 11.5px var(--uv-font); }
.uv-trace-table tbody tr { cursor: pointer; }
.uv-trace-table tbody tr:hover { background: #f6f9ff; }
.uv-trace-table tbody tr.is-active { background: var(--uv-active-line); box-shadow: inset 3px 0 0 var(--uv-active-mark); }
.uv-trace-table td.is-changed { background: var(--uv-changed); font-weight: 700; }
.uv-trace-table td.uv-tc-other { background: repeating-linear-gradient(135deg, #f8fafc 0 6px, #f1f5f9 6px 12px); }
.uv-tc-step { color: var(--uv-muted); }
.uv-tc-frame { text-align: left !important; color: #1d4f9c; }
.uv-tc-frame small { color: var(--uv-faint); }
.uv-tc-cond, .uv-tc-out { text-align: left !important; color: #334155; }
.uv-tc-out { overflow-wrap: anywhere; }
.uv-tc-cond { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }   /* the whole condition is its tooltip */
.uv-trace-watch { background: #fffbeb; }
.uv-trace-watch.is-na { color: var(--uv-faint); }
.uv-trace-na { font: 600 10.5px var(--uv-font); color: #b45309; }
/* variables */
.uv-vframe { margin-bottom: 10px; padding: 6px; border: 1px solid var(--uv-border-soft); border-radius: 8px; background: #fff; }
.uv-vframe.is-top { border-color: #a9bfe3; }
.uv-vframe-title { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font: 700 12.5px var(--uv-mono); color: #26385a; }
.uv-vframe-title small { color: var(--uv-faint); font-weight: 400; }
.uv-vshort { margin-left: auto; font: 11px var(--uv-font); color: var(--uv-muted); }
.uv-vtable { width: 100%; border-collapse: collapse; font: 13px var(--uv-mono); }
.uv-vtable th { padding: 3px 8px; text-align: left; color: var(--uv-muted); font: 600 11.5px var(--uv-font); border-bottom: 1px solid var(--uv-border-soft); }
.uv-vtable td { padding: 4px 8px; border-bottom: 1px solid #f1f4f9; text-align: left; vertical-align: middle; }
.uv-vtable tr.is-changed td { background: var(--uv-changed); }
.uv-vname { font-weight: 700; color: #1d4f9c; }
.uv-vtype { color: var(--uv-muted); font-size: 12px; }
.uv-vval .uv-lit { white-space: pre-wrap; word-break: break-word; }
/* call stack */
.uv-call-event { margin-bottom: 8px; padding: 5px 9px; border-radius: 6px; font: 600 12.5px var(--uv-font); }
.uv-call-event.is-call { background: #eef2ff; color: #3730a3; }
.uv-call-event.is-return { background: #ecfdf5; color: #047857; }
.uv-call-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.uv-call {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
    padding: 6px 10px; border: 1px solid var(--uv-border); border-radius: 8px; background: #fff;
    font: 13px var(--uv-font);
}
.uv-call.is-top { border-color: var(--uv-accent); box-shadow: 0 0 0 2px var(--uv-accent-soft); }
.uv-call.is-recursive { border-right: 4px solid #8b5cf6; }
.uv-call-depth { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: #eef2f8; color: #26385a; font: 700 12px var(--uv-mono); }
.uv-call-name { font: 700 13.5px var(--uv-mono); color: #1d4f9c; }
.uv-call-rec { padding: 0 6px; border-radius: 9px; background: #f5f3ff; color: #6d28d9; font: 600 11px/17px var(--uv-font); }
.uv-call-loc, .uv-call-id { font: 12px var(--uv-mono); color: var(--uv-muted); }
.uv-call-from { margin-right: auto; font-size: 12px; color: var(--uv-muted); }
.uv-call-from b { font: 600 12px var(--uv-mono); color: #334155; }
/* inheritance (static class diagram): base above, derived below */
.uv-uml { direction: ltr; }
.uv-uml-tree, .uv-uml-tree ul { list-style: none; margin: 0; padding: 0; }
.uv-uml-tree { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.uv-uml-tree ul { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; padding-top: 6px; border-top: 2px solid #c7d2fe; }
.uv-uml-tree li { display: flex; flex-direction: column; align-items: flex-start; }
.uv-uml-link { margin: 0 0 3px 12px; font: 600 11.5px var(--uv-font); color: #4338ca; }
.uv-uml-link b { font: 700 11.5px var(--uv-mono); }
.uv-uml-box { min-width: 170px; max-width: 320px; border: 1.5px solid #94a3b8; border-radius: 6px; background: #fff; font: 12.5px var(--uv-mono); overflow: hidden; }
.uv-uml-box.is-abstract .uv-uml-head { font-style: italic; }
.uv-uml-head { display: flex; flex-direction: column; align-items: center; padding: 4px 8px; background: #334155; color: #fff; font-weight: 700; }
.uv-uml-head small { font-weight: 400; color: #cbd5e1; }
.uv-uml-file { font: 400 10.5px var(--uv-font); color: #cbd5e1; }
.uv-uml-sec { padding: 4px 8px; border-top: 1px solid #e2e8f0; }
.uv-uml-member { white-space: nowrap; color: #334155; }
.uv-uml-empty { color: var(--uv-faint); }

/* ------------------------------------------------------------------ stage F: the Input tab (scenarios, parameters, console input) */

.uv-in { display: flex; flex-direction: column; gap: 8px; padding: 2px 2px 6px; direction: rtl; font-size: 13px; }
.uv-in-scen { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; border: 1px solid #c7d2fe; border-radius: 6px; background: #eef2ff; }
.uv-in-scen label { font-weight: 700; color: #3730a3; }
.uv-in-select { height: 26px; min-width: 180px; max-width: 100%; border: 1px solid #a5b4fc; border-radius: 6px; background: #fff; font: 13px var(--uv-font); }
.uv-in-desc { flex: 1 1 200px; color: #4b5563; font-size: 12.5px; }
.uv-in-sec { border: 1px solid var(--uv-border-soft); border-radius: 6px; background: #fff; padding: 6px 8px; }
.uv-in-head { margin-bottom: 5px; font-weight: 700; color: #26385a; }
.uv-in-sub { font-weight: 400; color: var(--uv-muted); font-size: 12px; }
.uv-in-status { float: left; font-weight: 400; font-size: 12px; color: var(--uv-muted); }
.uv-in-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.uv-in-btn { height: 24px; padding: 0 9px; border: 1px solid #c9d4e5; border-radius: 6px; background: #f8fafc; color: #26385a; font: 600 12.5px var(--uv-font); cursor: pointer; white-space: nowrap; }
.uv-in-btn:hover { background: var(--uv-accent-soft); }
.uv-in-btn.is-primary { background: var(--uv-accent); border-color: var(--uv-accent); color: #fff; }
.uv-in-btn.is-danger { color: #b42318; }
.uv-in-paste { margin-bottom: 6px; padding: 6px; border: 1px dashed #93c5fd; border-radius: 6px; background: #f0f7ff; }
.uv-in-paste label { display: block; margin-bottom: 3px; font-size: 12px; color: #334155; }
.uv-in-paste textarea { width: 100%; box-sizing: border-box; font: 12.5px var(--uv-mono); }
.uv-in-table-box { max-height: 220px; overflow: auto; border: 1px solid #edf1f7; border-radius: 4px; }
.uv-in-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.uv-in-table th { position: sticky; top: 0; background: #f5f7fb; padding: 3px 6px; text-align: right; color: var(--uv-muted); font-weight: 600; }
.uv-in-table td { padding: 2px 6px; border-top: 1px solid #f1f4f9; vertical-align: middle; }
.uv-in-table input, .uv-in-table select { height: 24px; box-sizing: border-box; border: 1px solid #d7dfeb; border-radius: 4px; font: 12.5px var(--uv-mono); background: #fff; }
.uv-in-table .input-cell-val { width: 110px; }
.uv-in-table .input-cell-note { width: 100%; min-width: 90px; font-family: var(--uv-font); }
.uv-in-table tr.active-input-row td { background: var(--uv-active-line); }
.uv-in-table tr.consumed-input-row td { color: var(--uv-muted); }
.uv-in-table .status-badge { font-size: 11.5px; white-space: nowrap; }
.uv-in-table .btn-input-row-del { border: 0; background: transparent; color: #b42318; cursor: pointer; font-size: 14px; }
.uv-in-params { display: flex; flex-direction: column; gap: 6px; }
.uv-in-param { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr) auto; align-items: center; gap: 3px 6px; }
.uv-in-param label { font: 600 12.5px var(--uv-mono); color: #1d4f9c; text-align: left; }
.uv-in-ptype { color: var(--uv-muted); font-weight: 400; }
.uv-in-param input { height: 26px; min-width: 0; box-sizing: border-box; padding: 0 7px; border: 1px solid #c9d4e5; border-radius: 6px; font: 13px var(--uv-mono); }
.uv-in-param input.is-invalid { border-color: #b42318; background: #fff5f4; }
.uv-in-err { grid-column: 1 / -1; color: #b42318; font-size: 12px; font-weight: 600; }
.uv-in-note { padding: 6px 9px; border-radius: 6px; background: #f5f7fb; color: #3b4a66; font-size: 12.5px; }
/* v0.9.1: the explicit automatic input; while it is off the scenarios and the table are shown but not used */
.uv-in-auto-note { padding: 2px 4px; color: var(--uv-faint); font-size: 12.5px; }
/* v0.9.1: the switch of the automatic input, in the tab row right after the "קלט אוטומטי" tab (visualizer.html) */
.uv-tab-switch { display: inline-flex; align-items: center; margin-inline-start: -6px; padding: 0 6px 0 2px; cursor: pointer; }
.uv-tab-switch input { width: 15px; height: 15px; margin: 0; cursor: pointer; accent-color: var(--uv-accent); }
.uv-tab-switch input:focus-visible { outline: 2px solid var(--uv-accent); outline-offset: 2px; }
.uv-in.is-auto-off .uv-in-scen, .uv-in.is-auto-off .uv-in-sec { opacity: 0.6; }

/* stage F: invalid input data — the visual tab says why nothing is drawn */
.uv-placeholder.is-input-error { color: #b42318; }
.uv-placeholder.is-input-error .bi { color: #e8a39b; }

/* ======================================================================================================
   stage G1 — interface language (Hebrew / English). Texts only: the page structure never changes
   (code left, visualization right, the banner / bars / cards keep their order in both languages).
   ====================================================================================================== */
/* the stand-alone interface-language selector of G1 moved into Settings (stage G3, js-unified/header.js) */
/* English: text blocks read left-to-right; containers that only order controls keep their direction */
html[data-ui-lang="en"] .uv-placeholder,
html[data-ui-lang="en"] .uv-trace-note,
html[data-ui-lang="en"] .uv-ds-meta,
html[data-ui-lang="en"] .uv-hobj-meta,
html[data-ui-lang="en"] .uv-in,
html[data-ui-lang="en"] .uv-menu,
html[data-ui-lang="en"] .uv-mem-empty,
html[data-ui-lang="en"] .uv-vars,
html[data-ui-lang="en"] .uv-calls { direction: ltr; }
html[data-ui-lang="en"] .uv-in-status { float: right; }
html[data-ui-lang="en"] .uv-trace-count { direction: ltr; unicode-bidi: isolate; }

/* ======================================================================================================
   stage G3 — the header of visualizer.html (Compact Precision): brand · page title · library · active example ·
   (variation) · spacer · C# | Java · settings. One row at every width; the workspace below is not changed.
   The brand and the C# | Java selector keep the markup / look of index.html and catalog.html.
   ====================================================================================================== */
.uv-banner { z-index: 30; }
.uv-banner .header-inner {
    min-height: 55px; height: 55px; padding: 0 17px; gap: 12px;
    flex-wrap: nowrap; max-width: none; min-width: 0;
}
.uv-banner .lang-selector { margin: 0; }
.uv-page-title {
    flex: none; margin: 0; padding: 2px 14px 2px 0;   /* the brand is on the right in both languages: separator on that side */
    border: 0; border-right: 1px solid #ffffff3d; border-radius: 0; background: none; box-shadow: none;
    color: #e8f1ff; font: 600 16px/1.25 var(--uv-font); letter-spacing: 0; white-space: nowrap; direction: inherit; text-align: start;
    cursor: default; user-select: none;
}
.uv-hbtn {
    flex: none; height: 32px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 1px solid #ffffff32; border-radius: 7px; background: #ffffff12; color: #eef5ff;
    font: 600 13px var(--uv-font); white-space: nowrap; cursor: pointer;
}
.uv-hbtn:hover, .uv-hbtn[aria-expanded="true"] { background: #ffffff26; border-color: #ffffff78; }
.uv-hbtn:focus-visible, .uv-example.has-info:focus-visible { outline: 2px solid #facc15; outline-offset: 2px; }
.uv-hicon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.uv-gear { width: 34px; padding: 0; }
.uv-header-spacer { flex: 1 1 auto; min-width: 4px; }
.uv-pop-anchor { position: relative; flex: none; min-width: 0; }
.uv-example-anchor { flex: 0 1 auto; display: flex; }
.uv-example {
    display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: min(36vw, 480px); height: 32px;
    padding: 0 10px; box-sizing: border-box; border: 1px solid #ffffff33; border-radius: 7px; background: #ffffff0d;
    color: #eef5ff; font: 700 13px/1.2 var(--uv-font);
}
.uv-example-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; unicode-bidi: plaintext; }
/* F1: the draft / unpublished label next to the example title (banner and fullscreen bar) */
.uv-example-draft { flex: none; padding: 1px 7px; border-radius: 999px; background: #facc15; color: #3b2a00; font: 700 11.5px/1.5 var(--uv-font); white-space: nowrap; }
.uv-example-draft[hidden] { display: none; }
.uv-example.is-missing { border-color: #facc1580; }
.uv-example.has-info { cursor: pointer; }
.uv-example.has-info:hover, .uv-example[aria-expanded="true"] { background: #ffffff26; border-color: #ffffff78; }
.uv-example-caret { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.uv-variant-name { font-weight: 700; }

/* popups under the header (one at a time) */
.uv-popup {
    position: absolute; top: calc(100% + 9px); right: 0; z-index: 60; box-sizing: border-box; padding: 12px;
    background: #fff; color: #17233c; border: 1px solid #d7dfeb; border-radius: 8px; box-shadow: 0 12px 35px #06172d35;
    font: 13px/1.5 var(--uv-font); text-align: start;
}
.uv-info { width: min(360px, 88vw); }
html[data-ui-lang="en"] .uv-popup { direction: ltr; }
html[data-ui-lang="he"] .uv-popup { direction: rtl; }
.uv-info-text { margin: 0; white-space: pre-line; }
.uv-variant-pop { min-width: 200px; display: flex; flex-direction: column; gap: 2px; padding: 6px; }
.uv-variant-opt { text-align: start; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.uv-variant-opt[aria-selected="true"], .uv-variant-opt:hover { background: #eef3ff; }
.uv-settings { left: 0; right: auto; width: 255px; display: flex; flex-direction: column; gap: 6px; }
.uv-settings-title { font-size: 14px; }
.uv-settings label { margin-top: 4px; font-size: 12px; font-weight: 700; }
.uv-settings select { padding: 7px 8px; border: 1px solid #d7dfeb; border-radius: 6px; background: #f5f7fb; color: #17233c; font: 13px var(--uv-font); }
/* v0.3 G3: the code editor section of the settings and the advanced dialog */
.uv-settings-sub { margin-top: 8px; padding-top: 8px; border-top: 1px solid #d7dfeb; font-size: 13px; }
.uv-settings-more { margin-top: 6px; padding: 7px 8px; border: 1px solid #d7dfeb; border-radius: 6px; background: transparent; color: #1d5fd1; font: 600 13px var(--uv-font); cursor: pointer; text-align: start; }
.uv-settings-more:hover { background: #eef3ff; }
/* v0.6.4: version and build time at the end of the settings (values are LTR inside the RTL / LTR interface) */
.uv-settings-about { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid #d7dfeb; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12px; color: #4a5872; }
.uv-settings-about dt { font-weight: 700; }
.uv-settings-about dd { margin: 0; font-family: var(--uv-mono); unicode-bidi: isolate; }
html[data-theme="dark"] .uv-settings-about { border-color: #2d3a51; color: #a3b2c9; }
/* v0.9.5: the links to the language documentation (languages/*.html) */
.uv-settings-langdocs { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid #d7dfeb; font-size: 12px; }
.uv-settings-langdocs strong { display: block; margin-bottom: 2px; }
.uv-settings-langdocs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; line-height: 1.8; }
.uv-settings-langdocs a { color: #183775; }
html[data-theme="dark"] .uv-settings-langdocs { border-color: #2d3a51; }
html[data-theme="dark"] .uv-settings-langdocs a { color: #8bb9ff; }
.uv-ed-dialog { width: min(440px, 92vw); padding: 18px 20px; border: 1px solid #d7dfeb; border-radius: 10px; background: #fff; color: #17233c; box-shadow: 0 18px 50px #06172d40; font: 13px/1.5 var(--uv-font); }
.uv-ed-dialog::backdrop { background: #08152b66; }
html[data-ui-lang="en"] .uv-ed-dialog { direction: ltr; }
html[data-ui-lang="he"] .uv-ed-dialog { direction: rtl; }
.uv-ed-dialog-title { margin: 0 0 12px; font-size: 16px; }
.uv-ed-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.uv-ed-grid label { font-weight: 700; }
.uv-ed-grid select { padding: 6px 8px; border: 1px solid #d7dfeb; border-radius: 6px; background: #f5f7fb; color: inherit; font: 13px var(--uv-font); }
.uv-ed-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 14px; }
.uv-ed-check { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.uv-ed-note { margin: 12px 0 0; color: #5b6577; font-size: 12px; }
.uv-ed-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.uv-ed-btn { padding: 7px 14px; border: 1px solid #d7dfeb; border-radius: 6px; background: #fff; color: inherit; font: 600 13px var(--uv-font); cursor: pointer; }
.uv-ed-btn.is-primary { background: #1d5fd1; border-color: #1d5fd1; color: #fff; }
.uv-ed-btn:focus-visible, .uv-settings-more:focus-visible, .uv-ed-check input:focus-visible { outline: 2px solid #1d5fd1; outline-offset: 2px; }
html[data-theme="dark"] :is(.uv-ed-dialog, .uv-ed-btn:not(.is-primary)) { background: #172031; color: var(--uv-d-ink); border-color: #2d3a51; }
html[data-theme="dark"] .uv-ed-grid select { background: #202a3c; color: var(--uv-d-ink); border-color: #34425b; }
html[data-theme="dark"] :is(.uv-settings-sub) { border-color: #2d3a51; }
html[data-theme="dark"] .uv-settings-more { color: #8fb6ff; border-color: #34425b; }
html[data-theme="dark"] .uv-settings-more:hover { background: #202a3c; }
html[data-theme="dark"] .uv-ed-note { color: #9aa6ba; }

/* the visualization library: a drawer from the right, over a backdrop */
.uv-lib-backdrop { position: fixed; inset: 0; z-index: 79; background: #0b162a66; }
.uv-lib {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(380px, 92vw); box-sizing: border-box;
    display: flex; flex-direction: column; background: #fff; color: #17233c; box-shadow: -12px 0 35px #06172d40;
    font: 13px/1.4 var(--uv-font);
}
html[data-ui-lang="en"] .uv-lib { direction: ltr; }
html[data-ui-lang="he"] .uv-lib { direction: rtl; }
.uv-lib-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px 12px; border-bottom: 1px solid #e6ebf3; }
.uv-lib-title { flex: 1 1 auto; margin: 0; font-size: 16px; font-weight: 800; color: #183775; }
.uv-lib-close { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d7dfeb; border-radius: 7px; background: #f5f7fb; color: #33415c; cursor: pointer; }
.uv-lib-close:hover { background: #e6ecf6; }
.uv-lib-close .bi { width: 14px; height: 14px; }
.uv-lib-search { position: relative; display: flex; align-items: center; margin: 10px 12px 6px; }
.uv-lib-search svg { position: absolute; inset-inline-start: 10px; width: 16px; height: 16px; fill: none; stroke: #6a7b98; stroke-width: 2; pointer-events: none; }
.uv-lib-search input { width: 100%; box-sizing: border-box; padding: 8px 10px; padding-inline-start: 32px; border: 1px solid #cdd8ea; border-radius: 7px; background: #f8faff; color: inherit; font: 13.5px var(--uv-font); }
.uv-lib-search input:focus { outline: none; border-color: #183775; background: #fff; box-shadow: 0 0 0 3px #18377522; }
.uv-lib-list { flex: 1 1 auto; overflow: auto; padding: 2px 8px 8px; }
.uv-lib-group { --g: #183775; margin: 4px 0; border: 1px solid #e3e9f3; border-inline-start: 4px solid var(--g); border-radius: 8px; }
.uv-lib-group[data-domain="basics"] { --g: #0f766e; }
.uv-lib-group[data-domain="ds"] { --g: #b45309; }
.uv-lib-group[data-domain="oop"] { --g: #6d28d9; }
.uv-lib-ghead { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: start; }
.uv-lib-ghead:hover { background: #f3f6fc; }
.uv-lib-ghead:focus-visible, .uv-lib-item:focus-visible, .uv-lib-full:focus-visible, .uv-lib-close:focus-visible { outline: 2px solid #1c5bb8; outline-offset: -2px; }
.uv-lib-gname { flex: 1 1 auto; font-weight: 800; font-size: 14px; color: var(--g); }
.uv-lib-gcount { color: #5d6b84; font-size: 12px; }
.uv-lib-chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .15s ease; }
.uv-lib-group.is-collapsed .uv-lib-chev { transform: rotate(90deg); }
html[data-ui-lang="en"] .uv-lib-group.is-collapsed .uv-lib-chev { transform: rotate(-90deg); }
.uv-lib-group.is-collapsed .uv-lib-gbody { display: none; }
.uv-lib-gbody { padding: 0 6px 6px; }
.uv-lib-topic-title { padding: 6px 6px 2px; color: #5d6b84; font-size: 11.5px; font-weight: 700; }
.uv-lib-topic ul { list-style: none; margin: 0; padding: 0; }
.uv-lib-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-inline-start: 3px solid transparent; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: start; }
.uv-lib-item:hover { background: #eef3ff; }
.uv-lib-item.is-active { background: #e5eefb; border-inline-start-color: #1c5bb8; font-weight: 700; }
.uv-lib-title { flex: 1 1 auto; min-width: 0; font-size: 13.5px; line-height: 1.35; unicode-bidi: plaintext; text-align: start; }
.uv-lib-id { flex: none; color: #7a88a0; font: 11px var(--uv-mono); }
.uv-lib-empty { margin: 12px 14px; padding: 14px; text-align: center; color: #5d6b84; border: 1px dashed #c9d6ee; border-radius: 8px; }
.uv-lib-full { display: block; padding: 11px 14px; border-top: 1px solid #e6ebf3; color: #1c5bb8; font-weight: 700; text-decoration: none; }
.uv-lib-full:hover { background: #f3f6fc; }
body.uv-fullscreen .uv-lib, body.uv-fullscreen .uv-lib-backdrop { display: none; }

/* header widths: one row everywhere; the example name gives way first (ellipsis), then labels get shorter */
@media (max-width: 1100px) { .uv-banner .header-inner { gap: 10px; padding: 0 12px; } .uv-banner .brand-name { font-size: 20px; } }
@media (max-width: 820px) {
    .uv-banner .header-inner { gap: 8px; padding: 0 10px; flex-wrap: nowrap; }
    .uv-example { max-width: none; }
    .uv-example-anchor { flex: 0 1 auto; }
}
@media (max-width: 720px) { .uv-lib-btn .uv-hbtn-label { display: none; } .uv-lib-btn { width: 34px; padding: 0; } }
@media (max-width: 620px) {
    .uv-banner .header-inner { gap: 6px; padding: 0 8px; }
    .uv-banner .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .uv-banner .brand-symbol { width: 31px; height: 31px; }
    .uv-banner .brand-symbol svg { width: 25px; height: 25px; }
    .uv-page-title { font-size: 14px; padding-right: 8px; }
    .uv-banner .lang-btn { min-width: 38px; padding: 5px 7px; font-size: 12px; }
    .uv-example { padding: 0 8px; font-size: 12.5px; }
    .uv-hbtn, .uv-example { height: 30px; }
    .uv-gear, .uv-lib-btn { width: 30px; }
}
@media (max-width: 420px) {
    .uv-banner .header-inner { gap: 5px; }
    .uv-page-title { font-size: 12.5px; padding-right: 6px; }
    .uv-banner .lang-btn { min-width: 34px; padding: 5px 5px; }
}

/* ======================================================================================================
   stage G3 — appearance: <html data-theme="light | dark | mixed"> (js-unified/header.js; default mixed).
   light = the existing look; mixed = light interface + dark code editor; dark = dark interface + dark editor.
   Only colours change (CSS variables + the few fixed colours of this page); semantic highlight colours keep
   their meaning (the active step stays amber, errors red, changed values marked).
   ====================================================================================================== */
/* the code editor: dark in mixed and dark */
html[data-theme="mixed"] .uv-editor, html[data-theme="dark"] .uv-editor {
    --uv-ed-bg: #1b2130; --uv-ed-gutter: #171c29; --uv-ed-border: #2a3347; --uv-ed-text: #e3e9f4; --uv-ed-ln: #6e7d97;
    --uv-ed-active: #3b3218; --uv-ed-active-ln: #ffc861; --uv-ed-sel: #1f5fbf; --uv-ed-sel-text: #ffffff; --uv-ed-caret: #8fbaff;
    --uv-ed-error: #4a2224; --uv-ed-error-ln: #ff9b8f; --uv-ed-match: #3d4a63;
    --uv-tok-keyword: #8fbaff; --uv-tok-type: #6fd3c2; --uv-tok-string: #e6b673; --uv-tok-number: #f0a070;
    --uv-tok-comment: #7f8ea8; --uv-tok-meta: #d3a2f0;
    color-scheme: dark;
}
html[data-theme="mixed"] .uv-editor .cm-editor .cm-tooltip, html[data-theme="dark"] .uv-editor .cm-editor .cm-tooltip { background: var(--uv-ed-gutter); color: var(--uv-ed-text); border-color: var(--uv-ed-border); }
/* v0.6.4: the selection of the dark editor. A saturated blue clearly apart from the background (#1b2130) and from the
   other-occurrences mark (#3d4a63), and the selected text white (contrast 6.1:1 with #1f5fbf), whatever its syntax colour.
   CodeMirror draws the selection in a layer under the text and keeps the native selection transparent, so the text colour
   comes from ::selection. */
html:is([data-theme="mixed"], [data-theme="dark"]) .uv-editor .cm-editor .cm-line::selection,
html:is([data-theme="mixed"], [data-theme="dark"]) .uv-editor .cm-editor .cm-line ::selection { color: var(--uv-ed-sel-text); }
/* the step / error line paint over CodeMirror's selection layer: in the dark editor they are translucent (same look on
   the editor background as #3b3218 / #4a2224), so a selection that crosses them stays visible */
html:is([data-theme="mixed"], [data-theme="dark"]) .uv-editor .cm-editor .cm-line.cm-uv-step { background: rgba(255, 184, 0, .14); }
html:is([data-theme="mixed"], [data-theme="dark"]) .uv-editor .cm-editor .cm-line.cm-uv-step.cm-uv-error { background: rgba(255, 40, 40, .2); }

/* dark: the interface */
html[data-theme="dark"] {
    color-scheme: dark;
    --uv-bg: #0f1522; --uv-panel: #161e2c; --uv-bar: #1b2433; --uv-border: #2d3a51; --uv-border-soft: #253148;
    --uv-text: #e2e8f3; --uv-muted: #a3b2c9; --uv-faint: #71839f; --uv-accent: #6ea8ff; --uv-accent-strong: #8bb9ff;
    --uv-accent-soft: #1d3152; --uv-active-line: #3b3218; --uv-active-mark: #e5a823; --uv-changed: #4a3c12;
    --uv-temp-bg: #3b3218; --uv-temp-border: #8a6f28; --uv-temp-text: #f3d58a;
    --uv-d-surface: #1a2232; --uv-d-raised: #202a3c; --uv-d-line: #34425b; --uv-d-ink: #e2e8f3; --uv-d-blue: #8bb9ff;
}
html[data-theme="dark"] body.uv-page { background: var(--uv-bg); color: var(--uv-text); }
/* surfaces that are white / near-white in the light look */
html[data-theme="dark"] :is(.uv-menu, .uv-restore-visual, .uv-trace-scroll, .uv-vframe, .uv-call, .uv-uml-box, .uv-in-sec, .uv-in-select,
    .uv-in-table input, .uv-in-table select, .uv-in-param input, .uv-watch-input, .uv-chip, .uv-cell, .uv-char, .uv-acell, .uv-ccell, .uv-mcell,
    .uv-qbox, .uv-sitem, .uv-capsule, .uv-svar, .uv-hobj, .uv-doll, .uv-state-default, .uv-ctor, .uv-disp-ct) { background: var(--uv-d-surface); color: var(--uv-d-ink); }
html[data-theme="dark"] :is(.uv-view-panes, .uv-card-head, .uv-cell-index, .uv-qgate, .uv-cnext, .uv-cnull, .uv-sframe, .uv-hobj-refs,
    .uv-trace-table thead th, .uv-trace-table thead tr.uv-trace-groups th, .uv-in-btn, .uv-in-table th, .uv-in-note, .uv-state, .uv-call-depth,
    .uv-badge, .uv-ptr-tag, .uv-ptr-tag.is-null) { background: var(--uv-d-raised); color: var(--uv-d-ink); }
html[data-theme="dark"] .uv-trace-table tbody tr:hover { background: #1f2a3d; }
html[data-theme="dark"] .uv-trace-table td.uv-tc-other { background: repeating-linear-gradient(135deg, #1a2232 0 6px, #202a3c 6px 12px); }
/* lines and borders */
html[data-theme="dark"] :is(.uv-cell, .uv-char, .uv-acell, .uv-ccell, .uv-mcell, .uv-qbox, .uv-capsule, .uv-qgate, .uv-cnull, .uv-ref-null, .uv-svar,
    .uv-hobj, .uv-doll, .uv-chip, .uv-watch-input, .uv-in-btn, .uv-in-table input, .uv-in-table select, .uv-in-param input, .uv-uml-box, .uv-disp-ct,
    .uv-in-table-box, .uv-cell-index, .uv-trace-table th, .uv-trace-table td, .uv-vtable td, .uv-uml-sec, .uv-state, .uv-add-view-btn) { border-color: var(--uv-d-line); }
/* dark ink on light ground -> light ink */
html[data-theme="dark"] :is(.uv-code, .uv-console, .uv-step, .uv-badge, .uv-card-title, .uv-var-value, .uv-cell-value, .uv-char-value, .uv-str-lit,
    .uv-item-val, .uv-obj-fields, .uv-obj-field, .uv-ref-key, .uv-lit, .uv-mem-title, .uv-sframe-title, .uv-hfield-name, .uv-cval, .uv-tc-cond, .uv-tc-out,
    .uv-trace-table thead th, .uv-vframe-title, .uv-call-from b, .uv-uml-member, .uv-in-head, .uv-in-btn, .uv-in-paste label, .uv-in-note, .uv-in-desc,
    .uv-disp-ct, .uv-call-depth, .uv-icon-btn, .uv-ctl) { color: var(--uv-d-ink); }
html[data-theme="dark"] :is(.uv-var-name, .uv-array-name, .uv-ds-name, .uv-obj-badge, .uv-obj-title, .uv-ref-cls, .uv-svar-name, .uv-tc-frame, .uv-vname,
    .uv-call-name, .uv-in-param label, .uv-add-view-btn, .uv-chip.is-on, .uv-uml-link) { color: var(--uv-d-blue); }
html[data-theme="dark"] :is(.uv-icon-btn:hover, .uv-tab:hover, .uv-file-tab:hover, .uv-file-close:hover, .uv-tab-close:hover, .uv-ctl:hover:not(:disabled)) { background: #263248; }
html[data-theme="dark"] .uv-splitter:hover, html[data-theme="dark"] body.uv-dragging-x .uv-splitter { background: #26344d; }
/* tinted grounds: the same hue, dark */
html[data-theme="dark"] :is(.uv-cell.is-pointed, .uv-acell.is-read, .uv-mcell.is-diag-main) { background: #1d2c47; }
html[data-theme="dark"] :is(.uv-mcell.is-diag-sec, .uv-nested-item, .uv-canister, .uv-call-rec, .uv-doll.is-mid) { background: #261f3d; }
html[data-theme="dark"] .uv-mcell.is-diag-main.is-diag-sec { background: #222448; }
html[data-theme="dark"] .uv-doll.is-base { background: #172741; }
html[data-theme="dark"] .uv-doll.is-leaf { background: #36182b; }
html[data-theme="dark"] .uv-doll .uv-hfield { background: #ffffff0d; }
html[data-theme="dark"] .uv-doll.is-base > .uv-doll-head { color: #93b8ff; }
html[data-theme="dark"] .uv-doll.is-mid > .uv-doll-head { color: #c4b1ff; }
html[data-theme="dark"] .uv-doll.is-leaf > .uv-doll-head { color: #f9a8d4; }
html[data-theme="dark"] :is(.uv-state-initializing, .uv-ctor-chain, .uv-call-event.is-call, .uv-in-scen, .uv-hobj-ref, .uv-ref-ext) { background: #1e2346; color: #c7cdfa; }
html[data-theme="dark"] :is(.uv-state-constructed, .uv-dispatch, .uv-call-event.is-return, .uv-doll-hit, .uv-disp-kind) { background: #12332a; color: #86efc0; }
html[data-theme="dark"] :is(.uv-chip.is-watch, .uv-trace-watch) { background: #3b3218; color: #f3d58a; }
html[data-theme="dark"] .uv-in-paste { background: #172741; }
html[data-theme="dark"] .uv-in-param input.is-invalid { background: #3a1d1f; }
html[data-theme="dark"] :is(.uv-null-chip, .uv-badge.is-error) { background: #4a2224; color: #ffb4aa; }
html[data-theme="dark"] :is(.uv-console-error, .uv-in-err, .uv-placeholder.is-input-error) { color: #ff9b8f; }
html[data-theme="dark"] .uv-in-scen label { color: #c7cdfa; }
/* trees (svg) */
html[data-theme="dark"] .uv-tcircle { fill: var(--uv-d-surface); stroke: #8a9ab3; }
html[data-theme="dark"] .uv-tval { fill: var(--uv-d-ink); }
html[data-theme="dark"] .uv-tptr rect { fill: #1d3152; stroke: #4b6ea8; }
html[data-theme="dark"] .uv-tedge { stroke: #6b7c97; }
html[data-theme="dark"] .uv-dot { box-shadow: 0 0 0 2px var(--uv-panel); }
/* header layers in dark */
html[data-theme="dark"] :is(.uv-popup, .uv-lib) { background: #172031; color: var(--uv-d-ink); border-color: #2d3a51; }
html[data-theme="dark"] .uv-settings select, html[data-theme="dark"] .uv-lib-search input { background: #202a3c; color: var(--uv-d-ink); border-color: #34425b; }
html[data-theme="dark"] :is(.uv-lib-head, .uv-lib-full) { border-color: #2d3a51; }
html[data-theme="dark"] .uv-lib-title { color: #c9dbff; }
html[data-theme="dark"] .uv-lib-close { background: #202a3c; color: var(--uv-d-ink); border-color: #34425b; }
html[data-theme="dark"] .uv-lib-group { border-color: #2d3a51; border-inline-start-color: var(--g); }
html[data-theme="dark"] .uv-lib-group[data-domain="basics"] { --g: #2dd4bf; }
html[data-theme="dark"] .uv-lib-group[data-domain="ds"] { --g: #f59e0b; }
html[data-theme="dark"] .uv-lib-group[data-domain="oop"] { --g: #a78bfa; }
html[data-theme="dark"] :is(.uv-lib-ghead:hover, .uv-lib-full:hover, .uv-lib-item:hover, .uv-variant-opt:hover, .uv-variant-opt[aria-selected="true"]) { background: #202a3c; }
html[data-theme="dark"] .uv-lib-item.is-active { background: #1d3152; border-inline-start-color: #6ea8ff; }
html[data-theme="dark"] :is(.uv-lib-gcount, .uv-lib-topic-title, .uv-lib-id, .uv-lib-empty) { color: var(--uv-muted); }
html[data-theme="dark"] .uv-lib-full { color: #8bb9ff; }

/* ======================================================================================================
   stage G3 — visual alignment with UI_preview.html (visual reference only; no data / behaviour taken from it):
   brand symbol, C# | Java, name button, drawer below the header (415px), category heads, cards with an icon.
   ====================================================================================================== */
.site-header.uv-banner { border-bottom: 1px solid #244780; box-sizing: border-box; height: 55px; }
.uv-banner .header-inner { height: 100%; min-height: 0; }
.uv-banner .brand { gap: 10px; }
.uv-banner .brand-symbol { width: 35px; height: 35px; border: 1px solid #ffffff55; border-radius: 8px; background: #ffffff0c; color: #bcd7ff; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.uv-banner .brand-symbol svg { width: 31px; height: 31px; }
.uv-banner .brand-name { font-size: 23px; font-weight: 800; letter-spacing: -.65px; }
.uv-banner .lang-selector { display: flex; direction: ltr; align-items: center; gap: 2px; padding: 3px; border-radius: 9px; background: #06152e; border: 1px solid #ffffff50; }
.uv-banner .lang-btn { min-width: 0; font: 700 12px var(--uv-font); color: #fff; border: 0; background: transparent; border-radius: 6px; padding: 5px 18px; height: 28px; box-shadow: none; }
.uv-banner .lang-btn.is-active { background: #fff; color: #0c2c65; }
.uv-banner .lang-btn:focus-visible { outline: 2px solid #facc15; outline-offset: 2px; }
.uv-hicon { width: 18px; height: 18px; stroke-width: 1.8; }
.uv-example { max-width: 230px; background: #ffffff12; border-color: #ffffff32; font-weight: 600; }
.uv-info { width: 280px; max-width: 88vw; line-height: 1.65; }
.uv-lib-backdrop { inset: 55px 0 0; background: #08152b70; z-index: 40; }
.uv-lib { top: 55px; width: min(415px, 96vw); z-index: 50; border-left: 1px solid #d7dfeb; box-shadow: -10px 0 34px #071c4140; }
.uv-lib-head { justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #d7dfeb; }
.uv-lib-title { font-size: 16px; color: #17233c; }
.uv-lib-close { border: 0; background: transparent; color: #5d6b84; width: 28px; height: 28px; }
.uv-lib-close:hover { background: #f1f4f9; }
.uv-lib-search { margin: 0; padding: 12px 15px; }
.uv-lib-search input { padding: 10px 12px; border: 1px solid #d7dfeb; background: #f5f7fb; }
.uv-lib-list { padding: 0 13px 15px; }
.uv-lib-group { margin: 0 0 9px; border: 1px solid #d7dfeb; border-radius: 8px; overflow: hidden; }
.uv-lib-ghead { padding: 11px 12px; border-radius: 0; background: #f5f7fb; font-size: 13px; }
.uv-lib-ghead:hover { background: #eef2f8; }
.uv-lib-gname { font-size: 13px; color: #17233c; }
.uv-lib-gcount { font-size: 11.5px; }
.uv-lib-gbody { padding: 6px; }
.uv-lib-topic-title { padding: 6px 4px 3px; }
.uv-lib-item { align-items: flex-start; gap: 10px; padding: 10px; border: 1px solid transparent; border-radius: 7px; background: #fff; }
.uv-lib-item:hover { background: #f5f7fb; }
.uv-lib-item.is-active { border-color: #99b7e4; background: #e5eefb; font-weight: inherit; }
.uv-lib-icon { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border-radius: 6px; background: #eef3fb; color: #1c5bb8; font-size: 14px; }
.uv-lib-text { flex: 1 1 auto; min-width: 0; display: block; text-align: start; }
.uv-lib-title { display: block; font-weight: 700; font-size: 13px; }
.uv-lib-desc, .uv-lib-id { display: block; margin-top: 4px; font-size: 11px; line-height: 1.5; color: #5d6b84; }
.uv-lib-id { font-family: var(--uv-mono); text-align: start; }
.uv-lib-full { padding: 13px 16px; border-top: 1px solid #d7dfeb; font-weight: 600; }
@media (max-width: 850px) {
    .uv-banner .header-inner { gap: 7px; padding: 0 8px; }
    .uv-banner .brand-name { font-size: 18px; }
    .uv-hbtn { padding: 0 7px; font-size: 12px; }
    .uv-example { max-width: 140px; }
    .uv-banner .lang-btn { padding: 5px 9px; }
}
@media (max-width: 620px) { .uv-banner .brand-symbol { width: 31px; height: 31px; } .uv-banner .brand-symbol svg { width: 25px; height: 25px; } .uv-banner .lang-btn { padding: 5px 7px; } .uv-example { max-width: none; } }
@media (max-width: 420px) { .uv-banner .lang-btn { padding: 5px 5px; } }
/* dark (the preview's dark popup / drawer colours) */
html[data-theme="dark"] :is(.uv-popup, .uv-lib) { background: #16243b; color: #e6eefb; border-color: #38516f; }
html[data-theme="dark"] :is(.uv-settings select, .uv-lib-search input, .uv-lib-ghead) { background: #243750; color: #e6eefb; border-color: #38516f; }
html[data-theme="dark"] :is(.uv-lib-head, .uv-lib-full, .uv-lib-group) { border-color: #38516f; }
html[data-theme="dark"] .uv-lib-item { background: transparent; color: #e6eefb; }
html[data-theme="dark"] :is(.uv-lib-item.is-active, .uv-variant-opt[aria-selected="true"]) { background: #2c4870; border-color: #4f6f9c; }
html[data-theme="dark"] :is(.uv-lib-desc, .uv-lib-id, .uv-lib-gcount, .uv-lib-topic-title) { color: #c2d0e5; }
html[data-theme="dark"] :is(.uv-lib-title, .uv-lib-gname) { color: #e6eefb; }
html[data-theme="dark"] .uv-lib-icon { background: #243750; color: #8bb9ff; }
html[data-theme="dark"] .uv-lib-close { color: #c2d0e5; background: transparent; border: 0; }

/* ================================================================== trace fix (after G3) */

/* header: the views over the code area · full screen — next to the settings, the same look as the gear */
.uv-hicon-btn { width: 34px; padding: 0; }
.uv-hicon-btn .bi { width: 16px; height: 16px; flex: none; display: block; }
.uv-hicon-btn[aria-pressed="true"] { background: #ffffff2e; border-color: #ffffffa8; }
@media (max-width: 620px) { .uv-hicon-btn { width: 30px; } }
/* phone width: the header keeps the G3 room for the example name (these two are desktop / tablet controls) */
@media (max-width: 520px) { .uv-hicon-btn { display: none; } }

/* the views take the whole workspace (also the code area); the run controls come with them */
.uv-workspace.uv-expand-visual { grid-template-columns: minmax(0, 1fr); }
.uv-workspace.uv-expand-visual .uv-editor-col,
.uv-workspace.uv-expand-visual .uv-splitter { display: none; }
.uv-visual-col > .uv-controls { border-radius: 0 0 var(--uv-radius) var(--uv-radius); }

/* trace: settings */
.uv-tset-anchor { position: relative; flex: none; display: inline-flex; }
.uv-trace-gear {
    width: 28px; height: 26px; display: inline-grid; place-items: center; padding: 0;
    border: 1px solid var(--uv-border); border-radius: 6px; background: #fff; color: #3b5f99; cursor: pointer;
}
.uv-trace-gear .bi { width: 14px; height: 14px; display: block; }
.uv-trace-gear:hover, .uv-trace-gear[aria-expanded="true"] { background: var(--uv-accent-soft); border-color: #9db8e3; color: var(--uv-accent); }
.uv-trace-gear:focus-visible { outline: 2px solid var(--uv-accent); outline-offset: 1px; }
.uv-tset {
    /* 2026-10-29: anchored at the button's right edge in both languages (the buttons sit at the right of their pane) */
    position: absolute; top: calc(100% + 5px); right: 0; left: auto; z-index: 20;
    min-width: 210px; padding: 10px 12px; display: grid; gap: 8px;
    border: 1px solid var(--uv-border); border-radius: 8px; background: #fff; color: var(--uv-text);
    box-shadow: 0 8px 24px #10264a2e; font: 13px var(--uv-font); text-align: start;
}
.uv-tset[hidden] { display: none; }
.uv-tset-title { font-weight: 700; font-size: 13.5px; }
.uv-tset fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 3px; }
.uv-tset legend { padding: 0 0 3px; font: 600 12px var(--uv-font); color: var(--uv-muted); }
.uv-tset-opt { display: flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; }
.uv-tset-opt input { margin: 0; accent-color: var(--uv-accent); }
html[data-ui-lang="en"] .uv-tset { direction: ltr; }

/* trace: column widths (drag the header separator) */
.uv-trace-table th { position: relative; }
.uv-trace-table thead th { position: sticky; }
.uv-th-rz { position: absolute; top: 0; right: 0; width: 8px; height: 100%; z-index: 3; cursor: col-resize; touch-action: none; }
.uv-th-rz:hover, body.uv-dragging-col .uv-th-rz { background: linear-gradient(90deg, transparent 5px, #7aa2e3 5px 7px, transparent 7px); }
body.uv-dragging-col, body.uv-dragging-col * { cursor: col-resize !important; user-select: none; }
.uv-trace-table.is-sized { table-layout: fixed; min-width: 0; }
.uv-trace-table.is-sized th, .uv-trace-table.is-sized td { overflow: hidden; text-overflow: ellipsis; }
.uv-trace-table .uv-tc-cond { max-width: none; }
.uv-trace-table:not(.is-sized) .uv-tc-cond { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* trace: arrays — inside the table (only the row where the array changed; the changed cell marked) */
.uv-tarr { display: inline-flex; gap: 2px; vertical-align: middle; }
.uv-tarr.is-2d { flex-direction: column; }
.uv-tarr-row { display: inline-flex; gap: 2px; }
.uv-tarr-c {
    min-width: 22px; padding: 1px 4px; display: inline-flex; flex-direction: column; align-items: center;
    border: 1px solid #d5deeb; border-radius: 4px; background: #fff; color: #1f2a3d; font: 12px var(--uv-mono); line-height: 1.35;
}
.uv-tarr-c small { font: 9.5px var(--uv-mono); color: var(--uv-faint); }
/* the cell in focus: ONE frame for read and write; a write also fills the cell (also when the value is the same) */
.uv-tarr-c.is-read, .uv-tarr-c.is-write { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
.uv-tarr-c.is-write { background: var(--uv-changed); font-weight: 700; }
.uv-trace-table td.is-changed .uv-tarr-c:not(.is-write) { font-weight: 400; }

/* trace: arrays — a separate area above the table (current state of every array, changed cells marked) */
.uv-trace.has-arrays .uv-trace-arrays {
    flex: none; max-height: 40%; overflow: auto; margin-bottom: 8px; padding: 6px 8px;
    border: 1px solid var(--uv-border); border-radius: var(--uv-radius); background: #fff; direction: ltr;
}
.uv-trace-arrays-title { font: 600 12px var(--uv-font); color: var(--uv-muted); margin-bottom: 4px; direction: rtl; }
html[data-ui-lang="en"] .uv-trace-arrays-title { direction: ltr; }
.uv-trace-arrays-none { font: 12.5px var(--uv-font); color: var(--uv-faint); direction: rtl; }
.uv-tarr-box { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.uv-tarr-name { min-width: 70px; font: 600 12.5px var(--uv-mono); color: #1d4f9c; }
.uv-tarr-name small { font-weight: 400; color: var(--uv-faint); }

/* dark */
html[data-theme="dark"] :is(.uv-trace-gear, .uv-tarr-c, .uv-trace.has-arrays .uv-trace-arrays) { background: var(--uv-d-surface); color: var(--uv-d-ink); border-color: var(--uv-d-line); }
html[data-theme="dark"] .uv-tset { background: #172031; color: var(--uv-d-ink); border-color: #2d3a51; }
html[data-theme="dark"] :is(.uv-tarr-c.is-read, .uv-tarr-c.is-write) { border-color: #8bb9ff; box-shadow: 0 0 0 1px #8bb9ff; }
html[data-theme="dark"] .uv-tarr-c.is-write { background: #4a3b12; color: #f3d58a; }
html[data-theme="dark"] .uv-tarr-name { color: var(--uv-d-blue); }

/* banner fix: the brand subtitle under "CSVisualizer" (the symbol, the banner height and the brand width stay) */
.uv-banner .brand-text { display: inline-flex; flex-direction: column; justify-content: center; line-height: 1; }
.uv-banner .brand-text .brand-name { line-height: 1; }
.uv-banner .brand-tagline { margin-top: 1px; font: 400 9.5px/1.1 var(--uv-font); letter-spacing: .15px; color: #b9cdea; white-space: nowrap; }
@media (max-width: 1100px) { .uv-banner .brand-tagline { font-size: 8.5px; letter-spacing: -.1px; } }
@media (max-width: 620px) { .uv-banner .brand-tagline { display: none; } }

/* ================================================================== one trace table per invocation */
.uv-tframes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 8px; direction: ltr; }
.uv-tframes-sep { color: var(--uv-faint); font-size: 14px; }
.uv-tframe {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; cursor: pointer;
    border: 1px solid var(--uv-border); border-radius: 6px; background: #fff; color: #3b4a66; font: 600 12.5px var(--uv-mono);
}
.uv-tframe small { font: 500 10.5px var(--uv-font); color: var(--uv-faint); }
.uv-tframe.is-frozen { background: #f1f4f9; color: #64748b; }
.uv-tframe.is-active { border-color: #9db8e3; color: #1d4f9c; }
.uv-tframe.is-active small { color: #1d4f9c; }
.uv-tframe.is-shown { box-shadow: 0 0 0 2px var(--uv-accent); }
.uv-tframe:focus-visible { outline: 2px solid var(--uv-accent); outline-offset: 1px; }
.uv-trace-scroll.is-frozen { background: #f8fafc; }
html[data-theme="dark"] .uv-tframe { background: var(--uv-d-surface); color: var(--uv-d-ink); border-color: var(--uv-d-line); }
html[data-theme="dark"] .uv-tframe.is-frozen { background: #172031; color: #94a3b8; }
html[data-theme="dark"] .uv-tframe.is-active { color: var(--uv-d-blue); }
html[data-theme="dark"] .uv-trace-scroll.is-frozen { background: #141b29; }

/* ================================================================== calls and returns (the visualization card) */
.uv-card[data-card="calls"] { grid-column: 1 / -1; }
.uv-card[data-card="calls"] .uv-card-body { overflow: auto; direction: ltr; }   /* starts at the entry card (left) */
.uv-callcard-ret { text-align: left; }
.uv-callviz { position: relative; direction: ltr; }
.uv-callviz-lines { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.uv-call-arrow, .uv-ret-arrow { fill: none; stroke-width: 1.8; }
.uv-call-arrow { stroke: #2563eb; }
.uv-ret-arrow { stroke: #16a34a; stroke-dasharray: 5 3; }
#uv-call-head path { fill: #2563eb; }
#uv-ret-head path { fill: #16a34a; }
.uv-call-label {
    position: absolute; z-index: 2; padding: 0 4px; border-radius: 4px; white-space: normal; overflow: hidden;
    font: 600 11px/16px var(--uv-mono); background: #ffffffe0; word-break: break-word;
}
.uv-call-label.is-call { color: #1d4ed8; }
.uv-call-label.is-return { color: #15803d; }
.uv-callcard {
    position: absolute; z-index: 1; box-sizing: border-box; padding: 6px 9px; display: flex; flex-direction: column; gap: 2px;
    border: 1px solid #c9d6ea; border-radius: 8px; background: #fff; font: 12px var(--uv-mono); color: #1f2a3d; overflow: hidden;
}
.uv-callcard-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.uv-callcard-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1d4f9c; }
.uv-callcard-badge { margin-left: auto; padding: 0 6px; border-radius: 999px; background: #2563eb; color: #fff; font: 600 10.5px/16px var(--uv-font); }
.uv-callcard-done { margin-left: auto; color: #15803d; font: 600 10.5px var(--uv-font); }
.uv-callcard-args { color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uv-callcard-ret { color: #15803d; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 15px; }
.uv-callcard.is-active { border: 2px solid #2563eb; background: #eff5ff; box-shadow: 0 2px 8px #2563eb26; }
.uv-callcard.is-done { background: #f8fafc; border-style: dashed; }
html[data-theme="dark"] .uv-callcard { background: var(--uv-d-surface); color: var(--uv-d-ink); border-color: var(--uv-d-line); }
html[data-theme="dark"] .uv-callcard.is-active { background: #1d2c47; border-color: #8bb9ff; }
html[data-theme="dark"] .uv-callcard.is-done { background: #172031; }
html[data-theme="dark"] .uv-callcard-head b { color: var(--uv-d-blue); }
html[data-theme="dark"] .uv-callcard-args { color: #94a3b8; }
html[data-theme="dark"] :is(.uv-callcard-ret, .uv-callcard-done, .uv-call-label.is-return) { color: #86efc0; }
html[data-theme="dark"] .uv-call-label { background: #1a2232e0; }
html[data-theme="dark"] .uv-call-label.is-call { color: #8bb9ff; }

/* v0.3 II-F6: the code-scenario selector in the editor's file bar */
.uv-code-scenario { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 8px; font-size: 12px; color: var(--uv-muted); white-space: nowrap; }
.uv-code-scenario select { font: inherit; max-width: 200px; padding: 2px 6px; border: 1px solid var(--uv-border); border-radius: 6px; background: var(--uv-panel); color: var(--uv-text); }
/* v0.3 II-F6b: "רענן קוד" in the editor's file bar */
.uv-text-btn { margin-inline-end: 6px; padding: 2px 8px; font: inherit; font-size: 12px; border: 1px solid var(--uv-border); border-radius: 6px; background: var(--uv-panel); color: var(--uv-accent); cursor: pointer; white-space: nowrap; }
.uv-text-btn:disabled { color: var(--uv-faint); cursor: default; }
.uv-text-btn:not(:disabled):hover { background: var(--uv-accent-soft); }
/* v0.3 II-E9: a gap in a focused array of a trace row */
.uv-tarr-gap { align-self: center; padding: 0 3px; color: var(--uv-muted); font: 700 12px var(--uv-mono); cursor: help; }

/* v0.3 II-E3: the flowchart view (js-unified/visual-flow.js) */
.uv-flow { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.uv-flow-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; font: 600 12.5px var(--uv-mono); color: var(--uv-muted); }
.uv-flow-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uv-flow-tools { display: inline-flex; align-items: center; gap: 2px; direction: ltr; }
.uv-flow-zoom { min-width: 40px; text-align: center; font: 600 11.5px var(--uv-font); }
.uv-flow-btn[aria-pressed="true"] { color: var(--uv-active-mark); background: var(--uv-active-line); }
.uv-flow-scroll { cursor: grab; touch-action: none; }
.uv-flow-scroll.is-panning { cursor: grabbing; user-select: none; }
.uv-flow-scroll { flex: 1 1 auto; min-height: 120px; overflow: auto; border: 1px solid var(--uv-border); border-radius: var(--uv-radius); background: var(--uv-panel); }
.uv-flow-svg { display: block; margin: 0 auto; font: 12px var(--uv-mono); direction: ltr; }
.uv-flow-svg text { unicode-bidi: plaintext; }
.uv-flow-node rect, .uv-flow-node polygon { fill: var(--uv-panel); stroke: #8aa0c4; stroke-width: 1.4; }
.uv-flow-node.is-start rect, .uv-flow-node.is-end rect { fill: #eef3ff; stroke: #1c5bb8; }
.uv-flow-node.is-decision polygon { fill: #fff8e6; stroke: #c98a00; }
.uv-flow-node.is-io polygon { fill: #eefbf3; stroke: #2f8f5b; }
.uv-flow-node.is-return rect { stroke-width: 2.2; }
.uv-flow-node text { fill: var(--uv-text); }
.uv-flow-node.is-current rect, .uv-flow-node.is-current polygon { fill: var(--uv-active-line); stroke: var(--uv-active-mark); stroke-width: 3; }
.uv-flow-count { font: 700 10.5px var(--uv-mono); fill: #a35f00; }
.uv-flow-edge path { fill: none; stroke: #9aa9c2; stroke-width: 1.4; }
.uv-flow-edge.is-back path { stroke-dasharray: 5 3; }
.uv-flow-edge text { font: 10.5px var(--uv-font); fill: var(--uv-muted); }
.uv-flow-edge.is-taken path { stroke: var(--uv-active-mark); stroke-width: 2.6; stroke-dasharray: none; }
.uv-flow-edge.is-taken text { fill: #a35f00; font-weight: 700; }
#uv-flow-arrow path, .uv-flow-svg marker path { fill: #9aa9c2; }
.uv-flow-note { padding: 16px; color: var(--uv-muted); }
html[data-theme="dark"] .uv-flow-node.is-decision polygon { fill: #3a3218; }
html[data-theme="dark"] .uv-flow-node.is-io polygon { fill: #183a28; }
html[data-theme="dark"] .uv-flow-node.is-start rect, html[data-theme="dark"] .uv-flow-node.is-end rect { fill: #1d3152; }

/* v0.3 II-E4: arrays, matrices and strings (spec V3) — identity, jagged arrays, null, read vs written matrix cells */
.uv-heap-id { font: 600 10.5px var(--uv-mono); color: var(--uv-muted); border: 1px solid var(--uv-border); border-radius: 8px; padding: 0 5px; margin-inline-start: 6px; }
.uv-ds-item.is-null-ref .uv-null { color: var(--uv-faint); font-weight: 700; }
.uv-null.is-changed { background: var(--uv-changed); border-radius: 3px; padding: 0 3px; }
.uv-mcell.is-read { background: #eef4ff; border-color: #8fb0e6; box-shadow: inset 0 0 0 2px #8fb0e6; }
.uv-mcell.is-changed { background: var(--uv-changed); border-color: #e0b100; box-shadow: inset 0 0 0 2px #e0b100; }
.uv-mptr-row th { padding-bottom: 0; }
.uv-mptr .uv-ptr-names, .uv-matrix .uv-ptr-names { color: var(--uv-accent); font-weight: 700; }
.uv-jrows { display: flex; flex-direction: column; gap: 6px; direction: ltr; }
.uv-jrow { display: flex; align-items: flex-end; gap: 8px; padding: 2px 4px; border-left: 3px solid transparent; }
.uv-jrow.is-pointed { border-left-color: var(--uv-accent); }
.uv-jrow.is-changed { background: color-mix(in srgb, var(--uv-changed) 45%, transparent); }
.uv-jrow.is-read { background: #eef4ff; }
.uv-jhead { display: flex; align-items: center; gap: 4px; min-width: 120px; padding-bottom: 20px; font: 600 12px var(--uv-mono); color: var(--uv-muted); }
.uv-jptr { min-width: 28px; text-align: right; }
.uv-jptr .uv-ptr-names { color: var(--uv-accent); }
.uv-jalias { color: var(--uv-text); }
.uv-jnull { padding-bottom: 20px; }
.uv-jlen { padding-bottom: 22px; white-space: nowrap; }
.uv-str-note { font: 12px var(--uv-font); margin-inline-start: 8px; padding: 0 6px; border-radius: 8px; direction: rtl; }
.uv-str-note.is-new { background: var(--uv-changed); color: #6b4e00; }
.uv-str-note.is-shared { background: var(--uv-accent-soft); color: var(--uv-accent); }
html[data-theme="dark"] .uv-mcell.is-read, html[data-theme="dark"] .uv-jrow.is-read { background: #1d2c47; }
html[data-theme="dark"] .uv-str-note.is-new { color: #ffe08a; background: #4a3b10; }

/* v0.3 II-E4b: full / focused long arrays and strings */
.uv-focus-toggle { margin-inline-start: 8px; font-size: 11.5px; direction: rtl; }
.uv-agap .uv-acell.is-gap { background: transparent; border-style: dashed; color: var(--uv-muted); font-weight: 700; cursor: help; min-width: 28px; }
.uv-agap .uv-aidx { color: var(--uv-faint); }

/* v0.3 II-E5: queues and stacks (spec V4) — the value taken out, focused long collections, objects as references */
.uv-qremoved, .uv-sremoved { opacity: .75; }
.uv-qremoved { display: flex; flex-direction: column; align-items: center; gap: 2px; align-self: center; }
.uv-qremoved .uv-qbox, .uv-sremoved .uv-qbox { border-style: dashed; border-color: #e07a7a; background: #fff4f4; }
.uv-qremoved .uv-role, .uv-sremoved .uv-role { color: #b04040; font-weight: 700; }
.uv-sremoved { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 6px; }
.uv-dgap { display: flex; align-items: center; justify-content: center; color: var(--uv-muted); font: 700 12px var(--uv-mono); border: 1px dashed var(--uv-border); border-radius: 6px; min-width: 40px; cursor: help; }
.uv-sitem.uv-dgap { min-height: 26px; }
.uv-qitem.is-ref .uv-qbox, .uv-sitem.is-ref { display: flex; align-items: center; justify-content: center; }
html[data-theme="dark"] :is(.uv-qremoved, .uv-sremoved) .uv-qbox { background: #3a1d1d; }

/* v0.3 II-E6: Node / BinNode (spec V5) — Get / Set at the step, shared nodes, detached nodes, cycle vs shared */
.uv-cval.is-get, .uv-cnext.is-get { background: #e6efff; box-shadow: inset 0 0 0 2px #6d93d6; }
.uv-cval.is-set, .uv-cnext.is-set { background: var(--uv-changed); box-shadow: inset 0 0 0 2px #e0b100; }
.uv-carrow.is-set { background: #e0a100; height: 3px; }
.uv-carrow.is-set::after { border-left-color: #e0a100; }
.uv-carrow.is-get { background: #6d93d6; }
.uv-carrow.is-get::after { border-left-color: #6d93d6; }
.uv-nops { display: inline-flex; gap: 3px; margin-inline-start: 4px; }
.uv-nop { font: 700 10.5px var(--uv-mono); padding: 0 4px; border-radius: 6px; }
.uv-nop.is-get { background: #e6efff; color: #2a5bb0; }
.uv-nop.is-set { background: var(--uv-changed); color: #7a5600; }
.uv-cend.is-shared .uv-cnull { color: #0f766e; border-color: #5eead4; border-style: dashed; }
.uv-cend.is-shared small { color: var(--uv-muted); font-weight: 600; }
.uv-detached { opacity: .7; }
.uv-cnode.is-detached .uv-capsule { border-style: dashed; border-color: #e07a7a; background: #fff4f4; }
.uv-tnode.is-get .uv-tcircle { stroke: #6d93d6; stroke-width: 4; }
.uv-tnode.is-set .uv-tcircle { fill: var(--uv-changed); stroke: #e0b100; stroke-width: 4; }
.uv-tedge.is-set { stroke: #e0a100; stroke-width: 4.5; }
.uv-tedge.is-get { stroke: #6d93d6; stroke-width: 4; }
.uv-tnode.is-cycle .uv-tcircle { stroke: #6d28d9; }
html[data-theme="dark"] :is(.uv-cval.is-get, .uv-cnext.is-get, .uv-nop.is-get) { background: #1d2c47; color: #a9c4f5; }
html[data-theme="dark"] .uv-cnode.is-detached .uv-capsule { background: #3a1d1d; }

/* v0.3 II-E1b: zoom / pan of a card item (the binary trees) through the kit */
.uv-zoom-tools { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; direction: ltr; }
.uv-zoom-pct { min-width: 40px; text-align: center; font: 600 11.5px var(--uv-font); color: var(--uv-muted); }
.uv-zoom-btn { width: 26px; height: 26px; }
.uv-ds-scroll.uv-zoom-box.is-zoomed { overflow: auto; max-height: 520px; cursor: grab; touch-action: none; border: 1px solid var(--uv-border); border-radius: 6px; }
.uv-ds-scroll.uv-zoom-box.is-zoomed.is-panning { cursor: grabbing; user-select: none; }
.uv-zoom-box.is-zoomed > svg { max-width: none; }   /* the zoom of the viewer, not the width of the card */

/* v0.3 II-E8: step transitions (js-unified/visual-anim.js) — only while a pane carries data-anim (one real step forward
   or back), only on elements that already show the state of the step; the end state is the element's own style */
@keyframes uv-a-pulse { 0% { transform: scale(.82); filter: brightness(1.12); } 60% { transform: scale(1.06); } 100% { transform: none; filter: none; } }
@keyframes uv-a-fade { from { opacity: .25; } to { opacity: 1; } }
@keyframes uv-a-in-right { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes uv-a-in-top { from { opacity: 0; transform: translateY(-22px); } to { opacity: 1; transform: none; } }
@keyframes uv-a-out-left { from { opacity: 1; transform: translateX(26px); } to { opacity: .75; transform: none; } }
@keyframes uv-a-out-up { from { opacity: 1; transform: translateY(22px); } to { opacity: .75; transform: none; } }
@keyframes uv-a-draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
@keyframes uv-a-row { from { background: var(--uv-changed); } }
/* forward: the operation of the step */
[data-anim="fwd"] :is(.uv-acell.is-changed, .uv-mcell.is-changed, .uv-var.is-changed, .uv-hfield.is-changed, .uv-cval.is-set, .uv-cnext.is-set, .uv-nop, .uv-null.is-changed) { animation: uv-a-pulse .42s ease-out; }
[data-anim="fwd"] :is(.uv-acell.is-read, .uv-mcell.is-read, .uv-cval.is-get, .uv-cnext.is-get) { animation: uv-a-fade .35s ease-out; }
[data-anim="fwd"] .uv-qitem.is-tail.is-op { animation: uv-a-in-right .42s ease-out; }
[data-anim="fwd"] .uv-qitem.is-head.is-op, [data-anim="fwd"] .uv-sitem.is-top.is-op { animation: uv-a-pulse .42s ease-out; }
[data-anim="fwd"] .uv-stack[data-op="push"] .uv-sitem.is-top { animation: uv-a-in-top .42s ease-out; }
[data-anim="fwd"] .uv-qremoved { animation: uv-a-out-left .5s ease-out; }
[data-anim="fwd"] .uv-sremoved { animation: uv-a-out-up .5s ease-out; }
[data-anim="fwd"] .uv-detached { animation: uv-a-fade .5s ease-out reverse; }
[data-anim="fwd"] .uv-tnode:is(.is-set, .is-get) .uv-tcircle, [data-anim="fwd"] .uv-tnode.is-primary .uv-thalo { animation: uv-a-fade .4s ease-out; }
[data-anim="fwd"] .uv-tedge:is(.is-set, .is-get) { stroke-dasharray: 400; animation: uv-a-draw .5s ease-out; }
[data-anim="fwd"] .uv-flow-edge.is-taken path { stroke-dasharray: 400; animation: uv-a-draw .5s ease-out; }
[data-anim="fwd"] .uv-flow-node.is-current :is(rect, polygon) { animation: uv-a-fade .35s ease-out; }
[data-anim="fwd"] .uv-trace-table tbody tr.is-active { animation: uv-a-row .6s ease-out; }
[data-anim="fwd"] .uv-callcard.is-active { animation: uv-a-fade .35s ease-out; }
/* back: a neutral fade of what the earlier step shows (no operation is played backwards as if it ran again) */
[data-anim="back"] :is(.uv-acell.is-changed, .uv-mcell.is-changed, .uv-var.is-changed, .uv-hfield.is-changed, .uv-qitem.is-op, .uv-sitem.is-op,
  .uv-cval.is-set, .uv-cnext.is-set, .uv-flow-node.is-current, .uv-callcard.is-active, .uv-trace-table tbody tr.is-active) { animation: uv-a-fade .3s ease-out; }
html[data-motion="off"] [data-anim] *, html[data-motion="off"] [data-anim] { animation: none !important; }
@media (prefers-reduced-motion: reduce) { [data-anim] *, [data-anim] { animation: none !important; } }

/* v0.3 II-E7a: class diagram per spec V6 — interfaces, static members (UML: underlined), hiding, overloads */
.uv-uml-box.is-interface { border-style: dashed; }
.uv-uml-member.is-static { text-decoration: underline; }
.uv-uml-member.is-static i { text-decoration: none; }
.uv-uml-note { font: 600 10.5px var(--uv-font); color: #7a5600; background: var(--uv-changed); border-radius: 6px; padding: 0 4px; margin-inline-start: 4px; direction: rtl; }
.uv-uml-impl { font: 12px var(--uv-font); color: var(--uv-muted); padding: 2px 8px; border-bottom: 1px dashed var(--uv-border); direction: rtl; text-align: start; }
.uv-uml-impl b { font-family: var(--uv-mono); color: var(--uv-text); }

/* v0.3 II-E7b: Stack and Heap per spec V6 — field read at the step, hidden fields, static fields */
.uv-hfield.is-read { background: #e6efff; box-shadow: inset 0 0 0 1px #6d93d6; }
.uv-hfield.is-hidden .uv-hfield-name, .uv-hfield.is-hidden .uv-hfield-val { opacity: .7; }
.uv-hfield.is-hiding .uv-hfield-name { text-decoration: underline dotted; }
.uv-hfield-note { font: 600 10.5px var(--uv-font); color: #7a5600; background: var(--uv-changed); border-radius: 6px; padding: 0 4px; margin-inline-start: 6px; direction: rtl; }
.uv-statics { margin-top: 10px; }
.uv-static-class { display: inline-block; vertical-align: top; margin: 4px 6px 0 0; border: 1px dashed var(--uv-border); border-radius: 6px; padding: 4px 8px; min-width: 140px; background: var(--uv-panel); }
.uv-static-head { font: 700 12px var(--uv-mono); color: var(--uv-muted); margin-bottom: 2px; }
.uv-hfield.is-static .uv-hfield-name { text-decoration: underline; }
html[data-theme="dark"] .uv-hfield.is-read { background: #1d2c47; }
[data-anim="fwd"] .uv-hfield.is-read { animation: uv-a-fade .35s ease-out; }

/* v0.3 II-E7c: the overload chosen at a call (calls card) */
.uv-callcard-ovl { font: 600 10px var(--uv-font); color: #7a5600; background: var(--uv-changed); border-radius: 6px; padding: 0 4px; margin-inline-start: 4px; }
.uv-callcard-head b[data-signature] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; display: inline-block; vertical-align: bottom; }

/* v0.3 II-E7d: display depth of the Heap */
.uv-mem-depth-l { margin-inline-start: auto; font: 12px var(--uv-font); color: var(--uv-muted); }
.uv-mem-depth { font: inherit; margin-inline-start: 4px; }
.uv-mem-more { margin-top: 6px; padding: 4px 8px; border: 1px dashed var(--uv-border); border-radius: 6px; font: 12px var(--uv-font); color: var(--uv-muted); }
.uv-mem-heap > .uv-mem-title { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }

/* ===== decision CX: the "יעילות" (Complexity) tab (js-unified/view-complexity.js) ===== */
.uv-cx { padding: 14px 16px 28px; font: 13px/1.6 var(--uv-font); color: #17233c; }
.uv-cx-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.uv-cx-run { padding: 7px 16px; border: 1px solid #1d5fd1; border-radius: 7px; background: #1d5fd1; color: #fff; font: 700 13px var(--uv-font); cursor: pointer; }
.uv-cx-run:disabled { opacity: .6; cursor: progress; }
.uv-cx-run:focus-visible { outline: 2px solid #facc15; outline-offset: 2px; }
.uv-cx-status { color: #5b6577; font-size: 12.5px; }
.uv-cx-stale { margin: 0 0 10px; padding: 8px 10px; border: 1px solid #f0b429; border-radius: 6px; background: #fff7e0; color: #6b4a00; font-weight: 700; }
.uv-cx.is-stale .uv-cx-body { opacity: .55; }
.uv-cx-intro, .uv-cx-note { margin: 0 0 10px; color: #5b6577; }
.uv-cx-fail { margin: 0; color: #b42318; font-weight: 700; }
.uv-cx-method { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #d7dfeb; border-radius: 8px; background: #fff; }
.uv-cx-method.is-partial { border-color: #f0b429; }
.uv-cx-mtitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: 14px; }
.uv-cx-entry { padding: 0 7px; border-radius: 999px; background: #eef3ff; color: #1d5fd1; font-size: 11.5px; }
.uv-cx-line { color: #5b6577; font-size: 12px; font-weight: 400; }
.uv-cx-table { width: 100%; border-collapse: collapse; margin: 2px 0 6px; }
.uv-cx-table th, .uv-cx-table td { padding: 4px 6px; border-bottom: 1px solid #edf1f7; text-align: start; vertical-align: middle; }
.uv-cx-table th { width: 30%; font-weight: 600; }
.uv-cx-measure code { font-family: var(--uv-mono); font-size: 12.5px; white-space: nowrap; }
.uv-cx-measure b { color: #0f4fbf; }
.uv-cx-badge { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; }
.uv-cx-badge.is-proved { background: #e3f4ed; color: #0f7a5a; }
.uv-cx-badge.is-cond { background: #fff3d6; color: #8a5a00; }
.uv-cx-badge.is-unknown { background: #f1f3f6; color: #5b6577; }
.uv-cx-badge.is-upper { background: #fde8e4; color: #9a3412; }
.uv-cx-sub { margin: 8px 0 2px; font-weight: 700; font-size: 12.5px; }
.uv-cx-list { margin: 0; padding-inline-start: 20px; }
.uv-cx-list.is-warn li { color: #8a5a00; }
.uv-cx-partial { margin: 0 0 4px; color: #8a5a00; }
.uv-cx-how { margin-top: 6px; }
.uv-cx-how summary { cursor: pointer; font-weight: 700; color: #1d5fd1; }
.uv-cx-how ol { margin: 6px 0 0; padding-inline-start: 22px; }
/* English sentences inside the RTL layout: each line takes the direction of its own text (punctuation at the end), the layout stays */
html[data-ui-lang="en"] .uv-cx :is(p, li, summary, .uv-cx-status, .uv-cx-table th) { unicode-bidi: plaintext; text-align: start; }
html[data-theme="dark"] .uv-cx { color: var(--uv-d-ink); }
html[data-theme="dark"] .uv-cx-method { background: #172031; border-color: #2d3a51; }
html[data-theme="dark"] .uv-cx-table th, html[data-theme="dark"] .uv-cx-table td { border-color: #26324a; }
html[data-theme="dark"] :is(.uv-cx-status, .uv-cx-intro, .uv-cx-note, .uv-cx-line) { color: #9aa6ba; }
html[data-theme="dark"] .uv-cx-measure b { color: #8fb6ff; }
html[data-theme="dark"] .uv-cx-entry { background: #1c2a42; color: #8fb6ff; }
html[data-theme="dark"] .uv-cx-stale { background: #33290f; color: #f0c06a; border-color: #8a6a1a; }
html[data-theme="dark"] .uv-cx-how summary { color: #8fb6ff; }

/* ===== 2026-10-27: the Classes & Objects tab ("מחלקות ואובייקטים", js-unified/view-objects.js) =====
   Stack (left, 25%) | divider | Heap (right, 75%); arrows in one SVG over both. Theme colours come from the tokens. */
.uv-view-pane[data-view="objects"] { padding: 0; overflow: hidden; }
.ov-root {
    --ov-ref: #1c5bb8; --ov-sel: #d9480f; --ov-v: #1d5fd1; --ov-o: #d97706; --ov-n: #64748b; --ov-run: #fff3cf; --ov-run-line: #e59a0b;
    --ov-layer: #f6f8fc; --ov-layer-line: #d7dfeb; --ov-obj: #ffffff; --ov-dim: .38;
    position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; font: 13px var(--uv-font); color: var(--uv-text);
}
.ov-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 10px; border-bottom: 1px solid var(--uv-border-soft); background: var(--uv-bar); }
.ov-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--uv-muted); }
.ov-opt select { padding: 3px 6px; border: 1px solid var(--uv-border); border-radius: 6px; background: var(--uv-panel); color: var(--uv-text); font: 12px var(--uv-font); }
.ov-zoom { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.ov-zbtn { min-width: 26px; height: 24px; padding: 0 6px; border: 1px solid var(--uv-border); border-radius: 6px; background: var(--uv-panel); color: var(--uv-text); font: 700 13px var(--uv-font); cursor: pointer; }
.ov-zval { min-width: 38px; text-align: center; font-size: 12px; color: var(--uv-muted); }
.ov-body { position: relative; display: flex; flex: 1 1 auto; min-height: 0; }
.ov-stack { flex: 0 0 25%; min-width: 0; display: flex; flex-direction: column; background: var(--uv-panel); }
.ov-heap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--uv-bg); }
.ov-title { margin: 0; padding: 4px 10px; font: 700 12px var(--uv-font); letter-spacing: .04em; color: var(--uv-muted); }
.ov-split { flex: 0 0 6px; cursor: col-resize; background: var(--uv-border-soft); }
.ov-split:hover, .ov-split:focus-visible { background: var(--uv-accent); outline: none; }
.ov-vars { flex: 1 1 auto; overflow: auto; padding: 4px 8px 12px; }
.ov-var { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 4px 6px; margin-bottom: 4px; border: 1px solid var(--uv-border-soft); border-radius: 6px; background: var(--uv-panel); font-family: var(--uv-mono); font-size: 12.5px; }
.ov-var-name { font-weight: 700; }
.ov-var-type { color: var(--uv-muted); text-align: right; }
.ov-var-val { grid-column: 1 / -1; }
.ov-var.is-caller { opacity: .72; }
.ov-var.is-ref, .ov-field.is-ref { cursor: pointer; }
.ov-var.is-changed, .ov-field.is-changed { background: var(--uv-changed); }
.ov-var.is-selected, .ov-field.is-selected { outline: 2px solid var(--ov-sel); outline-offset: -1px; }
.ov-var:focus-visible, .ov-field:focus-visible { outline: 2px solid var(--uv-accent); outline-offset: -1px; }
.ov-empty { margin: 8px 4px; color: var(--uv-faint); font-size: 12px; }
.ov-ptr { display: inline-flex; align-items: center; gap: 5px; color: var(--ov-ref); font-weight: 700; }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ov-ref); flex: none; }
.ov-ptr.is-null { color: var(--uv-muted); font-weight: 400; }
.ov-ground { font-size: 1.15em; line-height: 1; color: var(--uv-muted); }
.ov-viewport { position: relative; flex: 1 1 auto; overflow: auto; }
.ov-sizer { position: relative; min-width: 100%; min-height: 100%; }
.ov-canvas { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; }
.ov-obj { position: absolute; width: max-content; min-width: 150px; max-width: 320px; border: 1.5px solid var(--uv-border); border-radius: 8px; background: var(--ov-obj); box-shadow: 0 1px 3px #0b162a1a; font-family: var(--uv-mono); font-size: 12.5px; }
.ov-obj.is-active { border-color: var(--ov-run-line); box-shadow: 0 0 0 2px #e59a0b33; }
.ov-obj.is-selected { border-color: var(--ov-sel); box-shadow: 0 0 0 2px #d9480f40; }
.ov-obj.is-unreachable { opacity: .45; border-style: dashed; }
.ov-obj.is-dragging { opacity: .85; z-index: 3; }
.ov-obj-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-bottom: 1px solid var(--uv-border-soft); cursor: grab; user-select: none; touch-action: none; }
.ov-label { font-weight: 700; color: var(--ov-ref); }
.ov-class { font-weight: 700; }
.ov-chip { padding: 0 6px; border-radius: 9px; font: 600 11px var(--uv-font); white-space: nowrap; }
.ov-chip.is-building { background: var(--uv-temp-bg); color: var(--uv-temp-text); border: 1px solid var(--uv-temp-border); }
.ov-chip.is-via { background: var(--uv-accent-soft); color: var(--uv-accent-strong); }
.ov-min { margin-left: auto; width: 20px; height: 20px; padding: 0; border: 1px solid var(--uv-border); border-radius: 5px; background: var(--uv-panel); color: var(--uv-text); font: 700 13px/1 var(--uv-font); cursor: pointer; }
.ov-min-refs { padding: 3px 8px 5px; color: var(--uv-muted); font: 12px var(--uv-font); }
.ov-obj.is-temp-open { border-style: dotted; }
.ov-obj-body { display: flex; flex-direction: column; gap: 3px; padding: 4px; }
.ov-layer { border: 1px solid var(--ov-layer-line); border-radius: 6px; background: var(--ov-layer); padding: 2px 4px 4px; }
.ov-layer-name { display: flex; align-items: center; gap: 6px; font: 700 11.5px var(--uv-font); color: var(--uv-muted); }
.ov-layer-state { font-weight: 400; font-style: italic; }
.ov-layer.is-default { border-style: dashed; opacity: .55; }
.ov-layer.is-default .ov-fval { font-style: italic; }
.ov-layer.is-initializing, .ov-layer.is-constructing { border-color: var(--ov-run-line); }
.ov-layer.is-ctor { background: var(--ov-run); border-width: 2px; }
.ov-layer.is-waiting { border-color: var(--ov-run-line); border-style: dashed; }
.ov-field { display: flex; justify-content: space-between; gap: 10px; padding: 1px 4px; border-radius: 4px; }
.ov-fval { font-weight: 700; }
.ov-methods { margin-top: 3px; padding-top: 2px; border-top: 1px dashed var(--ov-layer-line); font-style: italic; color: var(--uv-muted); }
.ov-method, .ov-ctor { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 4px; border-radius: 4px; line-height: 1.5; }
.ov-mark { display: inline-block; height: 1.05em; min-width: 1.05em; padding: 0 .2em; border-radius: 3px; color: #fff; font: 700 .78em/1.05em var(--uv-font); text-align: center; font-style: normal; vertical-align: middle; }
.ov-mark.is-v { background: var(--ov-v); }
.ov-mark.is-o { background: var(--ov-o); }
.ov-mark.is-n { background: var(--ov-n); }
.ov-method.is-running, .ov-ctor.is-running { background: var(--ov-run); color: var(--uv-text); font-weight: 700; font-style: normal; box-shadow: inset 3px 0 0 var(--ov-run-line); }
.ov-method.is-waiting, .ov-ctor.is-waiting { box-shadow: inset 3px 0 0 var(--ov-run-line); font-style: normal; }
.ov-method.is-target { outline: 1px dashed var(--uv-accent); }
.ov-method.is-chosen { background: var(--uv-accent-soft); color: var(--uv-accent-strong); font-weight: 700; font-style: normal; }
.ov-method.is-dim { opacity: var(--ov-dim); }
.ov-method.is-acc { color: var(--uv-text); font-style: normal; }
.ov-method.is-impl { color: var(--ov-sel); font-weight: 700; font-style: normal; }
.ov-method.is-over { text-decoration: line-through; color: var(--uv-muted); }
.ov-ctor-tag { font: 600 11px var(--uv-font); color: var(--uv-temp-text); }
.ov-args { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.ov-arg { padding: 0 5px; border-radius: 8px; background: var(--uv-accent-soft); color: var(--uv-accent-strong); font: 600 11px var(--uv-mono); font-style: normal; }
.ov-obj.is-array .ov-cells { display: flex; flex-wrap: wrap; gap: 3px; }
/* 2026-10-29: a Java / C# string object: its characters in the array cells, left to right; its length; its methods */
.ov-obj.is-string .ov-cells { display: flex; flex-wrap: wrap; gap: 3px; direction: ltr; margin-bottom: 4px; }
.ov-obj.is-string .ov-cell { min-width: 22px; font-family: var(--uv-mono); }
.ov-str-empty { color: var(--uv-faint); font-family: var(--uv-mono); }
/* the character read at this step (s[i] / s.charAt(i)): the read mark of the visual tab's cells */
.ov-obj.is-string .ov-cell.is-read { background: #eef4ff; border-color: #8fb0e6; box-shadow: inset 0 0 0 2px #8fb0e6; }
html[data-theme="dark"] .ov-obj.is-string .ov-cell.is-read { background: #1d2c47; }
.ov-str-len { font-size: 11.5px; color: var(--uv-muted); padding: 1px 2px 3px; }
.ov-cell { display: flex; flex-direction: column; align-items: center; min-width: 34px; padding: 2px 4px; border: 1px solid var(--ov-layer-line); border-radius: 4px; }
.ov-idx { font-size: 10px; color: var(--uv-faint); white-space: nowrap; }
.ov-arrows { position: absolute; left: 0; top: 0; pointer-events: none; overflow: hidden; }
.ov-arrow { fill: none; stroke: var(--ov-ref); stroke-width: 1.6; opacity: .85; }
.ov-arrow.is-sel { stroke: var(--ov-sel); stroke-width: 2.6; opacity: 1; }
.ov-arrow.is-unreachable { stroke-dasharray: 4 3; opacity: .45; }
.ov-head { fill: var(--ov-ref); }
.ov-head.is-sel { fill: var(--ov-sel); }
.ov-message { position: absolute; inset: 0; margin: 0; padding: 24px; background: var(--uv-panel); color: var(--uv-muted); font-size: 14px; }
.ov-fly { position: absolute; z-index: 5; padding: 1px 7px; border-radius: 10px; background: var(--ov-run-line); color: #fff; font: 700 12px var(--uv-mono); pointer-events: none; transition: transform .55s ease-in-out, opacity .55s; }
.ov-root[data-ov-anim] .ov-field.is-changed { animation: ov-flash .7s ease-out; }
@keyframes ov-flash { from { background: var(--ov-run-line); } to { background: var(--uv-changed); } }
@media (prefers-reduced-motion: reduce) { .ov-fly { transition: none; } .ov-root[data-ov-anim] .ov-field.is-changed { animation: none; } }
html[data-theme="dark"] .ov-root { --ov-ref: #8bb9ff; --ov-sel: #ff8a5c; --ov-v: #4b8bff; --ov-o: #f59e0b; --ov-run: #3b3218; --ov-layer: #1d2636; --ov-layer-line: #34425b; --ov-obj: #172031; }
/* the library drawer: open an OOP example straight in the Classes & Objects view */
.uv-lib-row:has(.uv-lib-objview) { display: flex; align-items: flex-start; gap: 4px; }
.uv-lib-row:has(.uv-lib-objview) .uv-lib-item { flex: 1 1 auto; min-width: 0; }
.uv-lib-objview { flex: none; width: 30px; height: 30px; margin-top: 8px; display: grid; place-items: center; border: 1px solid var(--uv-border); border-radius: 6px; background: var(--uv-panel); color: var(--uv-accent); cursor: pointer; }
.uv-lib-objview:hover, .uv-lib-objview:focus-visible { background: var(--uv-accent-soft); outline: none; }
.ov-this { padding: 0 5px; border-radius: 4px; background: var(--ov-run-line); color: #fff; font: 700 11px/1.45 var(--uv-mono); }
/* Classes & Objects: nested inheritance parts, folding, reference-type stripe, access / V-O-S columns, static boxes */
.ov-root { --ov-s: #7c3aed; --ov-reftype: #0f9d8a; }
.ov-layer > .ov-layer { margin-top: 3px; }
.ov-layer-name { gap: 4px; }
.ov-fold { width: 16px; height: 16px; padding: 0; border: 0; background: none; color: var(--uv-muted); font: 10px/16px var(--uv-font); cursor: pointer; }
.ov-fold:focus-visible { outline: 2px solid var(--uv-accent); outline-offset: 0; }
.ov-layer.is-folded { padding-bottom: 2px; }
.ov-layer.is-fold-temp { outline: 1px dotted var(--ov-run-line); outline-offset: -1px; }
.ov-layer.is-reftype { box-shadow: inset 3px 0 0 var(--ov-reftype); }
.ov-layer.is-reftype > .ov-layer-name .ov-layer-title { color: var(--ov-reftype); }
.ov-acc { display: inline-block; width: .9em; flex: none; text-align: center; font-weight: 700; font-style: normal; color: var(--uv-muted); }
.ov-mslot { display: inline-block; width: 1.25em; flex: none; }
.ov-mark.is-s { background: var(--ov-s); }
.ov-field.is-static .ov-fname { display: inline-flex; align-items: center; gap: 4px; }
.ov-obj.is-static { border-style: double; border-width: 3px; border-color: #c4b5fd; }
.ov-chip.is-static { background: #ede9fe; color: #5b21b6; }
.ov-uninit { color: var(--uv-faint); font-weight: 400; }
html[data-theme="dark"] .ov-root { --ov-s: #a78bfa; --ov-reftype: #2dd4bf; }
html[data-theme="dark"] .ov-obj.is-static { border-color: #5b4a8a; }
html[data-theme="dark"] .ov-chip.is-static { background: #2e2550; color: #c4b5fd; }

/* ======================================================================================================
   owner request 2026-10-28 — focus cards of the "המחשה" tab: data structures (queues, stacks, nodes, trees) and
   Stack and Heap. A step with one of them lays the pane out as one column of full-width cards that share its height
   (layout.js renderVisual + visual-fit.js focus); content starts at the left whatever the interface direction; a bar
   chooses the parts (main / calls and returns / both) and the zoom. Other steps keep the grid above unchanged.
   ====================================================================================================== */
#uv-pane-visual.is-focus:not([hidden]) { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.uv-vis-bar { flex: none; display: flex; align-items: center; gap: 10px; direction: ltr; min-height: 28px; }
.uv-vis-bar[hidden] { display: none; }
.uv-vis-parts { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--uv-border); border-radius: 7px; background: #fff; direction: rtl; }
.uv-vis-part {
    height: 24px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: #33445f;
    font: 600 12.5px var(--uv-font); white-space: nowrap; cursor: pointer;
}
.uv-vis-part:hover { background: var(--uv-accent-soft); color: var(--uv-accent); }
.uv-vis-part.is-active { background: var(--uv-accent); color: #fff; }
.uv-vis-part:focus-visible { outline: 2px solid var(--uv-accent); outline-offset: 1px; }
.uv-vis-zoom { margin-inline-start: 0; }
.uv-cards.is-focus { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 10px; overflow: auto; }
.uv-cards.is-focus > .uv-card { flex: 1 1 0; min-height: 150px; display: flex; flex-direction: column; }
.uv-cards.is-focus > .uv-card > .uv-card-head { flex: none; }
.uv-cards.is-focus > .uv-card > .uv-card-body { flex: 1 1 auto; min-height: 0; overflow: auto; direction: ltr; text-align: left; }
.uv-cards.is-focus > .uv-card.is-max > .uv-card-body { display: block; }
/* the content at its own size (scaled as a whole by the fit layer); its inner texts keep the page direction */
.uv-cards.is-focus .uv-card:not([data-card="calls"]) > .uv-card-body > .uv-fit { width: max-content; max-width: none; direction: rtl; }
/* one scroller per card: the inner scroll boxes of the structures show everything (the card body scrolls) */
.uv-cards.is-focus .uv-ds-scroll:not(.is-zoomed) { overflow: visible; }
.uv-cards.is-focus .uv-canister { max-height: none; overflow: visible; }
/* several stacks: side by side from the left, bottoms aligned, each as tall as its items */
.uv-cards.is-focus .uv-card[data-card="stacks"] .uv-card-body > .uv-fit { display: flex; align-items: flex-end; gap: 0; direction: ltr; }
.uv-cards.is-focus .uv-card[data-card="stacks"] .uv-ds-item + .uv-ds-item { margin: 0 0 0 22px; padding: 0 0 0 22px; border-top: 0; border-left: 1px dashed var(--uv-border-soft); }
html[data-theme="dark"] .uv-vis-parts { background: var(--uv-d-surface); border-color: var(--uv-d-line); }
html[data-theme="dark"] .uv-vis-part { color: var(--uv-d-ink); }
html[data-theme="dark"] .uv-vis-part:hover { background: #202a3c; color: #a9c4f5; }
html[data-theme="dark"] .uv-vis-part.is-active { background: #2c4870; color: #fff; }

/* ======================================================================================================
   owner request 2026-10-28 — Classes & Objects, combined style (experimental): Unit4 objects (Stack, Queue, Node,
   BinNode) with their public interface and their logical state (view-objects.js u4Html). The regular style is unchanged.
   ====================================================================================================== */
.ov-obj.is-u4 { max-width: 360px; }
.ov-u4-cap { font: 600 10.5px var(--uv-font); color: var(--uv-faint); letter-spacing: .02em; font-style: normal; }
.ov-u4-state { display: flex; flex-direction: column; gap: 3px; padding: 2px 2px 4px; }
.ov-u4-iface .ov-method { font-style: normal; color: var(--uv-text); }
.ov-u4-type { color: var(--uv-faint); font-size: 11px; }
.ov-u4-type::before { content: ': '; }
.ov-u4-ret { padding: 0 6px; border-radius: 8px; background: var(--uv-accent-soft); color: var(--uv-accent-strong); font: 700 11px var(--uv-mono); }
.ov-u4-stack { display: flex; flex-direction: column; align-items: stretch; min-width: 90px; border: 1.5px solid var(--ov-layer-line); border-top: 0; border-radius: 0 0 6px 6px; padding: 3px; gap: 2px; }
.ov-u4-queue { display: flex; flex-direction: row; align-items: stretch; gap: 2px; padding: 3px; border-top: 1.5px solid var(--ov-layer-line); border-bottom: 1.5px solid var(--ov-layer-line); overflow-x: auto; }
.ov-u4-item { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 38px; min-height: 24px; padding: 1px 6px; border: 1px solid var(--ov-layer-line); border-radius: 4px; background: var(--ov-layer); font-weight: 700; }
.ov-u4-queue .ov-u4-item { flex-direction: column; justify-content: flex-start; }
.ov-u4-end { font: 600 9.5px var(--uv-font); color: var(--uv-muted); }
.ov-u4-item.is-added { background: #dcfce7; border-color: #16a34a; }
.ov-u4-item.is-read, .ov-u4-part.is-read { background: var(--uv-accent-soft); outline: 1px solid var(--uv-accent); }
.ov-u4-empty { padding: 2px 6px; color: var(--uv-muted); font: italic 11.5px var(--uv-font); }
.ov-u4-removed { align-self: flex-start; padding: 0 6px; border-radius: 8px; background: #fee2e2; color: #991b1b; border: 1px dashed #dc2626; font: 600 11px var(--uv-mono); }
html[data-theme="dark"] .ov-u4-item.is-added { background: #14361f; border-color: #22c55e; }
html[data-theme="dark"] .ov-u4-removed { background: #3b1414; color: #fca5a5; border-color: #ef4444; }

/* ------------------------------------------------------------------ owner request 2026-10-28: two tabs, split panes, zoom */

/* the data-structures tab: the focus cards of the step (visual-fit.js focus), filling the pane */
#uv-pane-ds:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
#uv-pane-ds .uv-placeholder[hidden] { display: none; }
.uv-card.is-held > .uv-card-head { background: var(--uv-temp-bg); }
.uv-card-held { flex: 1 1 auto; min-width: 0; margin: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 11.5px var(--uv-font); color: var(--uv-temp-text); }
.uv-card.is-held.is-unreachable > .uv-card-body { opacity: .5; }
html[data-theme="dark"] .uv-card.is-held > .uv-card-head { background: #3a2a10; }
html[data-theme="dark"] .uv-card-held { color: #ffd38a; }

/* the calls tab: the calls card of the run, in its own pane (it scrolls when larger than the pane) */
#uv-pane-calls { direction: ltr; }   /* a wide diagram starts at the left and scrolls right (an RTL pane cannot scroll to overflow on its left) */
.uv-calls-tab { min-height: 100%; text-align: left; }
.uv-calls-zoom { width: max-content; direction: ltr; }
#uv-callt-head path { fill: #2563eb; }
#uv-rett-head path { fill: #16a34a; }
.uv-callcard.is-ctor { border-style: dashed; }
.uv-callcard-ovl.is-ctor { background: #ede9fe; color: #5b21b6; }
html[data-theme="dark"] .uv-callcard-ovl.is-ctor { background: #2e1f5e; color: #c4b5fd; }

/* tab row: the number of panes and the zoom of the active pane (at the physical left end, in both languages) */
.uv-panes-ctl { flex: none; display: inline-flex; align-items: center; gap: 1px; margin: 0 4px; padding: 1px; border: 1px solid var(--uv-border); border-radius: 6px; background: var(--uv-panel); direction: ltr; }
.uv-panes-icon { display: inline-grid; place-items: center; width: 18px; color: var(--uv-faint); }
.uv-panes-icon .bi { width: 13px; height: 13px; }
.uv-panes-ctl button { width: 19px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--uv-muted); font: 600 11.5px var(--uv-font); cursor: pointer; }
.uv-panes-ctl button:hover { background: var(--uv-accent-soft); color: var(--uv-accent); }
.uv-panes-ctl button.is-active { background: var(--uv-accent); color: #fff; }
.uv-zoombar { flex: none; display: inline-flex; align-items: center; gap: 1px; margin: 0 2px 0 0; padding: 1px 2px; border: 1px solid var(--uv-border); border-radius: 6px; background: var(--uv-panel); }
/* 2026-10-29: the direction of two panes, inside the panes group */
.uv-panes-dir { display: inline-flex; align-items: center; gap: 1px; margin-left: 3px; padding-left: 3px; border-left: 1px solid var(--uv-border); }
.uv-panes-dir[hidden] { display: none; }
.uv-panes-ctl .uv-panes-dir button { width: 21px; display: inline-grid; place-items: center; }
.uv-panes-dir .bi { width: 13px; height: 13px; }
.uv-zoombar .uv-zoom-btn { width: 24px; height: 22px; }
.uv-zoombar .uv-zoom-btn .bi { width: 14px; height: 14px; }
.uv-zoombar-val { min-width: 42px; padding: 0 2px; text-align: center; font: 600 11.5px var(--uv-font); color: var(--uv-muted); white-space: nowrap; }
.uv-zoombar-val.is-auto { color: var(--uv-accent); font-style: italic; }
.uv-zoombar .uv-zoom-reset { margin: 0 1px; padding: 1px 5px; font-size: 11px; }
.uv-zoombar .uv-zoom-btn.is-on { background: var(--uv-accent-soft); color: var(--uv-accent); border-color: var(--uv-accent); }

/* split panes: absolute rectangles set by layout.js; a head with the view of the pane; dividers; the active frame */
.uv-view-panes.is-split > .uv-view-pane { inset: auto; box-sizing: border-box; }
.uv-view-panes.is-split > .uv-view-pane:not([hidden]) { position: absolute; }
.uv-slot-head { position: absolute; z-index: 4; box-sizing: border-box; display: flex; align-items: center; gap: 6px; padding: 0 6px; background: var(--uv-bar); border-bottom: 1px solid var(--uv-border-soft); }
.uv-slot-num { display: inline-grid; place-items: center; min-width: 16px; height: 16px; border-radius: 4px; background: var(--uv-border-soft); color: var(--uv-muted); font: 700 10.5px var(--uv-font); }
.uv-slot-head.is-active .uv-slot-num { background: var(--uv-accent); color: #fff; }
.uv-slot-select { max-width: 100%; min-width: 0; height: 20px; padding: 0 4px; border: 1px solid var(--uv-border); border-radius: 5px; background: var(--uv-panel); color: var(--uv-text); font: 12px var(--uv-font); }
.uv-slot-divider { position: absolute; z-index: 5; background: var(--uv-border-soft); touch-action: none; }
.uv-slot-divider.is-x { cursor: col-resize; }
.uv-slot-divider.is-y { cursor: row-resize; }
.uv-slot-divider:hover, .uv-slot-divider:focus-visible { background: #c9d8ee; outline: none; }
.uv-slot-ring { position: absolute; z-index: 6; box-sizing: border-box; border: 1.5px solid var(--uv-accent); border-radius: 3px; pointer-events: none; }
.uv-view-tab .uv-tab-slot { display: inline-grid; place-items: center; min-width: 14px; height: 14px; margin-inline-start: 4px; border-radius: 3px; background: var(--uv-border-soft); color: var(--uv-muted); font: 700 10px var(--uv-font); }
.uv-view-tab.is-active .uv-tab-slot { background: var(--uv-accent); color: #fff; }
html[data-theme="dark"] .uv-slot-divider:hover, html[data-theme="dark"] .uv-slot-divider:focus-visible { background: #34425b; }
html[data-theme="dark"] .uv-slot-select { background: #202a3c; color: var(--uv-d-ink, #e2e8f3); border-color: #34425b; }

/* Classes & Objects (2026-10-28): the method list of a class part, folded by default (the box is laid out without it) */
.ov-msec { margin-top: 3px; }
.ov-ops-toggle { display: flex; align-items: center; gap: 4px; width: 100%; padding: 1px 2px; border: 0; border-top: 1px dashed var(--ov-layer-line); background: transparent; color: var(--uv-muted); font: italic 11.5px var(--uv-font); text-align: left; cursor: pointer; }
.ov-ops-toggle:hover { color: var(--uv-accent); background: var(--uv-accent-soft); }
.ov-ops-arrow { flex: none; width: 10px; font-style: normal; }
.ov-ops-cap { white-space: nowrap; }
.ov-ops-temp { flex: none; width: 7px; height: 7px; margin-inline-start: 2px; border-radius: 50%; background: var(--ov-run-line, #e59a0b); }
.ov-msec > .ov-methods { margin-top: 0; border-top: 0; }
.ov-msec.is-temp > .ov-methods { background: var(--uv-temp-bg); border-radius: 4px; }
html[data-theme="dark"] .ov-msec.is-temp > .ov-methods { background: #3a2a10; }
.ov-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.ov-check input { margin: 0; accent-color: var(--uv-accent); }

/* the settings of a view (owner request 2026-10-29, UVKit.settings): the trace table's button and popover, at the right
   end of the view's bar or head; the view's own zoom controls are hidden unless the viewer shows them (the pane gets
   uv-show-controls); they take no room when hidden and work as before when shown */
.uv-vset { margin-left: auto; }
.uv-vset .uv-tset { max-height: min(70vh, 420px); overflow: auto; }
.uv-vset-controls { padding-top: 7px !important; border-top: 1px solid var(--uv-border-soft) !important; }
.uv-view-pane:not(.uv-show-controls) :is(.uv-zoom-tools, .ov-zoom, .uv-flow-tools [data-flow-zoom], .uv-flow-zoom) { display: none !important; }
.uv-ds-bar { margin-bottom: 8px; }
.ov-bar { position: relative; z-index: 6; }
.ov-set { display: grid; gap: 6px; }
.uv-tset .ov-opt { display: flex; justify-content: space-between; gap: 10px; color: var(--uv-text); font-size: 12.5px; }
.uv-tset .ov-check { justify-content: flex-start; }
.uv-views-empty[hidden] { display: none; }

/* ------------------------------------------------------------------ 2D arrays: memory structure / table (2026-10-30) */
.uv-vset-matrix { padding-top: 7px !important; border-top: 1px solid var(--uv-border-soft) !important; }
.uv-vset-matrix[hidden] { display: none !important; }
/* the visual / data structures tabs: a C int a[R][C] as one contiguous block, row after row */
.uv-contig-cells { display: flex; flex-wrap: wrap; row-gap: 8px; align-items: flex-start; direction: ltr; }
.uv-contig-row { display: flex; flex-direction: column; padding: 0 6px; border-left: 2px dashed var(--uv-border); }
.uv-contig-row:first-child { border-left: 0; padding-left: 0; }
.uv-contig-head { font: 600 11.5px var(--uv-mono); color: var(--uv-faint); text-align: center; padding-bottom: 2px; white-space: nowrap; }
.uv-contig .uv-aidx { white-space: nowrap; }
/* by cell index: the rows of the one item one under the other, the row index at the start of each row */
.uv-contig.is-grid .uv-contig-cells { flex-direction: column; gap: 4px; }
.uv-contig.is-grid .uv-contig-row { flex-direction: row; align-items: center; gap: 6px; padding: 0; border-left: 0; }
.uv-contig.is-grid .uv-contig-head { min-width: 26px; padding-bottom: 0; }
.uv-contig-row-cells { display: flex; }
.uv-contig .uv-mcell { margin: 0 0 0 -1px; }
/* a table of an array of arrays: a position past a shorter row is not a cell; a null row */
.uv-mcell.is-absent { background: repeating-linear-gradient(45deg, transparent 0 5px, var(--uv-border) 5px 6px); border-style: dashed; }
.uv-mnull { min-height: 40px; display: flex; align-items: center; padding: 0 10px; border: 1px dashed #b8c6db; font: 13px var(--uv-mono); }
.uv-matrix th.uv-rhead.is-read { color: #3b6fc4; }
.uv-matrix th.uv-rhead.is-changed { color: #9a7400; }
/* Classes & Objects: the cells a step reads and writes (the marks of the visual tab), 2D layouts, members */
.ov-cell.is-read { background: #eef4ff; border-color: #8fb0e6; box-shadow: inset 0 0 0 2px #8fb0e6; }
.ov-cell.is-changed { background: var(--uv-changed); border-color: #e0b100; box-shadow: inset 0 0 0 2px #e0b100; }
html[data-theme="dark"] .ov-cell.is-read { background: #1d2c47; }
.ov-obj.is-array .ov-cells.ov-grid { flex-direction: column; flex-wrap: nowrap; }
.ov-obj.is-array .ov-cells.ov-contig { flex-wrap: wrap; gap: 6px 0; }
.ov-mrow { display: flex; flex-wrap: wrap; gap: 3px; }
/* a 2D block / int[,] box is as wide as its cells (up to a wide limit: a long run continues on the next line at a row
   boundary, a very long row at a cell) - no cell outside the frame, the text keeps its size */
.ov-obj.is-array.is-2d { max-width: 520px; }
.ov-contig .ov-mrow { padding: 0 5px; border-left: 2px dashed var(--ov-layer-line); }
.ov-contig .ov-mrow:first-child { padding-left: 0; border-left: 0; }
.ov-mtable { border-collapse: separate; border-spacing: 3px; direction: ltr; margin: -3px; }
.ov-mtable th { font: 600 10.5px var(--uv-mono); color: var(--uv-faint); text-align: center; padding: 0 2px; }
.ov-mtable th.is-read { color: #3b6fc4; }
.ov-mtable th.is-changed { color: #9a7400; }
.ov-mtable td { padding: 0; }
.ov-mtable .ov-cell { min-height: 24px; justify-content: center; }
.ov-cell.is-absent { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--ov-layer-line) 4px 5px); border-style: dashed; }
.ov-arr-prop { margin-top: 3px; }

/* ===================== v0.6.7: interface ===================== */
/* the Diagnostics tab of the I/O panel (the list itself keeps its v0.6.5 look) */
.uv-io-pane-diag .uv-diag { border-top: 0; }
.uv-diag-none { margin: 0; padding: 10px 12px; color: var(--uv-faint); font: 13px/1.5 var(--uv-font); }
/* "add view": a + icon, the first item on the right of the view row, always in the same place */
.uv-add-view-btn { justify-content: center; width: 26px; height: 24px; margin: 0 4px 0 6px; padding: 0; }
.uv-add-view-btn .bi { width: 16px; height: 16px; }
.uv-add-view .uv-menu { right: 0; }
/* the X of a visualization pane: physically top left (split panes: in the pane head; one pane: over the view area) */
.uv-pane-x {
    position: absolute; left: 3px; top: 50%; transform: translateY(-50%); z-index: 6;
    display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0;
    border: 0; border-radius: 4px; background: transparent; color: var(--uv-muted); cursor: pointer;
}
.uv-pane-x .bi { width: 12px; height: 12px; }
.uv-pane-x:hover { background: #dfe6f1; color: #b42318; }
.uv-pane-x:focus-visible { outline: 2px solid var(--uv-accent); outline-offset: 1px; }
.uv-slot-head { padding-left: 28px; }
/* one pane: a slim head row of its own (the X never covers the view's own tool bars) */
.uv-single-head { position: absolute; z-index: 4; top: 0; left: 0; right: 0; height: 22px; box-sizing: border-box; background: var(--uv-bar); border-bottom: 1px solid var(--uv-border-soft); }
.uv-view-panes.has-single-head > .uv-view-pane { top: 22px; }
.uv-pane-x-single { width: 18px; height: 18px; }
html[data-theme="dark"] .uv-pane-x:hover { background: #263248; color: #ff9b8f; }
/* the advanced editor settings: one more way to close the dialog, the X at the top left */
.uv-ed-x {
    position: absolute; top: 10px; left: 10px;
    display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
    border: 0; border-radius: 6px; background: transparent; color: #5b6577; cursor: pointer;
}
.uv-ed-x .bi { width: 14px; height: 14px; }
.uv-ed-x:hover { background: #eef2f8; color: #b42318; }
.uv-ed-x:focus-visible { outline: 2px solid #1d5fd1; outline-offset: 2px; }
.uv-ed-dialog-title { padding-left: 30px; }
html[data-theme="dark"] .uv-ed-x { color: var(--uv-d-ink); }
html[data-theme="dark"] .uv-ed-x:hover { background: #263248; color: #ff9b8f; }

/* ===================== v0.6.8: the library drawer as a tree (chapter -> topic -> example) ===================== */
/* scoped to the drawer (#uv-lib): the catalog and the examples editor share the .uv-lib-* classes and stay as they were */
#uv-lib .uv-lib-tools { display: flex; gap: 6px; margin: 0 12px 6px; }
#uv-lib .uv-lib-tool { flex: 1 1 0; height: 28px; padding: 0 10px; border: 1px solid #cdd8ea; border-radius: 6px; background: #f5f7fb; color: #183775; font: 600 13px/1 var(--uv-font); cursor: pointer; }
#uv-lib .uv-lib-tool:hover { background: #e9eff9; }
#uv-lib .uv-lib-tool:focus-visible, #uv-lib .uv-lib-thead:focus-visible { outline: 2px solid #1c5bb8; outline-offset: -2px; }
/* chapters: larger names, centred on their row, a compact head */
#uv-lib .uv-lib-ghead { min-height: 38px; padding: 4px 10px; align-items: center; }
#uv-lib .uv-lib-gname { font-size: 16px; line-height: 1.25; }
#uv-lib .uv-lib-gcount { flex: none; font-size: 12.5px; line-height: 1; white-space: nowrap; }
#uv-lib .uv-lib-gbody { padding: 0 4px 4px; }
/* topics: a head of their own (chevron, title, number of examples), clearly larger than before (11.5px) */
#uv-lib .uv-lib-thead { width: 100%; min-height: 32px; display: flex; align-items: center; gap: 6px; padding: 3px 8px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: start; }
#uv-lib .uv-lib-thead:hover { background: #f3f6fc; }
#uv-lib .uv-lib-topic-title { flex: 1 1 auto; min-width: 0; padding: 0; color: #24324d; font-size: 14.5px; font-weight: 700; line-height: 1.3; unicode-bidi: plaintext; text-align: start; }
#uv-lib .uv-lib-tcount { flex: none; min-width: 20px; padding: 1px 6px; border-radius: 9px; background: #eef2f8; color: #5d6b84; font: 600 11.5px/16px var(--uv-font); text-align: center; }
#uv-lib .uv-lib-thead .uv-lib-chev { flex: none; width: 13px; height: 13px; color: #6a7b98; }
#uv-lib .uv-lib-topic.is-collapsed .uv-lib-thead .uv-lib-chev { transform: rotate(90deg); }
html[data-ui-lang="en"] #uv-lib .uv-lib-topic.is-collapsed .uv-lib-thead .uv-lib-chev { transform: rotate(-90deg); }
#uv-lib .uv-lib-topic.is-collapsed .uv-lib-tbody { display: none; }
/* examples: indented under their topic */
#uv-lib .uv-lib-tbody { padding-inline-start: 18px; margin-bottom: 2px; }
#uv-lib .uv-lib-item { padding: 5px 8px; align-items: center; }
html[data-theme="dark"] #uv-lib .uv-lib-tool { background: #202a3c; color: #c9dbff; border-color: #34425b; }
html[data-theme="dark"] #uv-lib .uv-lib-tool:hover, html[data-theme="dark"] #uv-lib .uv-lib-thead:hover { background: #263248; }
html[data-theme="dark"] #uv-lib .uv-lib-topic-title { color: var(--uv-d-ink); }
html[data-theme="dark"] #uv-lib .uv-lib-tcount { background: #263248; color: var(--uv-muted); }
/* v0.7.2: the "core" / "extensions" parts of a chapter with extension topics (Data Structures) */
#uv-lib .uv-lib-part + .uv-lib-part { margin-top: 6px; padding-top: 4px; border-top: 1px dashed #cfd8e6; }
#uv-lib .uv-lib-part-title { padding: 4px 8px 2px; color: #5d6b84; font: 700 12px/1.3 var(--uv-font); letter-spacing: .02em; }
html[data-theme="dark"] #uv-lib .uv-lib-part + .uv-lib-part { border-top-color: #34425b; }
html[data-theme="dark"] #uv-lib .uv-lib-part-title { color: var(--uv-muted); }

/* ================================================================== v0.6.9: large views (BUG-SC-04 / BUG-SC-07)
   A folded range of calls (visual-calls.js) and of array elements in the Stack/Heap card (visual-memory.js) is one row
   with a count and buttons that open it; the bar above the card says how much is drawn. */
.uv-callfold-bar, .uv-memfold-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; padding: 4px 8px;
    border: 1px solid #c9d6ea; border-radius: 6px; background: #f5f8fd; color: #334155; font: 600 12px/18px var(--uv-font);
}
.uv-callfold {
    position: absolute; z-index: 1; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 0 10px;
    border: 1px dashed #94a3b8; border-radius: 8px; background: #f8fafc; color: #475569; font: 600 12px var(--uv-font); white-space: nowrap;
}
.uv-callfold-text, .uv-memfold-text { overflow: hidden; text-overflow: ellipsis; }
.uv-callfold-btn, .uv-memfold-btn {
    flex: none; padding: 1px 8px; border: 1px solid #9fb3d1; border-radius: 999px; background: #fff; color: #1d4f9c;
    font: 600 11.5px/18px var(--uv-font); cursor: pointer;
}
.uv-callfold-btn:hover, .uv-memfold-btn:hover { background: #e8f0fd; }
.uv-callfold-btn:focus-visible, .uv-memfold-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.uv-call-arrow.is-from-fold { stroke-dasharray: 3 3; }
.uv-memfold {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 2px 0; padding: 4px 8px;
    border: 1px dashed #94a3b8; border-radius: 6px; background: #f8fafc; color: #475569; font: 600 12px var(--uv-font);
}
.uv-memfold-find { width: 5.5em; padding: 1px 4px; border: 1px solid #9fb3d1; border-radius: 4px; font: 12px var(--uv-mono); }
html[data-theme="dark"] .uv-callfold-bar, html[data-theme="dark"] .uv-memfold-bar { background: #172031; border-color: var(--uv-d-line); color: var(--uv-d-ink); }
html[data-theme="dark"] .uv-callfold, html[data-theme="dark"] .uv-memfold { background: #141c2b; border-color: #50607a; color: #c9d4e6; }
html[data-theme="dark"] .uv-callfold-btn, html[data-theme="dark"] .uv-memfold-btn { background: #1d2c47; border-color: #50607a; color: #cfe0ff; }
html[data-theme="dark"] .uv-callfold-btn:hover, html[data-theme="dark"] .uv-memfold-btn:hover { background: #24375a; }
html[data-theme="dark"] .uv-memfold-find { background: #0f1522; border-color: #50607a; color: #e2e8f3; }

/* ------------------------------------------------------------------ v0.10.0 (B2): the breakpoint column of the editor
   A narrow column left of the line numbers (ui-src/code-editor.js): a red dot per breakpoint; a faint dot on a line no step of
   the run reaches (its title says why). The editor is LTR, so "left" is the start of the gutters. */
:root { --uv-bp: #d92d20; --uv-turbo: #c2410c; --uv-turbo-soft: #fff1e6; }
html[data-theme="dark"] { --uv-turbo: #fb923c; --uv-turbo-soft: #3a2414; }
html:is([data-theme="mixed"], [data-theme="dark"]) .uv-editor { --uv-bp: #f04438; }
.uv-editor .cm-editor .cm-gutter.cm-uv-bp-gutter { cursor: pointer; }
.uv-editor .cm-editor .cm-uv-bp-gutter .cm-gutterElement { width: 14px; padding: 0 0 0 2px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.uv-editor .cm-editor .cm-uv-bp-gutter .cm-gutterElement:hover { background: rgba(217, 45, 32, .08); }
.uv-editor .cm-editor .cm-uv-bp-gutter .cm-gutterElement.cm-uv-step-gutter { box-shadow: none; }
.uv-editor .cm-editor .cm-uv-bp-spacer { display: block; width: 10px; height: 10px; }
.uv-editor .cm-editor .cm-uv-bp { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--uv-bp); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.uv-editor .cm-editor .cm-uv-bp.is-faint { background: transparent; box-shadow: inset 0 0 0 1.5px var(--uv-bp); opacity: .55; }

/* ------------------------------------------------------------------ v0.10.0 (B3): turbo — the speedometer is a switch */
.uv-speed .uv-speed-icon {
    flex: none; display: inline-grid; place-items: center;
    width: 24px; height: 24px; padding: 0; margin: 0;
    border: 1px solid transparent; border-radius: 6px;
    background: transparent; color: var(--uv-muted); cursor: pointer;
}
.uv-speed .uv-speed-icon:hover { background: var(--uv-accent-soft); color: var(--uv-text); }
.uv-speed .uv-speed-icon:focus-visible { outline: 2px solid var(--uv-accent); outline-offset: 1px; }
.uv-speed.is-turbo .uv-speed-icon { background: var(--uv-turbo-soft); border-color: var(--uv-turbo); color: var(--uv-turbo); }
.uv-speed.is-turbo input { accent-color: var(--uv-turbo); }
.uv-speed.is-turbo { min-width: 128px; }   /* the rate ("2000/s") never overflows onto the step counter: the step text shrinks instead */
.uv-speed.is-turbo output { color: var(--uv-turbo); min-width: 44px; font-size: 12px; direction: ltr; unicode-bidi: isolate; }   /* "320/s", never "s/320" in an RTL row */
/* a narrow editor column keeps the switch (it is the only way to turbo); only the word "step" is hidden there */
@container (max-width: 370px) { .uv-speed .uv-speed-icon { display: inline-grid; width: 20px; } }
