/* BENTO IDE: the outline and code map beside the Python editor and the C tab (js/code-outline.js, owner 2026-10-30) */
.bo-row { display: flex; flex: 1; min-height: 0; min-width: 0; }
.bo-row > .bo-editor { flex: 1; min-width: 0; }
.bo-panel { --bo-ink: rgba(212, 212, 212, 0.38); position: relative; flex: none; display: flex; flex-direction: column; min-height: 0;
    /* the editor's own theme (--bg-code / --text-code), never the IDE's light panel surface (owner 18:0x: white beside a dark editor) */
    border-left: 1px solid rgba(255, 255, 255, 0.08); background: var(--bo-bg, var(--bg-code, #1e1e2d)); color: var(--bo-fg, var(--text-code, #d4d4d4)); font: 12px/1.4 var(--font-sans, sans-serif); }
.bo-panel.bo-closed { width: 24px; }
.bo-panel.bo-closed .bo-list, .bo-panel.bo-closed .bo-map, .bo-panel.bo-closed .bo-title, .bo-panel.bo-closed .bo-grip { display: none; }
.bo-grip { position: absolute; left: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; touch-action: none; z-index: 1; }
.bo-grip:hover { background: var(--tesa-primary, #7239ea); opacity: 0.5; }
.bo-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 4px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.bo-title { font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; }
.bo-toggle { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.bo-toggle:hover { background: rgba(127, 127, 127, 0.15); }
.bo-list { list-style: none; margin: 0; padding: 4px 0; overflow: auto; max-height: 45%; flex: none; }
.bo-item button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; cursor: pointer;
    padding: 2px 8px; font: 12px/1.5 var(--font-mono, monospace); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo-item button:hover { background: rgba(255, 255, 255, 0.06); color: #ffffff; }
.bo-item.bo-current button { background: rgba(114, 57, 234, 0.32); color: #ffffff; }
.bo-struct button, .bo-enum button, .bo-class button { color: #4ec9b0; }
.bo-define button { color: #c586c0; }
.bo-empty { padding: 6px 8px; opacity: 0.7; }
.bo-map { position: relative; flex: 1; min-height: 40px; border-top: 1px solid rgba(255, 255, 255, 0.08); cursor: pointer; touch-action: none; overflow: hidden; }
.bo-map canvas { position: absolute; left: 0; top: 0; }
.bo-box { position: absolute; left: 0; right: 0; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(114, 57, 234, 0.6); pointer-events: none; }

/* Code is shown exactly as typed: no ligatures (owner 2026-10-30: "ทำไมเครื่องหมายไม่เท่ากันเป็นแบบนี้ ≠ มันต้อง != ไม่ใช่เหรอ") */
.cm-editor, .cm-editor *, #codeOutput, .preview-code-container, .preview-code-container *, .terminal-output, .terminal-output *,
.ce-raw, .ce-raw *, .ce-problems, .ce-problems *, .ce-ex-code, pre, code {
    font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0;
}

/* "ประวัติ / History" (js/code-history.js): the button in the editor's header and its dialog */
.bh-btn { border: 1px solid var(--border-color, rgba(255,255,255,0.12)); background: transparent; color: inherit; cursor: pointer; border-radius: 4px; padding: 1px 8px; font: 12px/1.5 var(--font-sans, sans-serif); margin-left: 6px; }
.bh-btn:hover { background: rgba(127, 127, 127, 0.12); }
.bh-dialog { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; }
.bh-card { width: min(900px, calc(100vw - 32px)); height: min(600px, calc(100vh - 48px)); display: flex; flex-direction: column; background: var(--bg-code, #1e1e2d); color: var(--text-code, #d4d4d4); border-radius: 8px; overflow: hidden; font: 13px/1.5 var(--font-sans, sans-serif); }
.bh-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.1)); }
.bh-file { color: rgba(212, 212, 212, 0.6); font: 12px var(--font-mono, monospace); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-x { border: 0; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
.bh-body { flex: 1; display: flex; min-height: 0; }
.bh-list { list-style: none; margin: 0; padding: 6px 0; width: 260px; flex: none; overflow: auto; border-right: 1px solid var(--border-color, rgba(255,255,255,0.1)); }
.bh-item button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; padding: 5px 12px; cursor: pointer; font: inherit; }
.bh-item.bh-on button, .bh-item button:hover { background: rgba(114, 57, 234, 0.32); color: #ffffff; }
.bh-empty { padding: 10px 12px; color: rgba(212, 212, 212, 0.6); }
.bh-diff { flex: 1; margin: 0; padding: 10px 12px; overflow: auto; font: 12px/1.5 var(--font-mono, monospace); white-space: pre; }
.bh-add { color: #4ec9b0; } .bh-del { color: #f14c4c; text-decoration: line-through; } .bh-ctx { color: rgba(212, 212, 212, 0.6); } .bh-same { color: rgba(212, 212, 212, 0.6); }
.bh-actions { display: flex; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--border-color, rgba(255,255,255,0.1)); }
.bh-restore { background: var(--tesa-primary, #7239ea); color: #fff; border: 0; border-radius: 6px; padding: 6px 14px; cursor: pointer; font: inherit; }
.bh-restore:disabled { opacity: 0.5; cursor: not-allowed; }

/* THE CODE FONT (js/code-font.js; owner 2026-10-31): size and face for both editors' code, gutter and completion list */
#codeOutput .cm-scroller, #codeOutput .cm-content, #codeOutput .cm-gutters,
.ce-editor .cm-scroller, .ce-editor .cm-content, .ce-editor .cm-gutters,
.cm-tooltip-autocomplete > ul {
    font-family: var(--code-font-family, var(--font-mono, monospace)) !important;
    font-size: var(--code-font-size, 13px) !important;
}
.bf-font { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; font: 12px var(--font-sans, sans-serif); }
.bf-btn { min-width: 26px; height: 22px; padding: 0 5px; border: 1px solid rgba(128, 128, 140, 0.35); border-radius: 5px;
    background: transparent; color: inherit; font: 600 11px var(--font-sans, sans-serif); cursor: pointer; }
.bf-btn:hover:not(:disabled) { background: rgba(128, 128, 140, 0.15); }
.bf-btn:disabled { opacity: 0.4; cursor: default; }
.bf-size { min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; opacity: 0.85; }
.bf-face { height: 22px; margin-left: 4px; border: 1px solid rgba(128, 128, 140, 0.35); border-radius: 5px; background: transparent;
    color: inherit; font: 12px var(--font-sans, sans-serif); max-width: 140px; }
.bf-face option { color: #222; }

/* Compile and Run on Emulator in both editors' headers (js/run-buttons.js), beside the font control: the same look */
.bf-run { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font: 12px var(--font-sans, sans-serif); }
.bf-run-btn { padding: 0 10px; font-weight: 500; }
.bf-run-btn.is-off { opacity: .45; cursor: not-allowed; }
