/* Simulador de código G y M */
.cncsim { background: var(--card, #fff); border: 1px solid var(--line, #cfdae6); border-radius: 8px; padding: 18px; margin: 26px 0; display: flex; flex-direction: column; gap: 14px; }
.cnc-head { display: flex; flex-direction: column; gap: 2px; }
.cnc-head strong { font-size: 1.1rem; color: var(--navy, #0b1f33); }
.cnc-head span { color: var(--muted, #4a5d70); font-size: .92rem; line-height: 1.5; }
.cnc-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cnc-bar select, .cnc-bar input { font: inherit; font-size: .92rem; padding: 8px 10px; border: 1px solid var(--line, #cfdae6); border-radius: 4px; background: #fff; color: var(--navy, #0b1f33); max-width: 100%; }
.cnc-bar button { font: inherit; font-weight: 600; font-size: .92rem; padding: 9px 14px; border-radius: 4px; border: 1px solid var(--navy, #0b1f33); background: var(--navy, #0b1f33); color: #fff; cursor: pointer; }
.cnc-bar button.ghost { background: transparent; color: var(--navy, #0b1f33); }
.cnc-bar button:focus-visible, .cnc-bar select:focus-visible, .cnc-bar input:focus-visible, .cnc-code:focus-visible { outline: 3px solid var(--accent, #e0731a); outline-offset: 2px; }
.cnc-td { font-size: .88rem; color: var(--navy, #0b1f33); display: inline-flex; gap: 6px; align-items: center; }
.cnc-td input { width: 4.5em; }
.cnc-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .cnc-grid { grid-template-columns: minmax(0, 1fr); } }
.cnc-left, .cnc-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cnc-tabs { display: flex; gap: 4px; }
.cnc-tab { font: inherit; font-size: .9rem; font-weight: 600; padding: 7px 14px; border: 1px solid var(--line, #cfdae6); border-bottom: 0; border-radius: 6px 6px 0 0; background: #f3f6f9; color: var(--muted, #4a5d70); cursor: pointer; }
.cnc-tab.on { background: #0b1f33; color: #fff; border-color: #0b1f33; }
.cnc-code { width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; padding: 10px 12px; border: 1px solid #0b1f33; border-radius: 0 6px 6px 6px; background: #0f2a43; color: #e8f1fa; resize: vertical; min-height: 280px; tab-size: 4; white-space: pre; overflow: auto; }
.cnc-list { list-style: none; margin: 0; padding: 6px 0; height: 340px; overflow: auto; border: 1px solid #0b1f33; border-radius: 0 6px 6px 6px; background: #0f2a43; counter-reset: ln; }
.cnc-list[hidden], .cnc-code[hidden] { display: none; }
.cnc-line { counter-increment: ln; display: block; padding: 1px 10px 1px 0; color: #cfe0f0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; white-space: pre; }
.cnc-line::before { content: counter(ln); display: inline-block; width: 2.6em; margin-right: 10px; text-align: right; color: #6f8aa4; }
.cnc-line code { font: inherit; background: none; padding: 0; color: inherit; }
.cnc-line.on { background: #e0731a; color: #fff; }
.cnc-line.on::before { color: #ffe3cc; }
.cnc-line.error { background: rgba(185, 28, 28, .45); }
.cnc-line.comment code, .cnc-line.mark code { color: #8fb0cf; }
.cnc-expl { margin: 0; min-height: 3em; padding: 10px 12px; border-left: 4px solid var(--accent, #e0731a); background: #fff7ef; border-radius: 4px; font-size: .92rem; line-height: 1.55; color: var(--navy, #0b1f33); }
.cnc-canvas { display: block; max-width: 100%; border: 1px solid var(--line-soft, #e1e8ef); border-radius: 6px; background: #fff; }
.cnc-stat { display: flex; flex-wrap: wrap; gap: 6px; }
.cnc-pill { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 9px; border: 1px solid var(--line, #cfdae6); border-radius: 999px; font-size: .8rem; background: #fff; color: var(--navy, #0b1f33); }
.cnc-pill i { font-style: normal; color: var(--muted, #4a5d70); }
.cnc-pill b { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }
.cnc-pill.on { border-color: #15803d; background: #effaf2; }
.cnc-pill.off { border-color: #e1b4b4; background: #fdf3f3; }
.cnc-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cnc-msg { padding: 8px 10px; border-radius: 4px; font-size: .88rem; line-height: 1.45; background: #f3f6f9; color: var(--navy, #0b1f33); }
.cnc-msg.error { background: #fdecec; color: #721c24; font-weight: 600; }
.cnc-msg.warn { background: #fff6e0; color: #6b4b00; }
.cnc-msg.ok { background: #effaf2; color: #155724; }
.cnc-note { font-size: .82rem; color: var(--muted, #4a5d70); margin: 0; line-height: 1.5; }
