/* ── Compile-failed status banner ────────────────────────────────────────── */
.compile-failed-banner {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: #7f1d1d;
    border-bottom: 2px solid #ef4444;
    padding: 0.38rem 0.8rem;
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
    user-select: none;
}

.compile-failed-banner-icon {
    font-size: 1rem;
    flex-shrink: 0;
    color: #fca5a5;
}

/* ── Inline advisory popup ───────────────────────────────────────────────── */
.asm-advisory-popup {
    position: fixed;
    z-index: 9999;
    max-width: 420px;
    min-width: 260px;
    background: #1c1610;
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-left: 4px solid #ef4444;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 6px 24px rgba(0,0,0,0.55);
    padding: 0.6rem 0.75rem 0.6rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    pointer-events: auto;
}

.asm-advisory-popup.is-warning {
    border-color: rgba(245, 158, 11, 0.45);
    border-left-color: #f59e0b;
}

.asm-advisory-popup-header {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.asm-advisory-popup-msg {
    font-family: 'Courier New', monospace;
    font-size: 0.77rem;
    color: #fca5a5;
    line-height: 1.4;
    flex: 1;
    word-break: break-word;
}

.asm-advisory-popup.is-warning .asm-advisory-popup-msg {
    color: #fde68a;
}

.asm-advisory-popup-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0 0 0.2rem;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: -1px;
}

.asm-advisory-popup-dismiss:hover { color: #fff; }

.asm-advisory-popup-sugg {
    margin-top: 0.1rem;
    padding: 0.4rem 0.55rem;
    background: rgba(251, 191, 36, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-left: 3px solid rgba(251, 191, 36, 0.6);
    border-radius: 0 4px 4px 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.asm-advisory-popup-sugg-title {
    font-family: system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fcd34d;
}

.asm-advisory-popup-sugg-body {
    font-family: system-ui, sans-serif;
    font-size: 0.7rem;
    color: #e5d3a0;
    line-height: 1.35;
}

.asm-advisory-popup-sugg-code {
    font-family: 'Courier New', monospace;
    font-size: 0.69rem;
    color: #86efac;
    background: rgba(0,0,0,0.35);
    padding: 0.25rem 0.4rem;
    border-radius: 3px;
    white-space: pre;
    overflow-x: auto;
    margin: 0;
}

.asm-advisory-popup-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.05rem;
}

.asm-advisory-popup-jump {
    background: none;
    border: none;
    color: #93c5fd;
    font-size: 0.72rem;
    font-family: system-ui, sans-serif;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.asm-advisory-popup-jump:hover { color: #bfdbfe; }

/* ── Sealed editor — read-only state after a clean compile ───────────────── */
#asmEditor.cm-editor-sealed {
    opacity: 0.72;
    background: #141414;
    cursor: not-allowed;
    border-color: var(--church-gold, #C89B3C);
}

/* ── Editor code name label (shown next to language dropdown) ────────────── */
.editor-code-name {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--church-gold, #C89B3C);
    opacity: 0.9;
    vertical-align: middle;
    padding: 0 4px;
    letter-spacing: 0.01em;
}
.editor-code-name:empty {
    display: none;
}

/* ── POLA-rewritten line gutter marker ───────────────────────────────────── */
#lineNumbers span.line-num-pola {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.18);
    border-radius: 2px;
    font-weight: 700;
    outline: 1px solid rgba(245, 158, 11, 0.35);
}

/* ── Error line gutter marker ────────────────────────────────────────────── */
#lineNumbers span.line-num-error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.22);
    border-radius: 2px;
    font-weight: 700;
    outline: 1px solid rgba(239, 68, 68, 0.4);
}

/* ── Error line body highlight overlay ──────────────────────────────────── */
.asm-error-overlay {
    position: absolute;
    left: calc(3.5rem + 1px);
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.asm-error-overlay-inner {
    position: relative;
    width: 100%;
}

.asm-error-line-bg {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(239, 68, 68, 0.13);
    border-left: 3px solid rgba(239, 68, 68, 0.5);
    box-sizing: border-box;
}

.asm-error-underline {
    position: absolute;
    height: 2px;
    background: #ef4444;
    border-radius: 1px;
    pointer-events: none;
}

/* ── Warning line number highlight ───────────────────────────────────────── */
#lineNumbers span.line-num-warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.22);
    border-radius: 2px;
    font-weight: 700;
    outline: 1px solid rgba(245, 158, 11, 0.4);
}

/* ── Warning line body highlight overlay ─────────────────────────────────── */
.asm-warning-overlay {
    position: absolute;
    left: calc(3.5rem + 1px);
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.asm-warning-overlay-inner {
    position: relative;
    width: 100%;
}

.asm-warning-line-bg {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(245, 158, 11, 0.10);
    border-left: 3px solid rgba(245, 158, 11, 0.45);
    box-sizing: border-box;
}

.asm-warning-underline {
    position: absolute;
    height: 2px;
    background: #f59e0b;
    border-radius: 1px;
    pointer-events: none;
}

/* ── Breakpoint button ───────────────────────────────────────────────────── */
.btn-break {
    background: #1c1a1a;
    border-color: #6b7280;
    color: #6b7280;
    font-size: 0.9rem;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-break:hover {
    background: #2d1a1a;
    border-color: #ef4444;
    color: #ef4444;
}
.btn-break.break-active {
    background: #2d1a1a;
    border-color: #ef4444;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* ── Edit toolbar button ─────────────────────────────────────────────────── */
.btn-edit {
    background: #1a2535;
    border-color: #38bdf8;
    color: #38bdf8;
    font-size: 1rem;
}
.btn-edit:hover { background: #1e3a5f; }

/* ── Patch toolbar button ────────────────────────────────────────────────── */
.btn-patch {
    background: #1a2535;
    border-color: #a78bfa;
    color: #a78bfa;
    font-size: 1rem;
}
.btn-patch:hover { background: #2a1f45; }

/* ── Breakpoint popover ──────────────────────────────────────────────────── */
.break-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.break-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: #1a1a2e;
    border: 1px solid rgba(239,68,68,0.35);
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.55);
    z-index: 9999;
    padding: 0.55rem 0.75rem 0.6rem;
}
.break-popover-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(239,68,68,0.55);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.break-close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.2rem;
    line-height: 1;
}
.break-close-btn:hover {
    color: #fff;
}
.break-list {
    min-height: 1.8rem;
    margin-bottom: 0.45rem;
}
.break-empty {
    font-size: 0.75rem;
    color: #4b5563;
    padding: 0.2rem 0;
}
.break-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.15rem 0;
}
.break-addr-label {
    font-size: 0.8rem;
    color: #fca5a5;
    font-family: var(--font-mono, monospace);
}
.break-remove-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 0.7rem;
    padding: 0 0.3rem;
    cursor: pointer;
    line-height: 1;
}
.break-remove-btn:hover { color: #ef4444; }
.break-add-row {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}
.break-addr-input {
    flex: 1;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 4px;
    color: #f9fafb;
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    padding: 0.2rem 0.45rem;
    outline: none;
}
.break-addr-input:focus { border-color: #ef4444; }
.break-clear-btn {
    width: 100%;
    font-size: 0.72rem;
}

/* ── Run popover ────────────────────────────────────────────────────────── */
.run-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.run-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: #1a1a2e;
    border: 1px solid rgba(74,222,128,0.35);
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.55);
    z-index: 9999;
    padding: 0.55rem 0.75rem 0.6rem;
}
.run-popover-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(74,222,128,0.65);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.run-close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.2rem;
    line-height: 1;
}
.run-close-btn:hover { color: #fff; }
.run-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.3rem;
}
.run-hint {
    font-size: 0.65rem;
    color: #6b7280;
}
.run-batch-select {
    width: 100%;
    background: #111827;
    color: var(--text-primary);
    border: 1px solid #374151;
    border-radius: 4px;
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}
.run-go-btn {
    width: 100%;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ── Breakpoint row in code view ─────────────────────────────────────────── */
.code-bp-row {
    background: rgba(239,68,68,0.08);
}
.code-bp-row td { color: #fca5a5 !important; }
.bp-dot {
    color: #ef4444;
    font-size: 0.65rem;
    vertical-align: middle;
    margin-right: 0.2rem;
}

.btn-walk {
    background: #4a1d96;
    border-color: #a78bfa;
    color: #a78bfa;
}

.btn-walk:hover { background: #5b21b6; }

.btn-lazy {
    background: #0f2a1a;
    border-color: #34d399;
    color: #34d399;
}

.btn-lazy:hover { background: #064e3b; }

/* ── Invoke Method button ──────────────────────────────────────────────────── */
.btn-invoke {
    background: #1e1030;
    border-color: #a78bfa;
    color: #a78bfa;
}
.btn-invoke:hover { background: #2e1a50; }

/* ── Watch strip ───────────────────────────────────────────────────────────── */
#watchStrip { min-height: 0; }
.watch-strip-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 6px 4px;
    border-bottom: 1px solid #2d2d3a;
    margin-bottom: 4px;
    align-items: center;
}
.watch-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #1a1a2e;
    border: 1px solid #3b3b55;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 0.72rem;
    line-height: 1.25;
    min-width: 96px;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}
.watch-chip-changed {
    border-color: #facc15;
    background: #29230a;
    animation: watch-flash 0.35s ease-out;
}
.watch-chip-return {
    border-color: #34d399;
    background: #0d2418;
}
@keyframes watch-flash {
    0%   { background: #453a0d; }
    100% { background: #29230a; }
}
.watch-chip-name {
    color: #818cf8;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.watch-chip-label {
    color: #9ca3af;
    font-size: 0.65rem;
    margin-top: 1px;
}
.watch-chip-val {
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    margin-top: 2px;
    letter-spacing: 0.04em;
}
.watch-chip-rm {
    position: absolute;
    top: 2px;
    right: 3px;
    background: none;
    border: none;
    color: #4b5563;
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.watch-chip:hover .watch-chip-rm { opacity: 1; }
.watch-chip-rm:hover { color: #f87171; }

.watch-add-btn {
    background: none;
    border: 1px dashed #3b3b55;
    color: #6b7280;
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 0.72rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}
.watch-add-btn:hover { border-color: #818cf8; color: #818cf8; }

/* ── Invoke Method dialog ──────────────────────────────────────────────────── */
.invoke-dialog { max-width: 460px; }

.invoke-hint {
    color: #9ca3af;
    font-size: 0.82rem;
    margin: 0 0 0.85rem;
    line-height: 1.45;
}

.invoke-params-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0.6rem 0;
    min-height: 32px;
}
.invoke-no-params {
    color: #6b7280;
    font-size: 0.82rem;
    font-style: italic;
}
.invoke-param-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.invoke-param-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 120px;
}
.invoke-param-name {
    color: #e2e8f0;
    font-size: 0.84rem;
    font-weight: 500;
}
.invoke-param-reg {
    color: #818cf8;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #1e1b4b;
    border-radius: 3px;
    padding: 1px 4px;
}
.invoke-param-input {
    flex: 1;
    background: #141420;
    border: 1px solid #3b3b55;
    border-radius: 4px;
    color: #e2e8f0;
    padding: 4px 7px;
    font-size: 0.84rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.invoke-param-input:focus {
    outline: none;
    border-color: #818cf8;
}

.btn-deploy {
    background: #1e3a5f;
    border-color: var(--church-blue);
    color: var(--church-blue);
}

.btn-deploy:hover {
    background: #264d73;
    border-color: #93bbfc;
    color: #93bbfc;
}

.editor-panel .panel-title {
    flex-shrink: 0;
    padding-top: 0.4rem;
}

#editorConsole {
    background: #0a0a1a;
    color: var(--church-green);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.4rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.4;
    flex: 1;
    min-height: 0;
}
#editorConsole.cmp-html {
    white-space: normal;
}
.cap-right-r { color: #60a5fa; font-weight: bold; cursor: help; }
.cap-right-w { color: #4ade80; font-weight: bold; cursor: help; }
.cap-right-x { color: #f97316; font-weight: bold; cursor: help; }
.cap-right-e { color: #fbbf24; font-weight: bold; cursor: help; }
.cmp-file-hdr {
    color: #6b7280;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}
.cmp-method {
    margin-bottom: 0.25rem;
    border-left: 2px solid #1e293b;
    padding-left: 0.4rem;
}
.cmp-method[open] {
    border-left-color: #334155;
}
.cmp-method-hdr {
    cursor: pointer;
    user-select: none;
    color: var(--church-green);
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    list-style: none;
    outline: none;
    padding: 0.15rem 0;
    white-space: nowrap;
}
.cmp-method-hdr::-webkit-details-marker { display: none; }
.cmp-method-hdr::marker { display: none; }
.cmp-method-hdr:hover { color: #86efac; }
.cmp-conv {
    color: #6b7280;
    font-size: 0.75rem;
}
.cmp-priv {
    color: #f97316;
    font-size: 0.7rem;
    border: 1px solid #f97316;
    border-radius: 3px;
    padding: 0 3px;
    vertical-align: middle;
    margin-right: 2px;
}
.cmp-method-alias {
    color: #4b5563;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 0.1rem 0 0.1rem 0.4rem;
    white-space: pre;
}
.cmp-body {
    margin: 0.1rem 0 0.2rem 1rem;
    padding: 0;
    color: #a3e6b8;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre;
    background: transparent;
    border: none;
}

.cmp-load-toolbar {
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #1e293b;
}
.cmp-load-sim-btn {
    background: transparent;
    border: 1px solid #22c55e;
    color: #22c55e;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.cmp-load-sim-btn:hover {
    background: rgba(34,197,94,0.12);
}
.cmp-load-sim-btn--done {
    border-color: #4b5563;
    color: #6b7280;
    cursor: default;
}
.cmp-load-sim-btn--done:hover {
    background: transparent;
}

.cmp-mtbl {
    margin-bottom: 0.6rem;
    border-left: 2px solid #1e293b;
    padding-left: 0.4rem;
}
.cmp-mtbl[open] {
    border-left-color: #334155;
}
.cmp-mtbl-hdr {
    cursor: pointer;
    user-select: none;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    list-style: none;
    outline: none;
    padding: 0.15rem 0;
}
.cmp-mtbl-hdr::-webkit-details-marker { display: none; }
.cmp-mtbl-hdr::marker { display: none; }
.cmp-mtbl-hdr:hover { color: #cbd5e1; }
.cmp-mtbl-body {
    margin: 0.1rem 0 0.2rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
}
.cmp-mtbl-word {
    white-space: pre;
}
.cmp-mtbl-addr {
    color: #6b7280;
}
.cmp-mtbl-hex {
    color: #64748b;
}
.cmp-mtbl-label {
    color: #4b5563;
}
.cmp-mtbl-idx {
    color: #4b5563;
}
.cmp-mtbl-word--pub .cmp-mtbl-name {
    color: var(--church-green);
}
.cmp-mtbl-word--priv .cmp-mtbl-name {
    color: #9ca3af;
}
.cmp-mtbl-arrow {
    color: #6b7280;
}

.next-steps-box {
    background: rgba(218,165,32,0.08);
    border: 1px solid rgba(218,165,32,0.25);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.next-steps-box:empty {
    display: none;
}

.next-steps-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
}

.next-steps-header:hover .next-steps-label {
    color: var(--church-gold);
}

.next-steps-arrow {
    font-size: 0.6rem;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.next-steps-header:hover .next-steps-arrow {
    color: var(--church-gold);
}

.led-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    background: #0a0a12;
    border-bottom: 1px solid #1e1e2e;
    flex-shrink: 0;
}
.led-strip-leds {
    display: flex;
    gap: 7px;
    align-items: flex-end;
}
.led-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.led {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #151520;
    border: 1px solid #2a2a40;
    transition: background 0.12s, box-shadow 0.12s;
}
.led.on {
    background: #e08820;
    border-color: #f0a030;
    box-shadow: 0 0 5px 2px rgba(240,160,30,0.55), 0 0 10px 3px rgba(240,160,30,0.25);
}
.led.boot-complete {
    background: #22cc66;
    border-color: #33ee77;
    box-shadow: 0 0 5px 2px rgba(40,220,100,0.55), 0 0 10px 3px rgba(40,220,100,0.25);
}
.led-lbl {
    font-size: 8px;
    color: #444;
    font-family: 'Courier New', monospace;
    line-height: 1;
}
.led-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.led-mode-tag {
    font-size: 9px;
    font-family: 'Courier New', monospace;
    background: #1a1a28;
    color: #888;
    border: 1px solid #2a2a40;
    border-radius: 3px;
    padding: 1px 5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.led-bits-display {
    font-size: 10px;
    font-family: 'Courier New', monospace;
    color: #888;
    white-space: nowrap;
}
.led-copy-btn {
    margin-left: auto;
    font-size: 9px;
    background: #1a1a28;
    color: #777;
    border: 1px solid #2a2a40;
    border-radius: 3px;
    padding: 2px 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, color 0.1s;
}
.led-copy-btn:hover {
    background: #252535;
    color: #bbb;
}

.led-dr0-readout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #0d1117;
    border-top: 1px solid #1e2a38;
    font-size: 0.76rem;
    flex-wrap: wrap;
    min-height: 26px;
}

.led-dr0-label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.led-index-chip {
    background: #1b2d45;
    color: var(--church-blue);
    border: 1px solid #2d4a6a;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-family: monospace;
    white-space: nowrap;
}

.dr0-badge {
    display: inline-block;
    border-radius: 4px;
    padding: 1px 7px;
    font-family: monospace;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.dr0-badge-green {
    background: rgba(74, 222, 128, 0.15);
    color: var(--church-green);
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.dr0-badge-grey {
    background: rgba(160, 160, 160, 0.12);
    color: var(--text-secondary);
    border: 1px solid rgba(160, 160, 160, 0.25);
}

.dr0-badge-red {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.dr0-badge-desc {
    color: var(--text-secondary);
    font-size: 0.73rem;
}

.abs-signed-return-section {
    border-left: 3px solid var(--church-blue);
}

.signed-return-chip {
    background: #2a2235;
    color: var(--church-purple, #c084fc);
    border: 1px solid #4a3b5a;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-family: monospace;
    white-space: nowrap;
}

.signed-return-chip-led {
    background: #1b2d45;
    color: var(--church-blue);
    border-color: #2d4a6a;
}

.abs-signed-return {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    flex-wrap: wrap;
}

.hw-led-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.35rem 0.75rem;
    background: #0d1520;
    border: 1px solid #1e2d3e;
    border-radius: 6px;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.hw-led-bar-inline {
    margin-bottom: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.hw-led-bar-panel {
    display: inline-flex;
    margin-bottom: 0.6rem;
    align-self: flex-start;
}

/* ── Assembly error panel ────────────────────────────────────────────────── */
.asm-error-panel {
    display: none;
    flex-direction: column;
    gap: 0.3rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-left: 4px solid #ef4444;
    border-radius: 0 6px 6px 0;
    padding: 0.55rem 0.8rem 0.55rem 0.75rem;
    margin: 0 0 0 0;
    flex-shrink: 0;
}

.asm-warn-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.55);
    border-radius: 4px;
    color: #f59e0b;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.2rem 0.45rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.asm-warning-panel {
    display: none;
    flex-direction: column;
    gap: 0.3rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.40);
    border-left: 4px solid #f59e0b;
    border-radius: 0 6px 6px 0;
    padding: 0.55rem 0.8rem 0.55rem 0.75rem;
    margin: 0 0 0 0;
    flex-shrink: 0;
}

.asm-warning-panel-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.asm-warning-panel-icon {
    color: #f59e0b;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.asm-warning-panel-title {
    color: #fcd34d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.asm-warning-panel-list {
    list-style: none;
    padding: 0;
    margin: 0.1rem 0 0 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.asm-warning-panel-list li {
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: #fde68a;
    line-height: 1.4;
}

.asm-warning-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: #fde68a;
    line-height: 1.4;
    cursor: pointer;
    border-radius: 3px;
    padding: 0.05rem 0.25rem;
    margin: 0 -0.25rem;
    transition: background 0.12s;
}

.asm-warning-item:hover {
    background: rgba(245, 158, 11, 0.18);
    color: #fef3c7;
}

.asm-warning-item-noline {
    display: block;
    padding: 0.3rem 0.5rem;
    color: #fde68a;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: default;
    user-select: text;
}

.asm-warning-line-label {
    color: #f59e0b;
    font-weight: 700;
    margin-right: 0.35rem;
}

.asm-error-panel-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.asm-error-panel-icon {
    color: #ef4444;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.asm-error-panel-title {
    color: #fca5a5;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.asm-error-panel-list {
    list-style: none;
    padding: 0;
    margin: 0.1rem 0 0 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.asm-error-panel-list li {
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: #fca5a5;
    line-height: 1.4;
}

.asm-error-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: #fca5a5;
    line-height: 1.4;
    cursor: pointer;
    border-radius: 3px;
    padding: 0.05rem 0.25rem;
    margin: 0 -0.25rem;
    transition: background 0.12s;
}

.asm-error-item:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.asm-error-item-noline {
    display: block;
    padding: 0.3rem 0.5rem;
    color: #fca5a5;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: default;
    user-select: text;
}

.asm-error-line {
    color: #f87171;
    font-weight: 700;
    margin-right: 0.35rem;
}

.asm-error-suggestion {
    margin: 0.3rem 0 0.45rem 0;
    padding: 0.5rem 0.65rem;
    background: rgba(251, 191, 36, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-left: 3px solid rgba(251, 191, 36, 0.7);
    border-radius: 0 4px 4px 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.aes-title {
    font-family: system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fcd34d;
    letter-spacing: 0.02em;
}

.aes-body {
    font-family: system-ui, sans-serif;
    font-size: 0.73rem;
    color: #e5d3a0;
    line-height: 1.45;
}

.aes-body strong { color: #fde68a; }
.aes-body code {
    font-family: 'Courier New', monospace;
    font-size: 0.71rem;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    padding: 0 0.25rem;
    color: #fde68a;
}

.aes-example {
    margin: 0.1rem 0 0;
    padding: 0.4rem 0.55rem;
    background: rgba(0,0,0,0.35);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.71rem;
    color: #a3d4a8;
    line-height: 1.55;
    white-space: pre;
    overflow-x: auto;
}

.asm-error-pick-btn {
    align-self: flex-start;
    margin-top: 0.3rem;
    padding: 0.22rem 0.6rem;
    font-family: system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--church-gold);
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.asm-error-pick-btn:hover {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.65);
}
.api-popup-method-row-pick {
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.12s;
}
.api-popup-method-row-pick:hover {
    background: rgba(251, 191, 36, 0.12);
}

.hw-led-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--church-gold);
    white-space: nowrap;
    margin-right: 0.25rem;
}

.preset-notice-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(56, 139, 253, 0.1);
    border: 1px solid rgba(56, 139, 253, 0.35);
    border-left: 3px solid #388bfd;
    border-radius: 0 6px 6px 0;
    margin-bottom: 0.3rem;
    flex-shrink: 0;
}

.preset-notice-icon {
    color: #60a5fa;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.preset-notice-text {
    font-size: 0.78rem;
    color: #93c5fd;
    line-height: 1.4;
}


/* ==================== ASM INSTRUCTION PICKER POPUP ==================== */

.asm-instr-picker {
    position: fixed;
    z-index: 9500;
    background: #12121f;
    border: 1px solid #f4b942;
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.7);
    width: 580px;
    max-height: 360px;
    display: none;
    flex-direction: column;
    animation: asmPickerIn 0.12s ease;
    overflow: hidden;
}

@keyframes asmPickerIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.asm-picker-header {
    padding: 5px 10px;
    color: #f4b942;
    font-size: 0.68rem;
    font-weight: 600;
    border-bottom: 1px solid #2a2a4a;
    white-space: nowrap;
    flex-shrink: 0;
}

.asm-picker-body {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
}

.asm-picker-group {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #2a2a4a;
    min-width: 0;
    flex-shrink: 0;
}

.asm-picker-group:last-child {
    border-right: none;
}

.asm-picker-group-label {
    padding: 3px 8px 2px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid #2a2a4a;
}

.asm-picker-item {
    padding: 4px 10px;
    font-size: 0.72rem;
    font-family: 'Courier New', Courier, monospace;
    color: #c9d1d9;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s ease;
}

.asm-picker-item:hover,
.asm-picker-item--active {
    background: rgba(244, 185, 66, 0.18);
    color: #fff;
}

.asm-picker-filter {
    margin: 4px 8px;
    padding: 3px 7px;
    background: rgba(255,255,255,0.06);
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    color: #c9d1d9;
    font-size: 0.72rem;
    font-family: 'Courier New', Courier, monospace;
    outline: none;
    flex-shrink: 0;
    width: calc(100% - 16px);
    box-sizing: border-box;
}

.asm-picker-filter:focus {
    border-color: #f4b942;
    background: rgba(244, 185, 66, 0.08);
}

.asm-picker-filter::placeholder {
    color: #555;
}

.asm-picker-body--flat {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

.asm-picker-empty {
    padding: 8px 12px;
    color: #666;
    font-size: 0.72rem;
    font-style: italic;
}

.asm-picker-match {
    color: #f4b942;
    font-weight: 700;
}

/* ── Instruction picker — category tabs ─────────────────────────────────── */
.asm-picker-tabs {
    display: flex;
    flex-direction: row;
    gap: 3px;
    padding: 4px 8px;
    border-bottom: 1px solid #2a2a4a;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.asm-picker-tabs::-webkit-scrollbar { display: none; }

.asm-picker-tab {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #555;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
    flex-shrink: 0;
    line-height: 1.5;
}
.asm-picker-tab:hover {
    color: #c9d1d9;
    border-color: #333;
    background: rgba(255,255,255,0.05);
}
.asm-picker-tab--active {
    color: #f4b942;
    border-color: rgba(244,185,66,0.45);
    background: rgba(244,185,66,0.1);
}

.asm-picker-toolbar {
    display: flex;
    align-items: center;
    padding: 2px 6px;
    background: rgba(244, 185, 66, 0.04);
    border-bottom: 1px solid #2a2a3a;
}

.btn-instr-picker {
    padding: 2px 8px;
    background: rgba(244, 185, 66, 0.1);
    border: 1px solid #f4b942;
    border-radius: 4px;
    color: #f4b942;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1.6;
}
.btn-instr-picker:hover {
    background: rgba(244, 185, 66, 0.26);
    color: #fff;
}

/* ── C-List tab — abstraction group headers ─────────────────────────────── */
.asm-picker-clist-hdr {
    padding: 4px 10px 2px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #f4b942;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(244, 185, 66, 0.07);
    border-top: 1px solid rgba(244, 185, 66, 0.18);
    border-bottom: 1px solid rgba(244, 185, 66, 0.10);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}
.asm-picker-clist-hdr:first-child {
    border-top: none;
}
/* LOAD rows inside C-List get a subtle left accent */
.asm-picker-body--flat .asm-picker-item[data-clist-load] {
    border-left: 2px solid rgba(244, 185, 66, 0.35);
    padding-left: 8px;
    color: #f4b942cc;
}
.asm-picker-body--flat .asm-picker-item[data-clist-load]:hover,
.asm-picker-body--flat .asm-picker-item[data-clist-load].asm-picker-item--active {
    color: #fff;
}

/* ── Method-name completion popup (asm-method-popup.js) ─────────────────── */
.asm-method-popup {
    position: fixed;
    z-index: 9600;
    background: #12121f;
    border: 1px solid #f4b942;
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.7);
    width: 420px;
    max-height: 220px;
    display: none;
    flex-direction: column;
    animation: asmPickerIn 0.12s ease;
    overflow: hidden;
}

.asm-method-popup-header {
    padding: 4px 10px;
    color: #f4b942;
    font-size: 0.65rem;
    font-weight: 600;
    border-bottom: 1px solid #2a2a4a;
    white-space: nowrap;
    flex-shrink: 0;
}

.asm-method-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.asm-method-popup-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.asm-method-popup-item:hover,
.asm-method-popup-item--active {
    background: rgba(244, 185, 66, 0.18);
}

.asm-method-popup-name {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.76rem;
    color: #e6c45a;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.asm-method-popup-index {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.asm-method-popup-desc {
    font-size: 0.68rem;
    color: #8899aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.asm-method-popup-sig {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    color: #9ab4d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    font-style: italic;
}

.asm-method-popup-perms {
    font-size: 0.60rem;
    font-weight: 700;
    color: #12121f;
    background: #f4b942;
    border-radius: 3px;
    padding: 1px 5px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}

/* ── Inline signature parameter hint (VS Code style) ─────────────────────── */
#asmSigHint,
.asm-sig-hint {
    position: fixed;
    z-index: 9650;
    display: none;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    background: #0e0e1c;
    border: 1px solid rgba(244, 185, 66, 0.55);
    border-radius: 5px;
    padding: 4px 10px 4px 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.65);
    font-size: 0.71rem;
    max-width: 640px;
    animation: asmPickerIn 0.10s ease;
    pointer-events: auto;
}

.asm-sig-hint-abs {
    font-family: 'Courier New', Courier, monospace;
    color: #c8a84b;
    font-weight: 700;
    font-size: 0.72rem;
}

.asm-sig-hint-dot {
    color: #f4b942;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
}

.asm-sig-hint-method {
    font-family: 'Courier New', Courier, monospace;
    color: #f0d070;
    font-weight: 700;
    font-size: 0.72rem;
}

.asm-sig-hint-sig {
    font-family: 'Courier New', Courier, monospace;
    color: #9ab4d0;
    font-size: 0.68rem;
    font-style: italic;
    margin-left: 2px;
}

.asm-sig-hint-perm-label {
    color: #556;
    font-size: 0.62rem;
    margin-left: 4px;
}

.asm-sig-hint-perm {
    font-size: 0.60rem;
    font-weight: 700;
    color: #12121f;
    background: #f4b942;
    border-radius: 3px;
    padding: 1px 5px;
    letter-spacing: 0.04em;
}

.asm-sig-hint-desc {
    color: #7a8a9a;
    font-size: 0.64rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    margin-left: 4px;
}

.asm-sig-hint-badge {
    font-size: 0.58rem;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 5px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.asm-sig-hint-badge--impl {
    background: rgba(80, 200, 120, 0.18);
    color: #50c878;
    border: 1px solid rgba(80, 200, 120, 0.4);
}

.asm-sig-hint-badge--planned {
    background: rgba(180, 100, 60, 0.18);
    color: #e0804a;
    border: 1px solid rgba(180, 100, 60, 0.4);
}

.asm-sig-hint-dismiss {
    margin-left: 6px;
    color: #445;
    cursor: pointer;
    font-size: 0.80rem;
    line-height: 1;
    flex-shrink: 0;
    padding: 0 2px;
    transition: color 0.1s ease;
}

.asm-sig-hint-dismiss:hover {
    color: #f4b942;
}

/* ── C-List Viewer button ─────────────────────────────────────────────────── */
.btn-clist-viewer {
    padding: 2px 8px;
    background: rgba(244, 185, 66, 0.1);
    border: 1px solid #f4b942;
    border-radius: 4px;
    color: #f4b942;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1.6;
    margin-left: 6px;
}
.btn-clist-viewer:hover {
    background: rgba(244, 185, 66, 0.26);
    color: #fff;
}
.btn-clist-viewer--active {
    background: rgba(244, 185, 66, 0.32);
    color: #fff;
    border-color: #f4b942;
}

/* ── C-List Viewer popup ─────────────────────────────────────────────────── */
.clist-viewer-popup {
    position: fixed;
    z-index: 9500;
    background: #12121f;
    border: 1px solid #f4b942;
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.7);
    width: 480px;
    max-height: 320px;
    display: none;
    flex-direction: column;
    animation: asmPickerIn 0.12s ease;
    overflow: hidden;
}

.clist-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border-bottom: 1px solid #2a2a4a;
    flex-shrink: 0;
}

.clist-viewer-title {
    color: #f4b942;
    font-size: 0.68rem;
    font-weight: 600;
}

.clist-viewer-hint {
    color: #555;
    font-size: 0.62rem;
}

.clist-viewer-body {
    overflow-y: auto;
    flex: 1;
}

.clist-viewer-empty {
    padding: 12px 14px;
    color: #666;
    font-size: 0.72rem;
    font-style: italic;
}

.clist-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.1s ease;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.clist-row:last-child {
    border-bottom: none;
}
.clist-row:hover,
.clist-row--focused {
    background: rgba(244, 185, 66, 0.12);
}
.clist-row--null {
    opacity: 0.4;
    cursor: default;
}
.clist-row--null:hover {
    background: none;
}

.clist-slot {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #f4b942;
    min-width: 30px;
    flex-shrink: 0;
}

.clist-perms {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.clist-perm-chip {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    padding: 1px 3px;
    border-radius: 3px;
    border: 1px solid #333;
    background: rgba(255,255,255,0.04);
    color: #444;
    line-height: 1.3;
}
.clist-perm-chip--on {
    /* colour applied inline per-perm */
}

.clist-b-badge,
.clist-f-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid #333;
    background: rgba(255,255,255,0.04);
    color: #444;
    flex-shrink: 0;
    cursor: help;
}
.clist-b-badge--on {
    background: rgba(244, 185, 66, 0.2);
    border-color: #f4b942;
    color: #f4b942;
}
.clist-f-badge--on {
    background: rgba(224, 155, 40, 0.2);
    border-color: #e09b28;
    color: #e09b28;
}

.clist-null-label {
    font-size: 0.68rem;
    color: #555;
    font-style: italic;
}

/* ── Pending GT slot (declared, not yet introduced to a live GT) ───────── */
.clist-row--pending {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(200, 130, 30, 0.07);
    border-left: 2px solid #b87820;
    opacity: 0.85;
    cursor: default;
}
.clist-row--pending:hover {
    background: rgba(200, 130, 30, 0.14);
}
.clist-pending-name {
    font-size: 0.72rem;
    color: #c98c30;
    font-style: italic;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.clist-pending-badge {
    font-size: 0.6rem;
    color: #7a5820;
    background: rgba(200, 130, 30, 0.18);
    border: 1px solid rgba(200, 130, 30, 0.35);
    border-radius: 3px;
    padding: 1px 5px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Named-slot badge: slot is in petNameMemory → LAZY_RESOLVE on NULL access ── */
.clist-named-badge {
    font-size: 0.57rem;
    font-weight: 700;
    color: #3ec9c9;
    background: rgba(62, 201, 201, 0.12);
    border: 1px solid rgba(62, 201, 201, 0.35);
    border-radius: 3px;
    padding: 1px 5px;
    flex-shrink: 0;
    white-space: nowrap;
    cursor: help;
    letter-spacing: 0.02em;
}
.clist-resolve-btn {
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(200, 130, 30, 0.45);
    background: rgba(200, 130, 30, 0.15);
    color: #d9a040;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1.4;
    margin-left: 2px;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.clist-resolve-btn:hover {
    background: rgba(200, 130, 30, 0.32);
    color: #f0b850;
    border-color: rgba(200, 130, 30, 0.7);
}
.clist-resolve-btn--disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: auto;
    border-color: rgba(140, 140, 140, 0.35);
    background: rgba(140, 140, 140, 0.08);
    color: #888;
}
.clist-resolve-btn--disabled:hover {
    background: rgba(140, 140, 140, 0.08);
    color: #888;
    border-color: rgba(140, 140, 140, 0.35);
}
.clist-resolve-btn--toast {
    opacity: 0.75;
    color: #c98c30;
    font-style: italic;
}
.clist-row--pending {
    cursor: pointer;
}
.clist-resolve-pending-label {
    font-size: 0.67rem;
    color: #c98c30;
    padding: 5px 10px 6px;
    font-style: italic;
    border-bottom: 1px solid rgba(200, 130, 30, 0.18);
    background: rgba(200, 130, 30, 0.05);
    flex-shrink: 0;
}
.clist-resolve-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.1s;
}
.clist-resolve-row:hover {
    background: rgba(91, 154, 239, 0.1);
}
.clist-resolve-ns-slot {
    font-size: 0.63rem;
    color: #6a8aba;
    background: rgba(91, 154, 239, 0.1);
    border: 1px solid rgba(91, 154, 239, 0.25);
    border-radius: 3px;
    padding: 1px 4px;
    flex-shrink: 0;
    font-family: monospace;
    min-width: 3.2em;
    text-align: center;
}
.clist-resolve-name {
    font-size: 0.75rem;
    color: #d4cbbf;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.clist-resolve-hint {
    font-size: 0.62rem;
    color: #5a5a6a;
    flex-shrink: 0;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Null row with a user-set pet name: full opacity, pointer cursor */
.clist-row--null.clist-row--named {
    opacity: 0.75;
    cursor: pointer;
}
.clist-row--null.clist-row--named:hover {
    background: rgba(244, 185, 66, 0.08);
}
/* Plain null row: show a subtle "⊕ name" hint only on hover */
.clist-null-hint {
    font-size: 0.6rem;
    color: #4a4a4a;
    margin-left: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}
.clist-row--null:hover .clist-null-hint {
    opacity: 1;
}
/* Plain null rows become pointer on hover so the affordance is obvious */
.clist-row--null:hover {
    cursor: pointer;
}
/* Label shown on named null rows */
.clist-null-pet {
    font-size: 0.72rem;
    color: #a09070;
    font-style: italic;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.clist-null-edit-hint {
    font-size: 0.6rem;
    color: #555;
    margin-left: 4px;
    flex-shrink: 0;
}
/* Inline pet-name input field inside a null row */
.clist-pet-name-input {
    flex: 1;
    min-width: 0;
    background: rgba(244, 185, 66, 0.08);
    border: 1px solid rgba(244, 185, 66, 0.45);
    border-radius: 3px;
    color: #f0ead0;
    font-size: 0.72rem;
    padding: 2px 6px;
    outline: none;
    font-family: inherit;
}

/* ── C-List viewer — Null slot form ─────────────────────────────────────── */
.clist-null-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px 12px;
}
.clist-null-form-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4a5568;
    margin-top: 4px;
}
.clist-null-form-label:first-child { margin-top: 0; }
.clist-perm-toggles {
    display: flex;
    gap: 5px;
}
.clist-perm-toggle {
    flex: 1;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    padding: 4px 2px;
    border-radius: 4px;
    border: 1px solid #333;
    background: rgba(255,255,255,0.04);
    color: #555;
    cursor: pointer;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.clist-perm-toggle[data-perm="R"].clist-perm-toggle--on { background: #5b9aef22; color: #5b9aef; border-color: #5b9aef66; }
.clist-perm-toggle[data-perm="W"].clist-perm-toggle--on { background: #e07b5422; color: #e07b54; border-color: #e07b5466; }
.clist-perm-toggle[data-perm="X"].clist-perm-toggle--on { background: #7ecb6122; color: #7ecb61; border-color: #7ecb6166; }
.clist-perm-toggle[data-perm="L"].clist-perm-toggle--on { background: #b87ee022; color: #b87ee0; border-color: #b87ee066; }
.clist-perm-toggle[data-perm="S"].clist-perm-toggle--on { background: #e0d25b22; color: #e0d25b; border-color: #e0d25b66; }
.clist-perm-toggle[data-perm="E"].clist-perm-toggle--on { background: #f4b94222; color: #f4b942; border-color: #f4b94266; }
.clist-perm-toggle:hover:not(.clist-perm-toggle--on) { background: rgba(255,255,255,0.08); color: #888; }
.clist-null-insert-btn {
    margin-top: 6px;
    background: rgba(244, 185, 66, 0.12);
    border: 1px solid rgba(244, 185, 66, 0.45);
    border-radius: 4px;
    color: #f4b942;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px;
    cursor: pointer;
    transition: background 0.12s;
}
.clist-null-insert-btn:hover { background: rgba(244, 185, 66, 0.24); }
/* NULL entry in picker */
.clist-picker-type--null {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(120,120,180,0.12);
    color: #9090c0;
    border: 1px solid rgba(120,120,180,0.3);
    flex-shrink: 0;
}
.clist-picker-row--null-slot {
    border-bottom: 1px solid #222;
}

/* ── C-List viewer — Add button ────────────────────────────────────────── */
.clist-add-btn {
    background: rgba(244, 185, 66, 0.1);
    border: 1px solid rgba(244, 185, 66, 0.35);
    border-radius: 3px;
    color: #f4b942;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    cursor: pointer;
    transition: background 0.12s;
    flex-shrink: 0;
    line-height: 1.6;
}
.clist-add-btn:hover {
    background: rgba(244, 185, 66, 0.24);
}

/* ── C-List viewer — GT Picker panel ────────────────────────────────────── */
.clist-back-btn {
    background: none;
    border: 1px solid #333;
    border-radius: 3px;
    color: #8892a4;
    font-size: 0.6rem;
    padding: 1px 6px;
    cursor: pointer;
    transition: color 0.12s;
    flex-shrink: 0;
    margin-right: 4px;
    line-height: 1.6;
}
.clist-back-btn:hover {
    color: #c9d1d9;
    border-color: #555;
}

.clist-picker-section-header {
    font-size: 0.59rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: #4a5568;
    text-transform: uppercase;
    padding: 6px 10px 3px;
    border-top: 1px solid #1a1a2e;
}
.clist-picker-section-header:first-child {
    border-top: none;
}

.clist-picker-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.1s ease;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.clist-picker-row:last-child { border-bottom: none; }
.clist-picker-row:hover,
.clist-picker-row.clist-row--focused {
    background: rgba(244, 185, 66, 0.09);
}

.clist-picker-type {
    font-size: 0.57rem;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid;
    flex-shrink: 0;
    min-width: 46px;
    text-align: center;
    line-height: 1.5;
}
.clist-picker-type--inform {
    color: #f4b942;
    border-color: rgba(244,185,66,0.4);
    background: rgba(244,185,66,0.1);
}
.clist-picker-type--abstract {
    color: #a78bfa;
    border-color: rgba(167,139,250,0.4);
    background: rgba(167,139,250,0.1);
}
.clist-picker-type--outform {
    color: #34d399;
    border-color: rgba(52,211,153,0.4);
    background: rgba(52,211,153,0.1);
}

.clist-picker-name {
    font-size: 0.72rem;
    color: #c9d1d9;
    font-family: 'Courier New', Courier, monospace;
    flex: 1;
}

.clist-picker-hint {
    font-size: 0.62rem;
    color: #4a5568;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Abstraction Wizard — New Abstraction button + modal
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-abswiz {
    padding: 2px 8px;
    background: rgba(100, 200, 120, 0.1);
    border: 1px solid #64c878;
    border-radius: 4px;
    color: #64c878;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1.6;
    margin-left: 6px;
}
.btn-abswiz:hover {
    background: rgba(100, 200, 120, 0.26);
    color: #fff;
}

/* Overlay */
.abswiz-overlay {
    position: fixed;
    inset: 0;
    z-index: 9600;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dialog */
.abswiz-dialog {
    background: #12121f;
    border: 1px solid #64c878;
    border-radius: 8px;
    width: min(580px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    overflow: hidden;
}

/* Header */
.abswiz-header {
    display: flex;
    align-items: center;
    padding: 10px 14px 8px;
    border-bottom: 1px solid #222;
    gap: 8px;
}
.abswiz-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #64c878;
    flex: 1;
}
.abswiz-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.abswiz-close:hover { color: #fff; }

/* Step indicator */
.abswiz-steps {
    display: flex;
    align-items: center;
    padding: 10px 16px 8px;
    gap: 0;
    border-bottom: 1px solid #1e1e2e;
}
.abswiz-step-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.abswiz-step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #333;
    background: #1a1a2e;
    color: #555;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.abswiz-step-dot--active {
    border-color: #64c878;
    background: rgba(100,200,120,0.15);
    color: #64c878;
}
.abswiz-step-dot--done {
    border-color: #64c878;
    background: #64c878;
    color: #111;
}
.abswiz-step-line {
    flex: 1;
    height: 2px;
    background: #2a2a3e;
    margin: 0 4px;
    margin-bottom: 14px;
}
.abswiz-step-line--done { background: #64c878; }
.abswiz-step-label {
    font-size: 0.6rem;
    color: #555;
    white-space: nowrap;
}
.abswiz-step-label--active { color: #64c878; font-weight: 700; }

/* Body */
.abswiz-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.abswiz-hint {
    font-size: 0.75rem;
    color: #888;
    line-height: 1.55;
    margin: 0;
}
.abswiz-hint code {
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.72rem;
    color: #f4b942;
}

/* Fields */
.abswiz-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.abswiz-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #aaa;
    letter-spacing: 0.02em;
}
.abswiz-input {
    background: #0d0d1a;
    border: 1px solid #2a2a3e;
    border-radius: 4px;
    color: #e6edf3;
    font-size: 0.8rem;
    padding: 5px 8px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}
.abswiz-input:focus { border-color: #64c878; }
.abswiz-input--error { border-color: #e05050 !important; }
.abswiz-textarea { resize: vertical; min-height: 48px; }

/* Methods table */
.abswiz-method-col-hdr {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 24px;
    gap: 4px;
    padding: 0 2px 2px;
    font-size: 0.63rem;
    color: #555;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.abswiz-method-table {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.abswiz-method-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 24px;
    gap: 4px;
    align-items: center;
}
.abswiz-input--method-name  { font-weight: 600; color: #64c878; }
.abswiz-input--method-params { color: #f4b942; }
.abswiz-input--method-doc   { color: #bbb; font-style: italic; }
.abswiz-method-del {
    background: none;
    border: none;
    color: #555;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    text-align: center;
}
.abswiz-method-del:hover { color: #e05050; }
.abswiz-btn--add-method {
    align-self: flex-start;
    margin-top: 4px;
    padding: 3px 10px;
    background: rgba(100,200,120,0.08);
    border: 1px dashed #64c878;
    border-radius: 4px;
    color: #64c878;
    font-size: 0.7rem;
    cursor: pointer;
}
.abswiz-btn--add-method:hover { background: rgba(100,200,120,0.18); }

/* Dependencies grid */
.abswiz-deps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
}
.abswiz-dep-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid #2a2a3e;
    border-radius: 5px;
    background: #0d0d1a;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.abswiz-dep-item input[type=checkbox] { display: none; }
.abswiz-dep-item--checked {
    border-color: #64c878;
    background: rgba(100,200,120,0.07);
}
.abswiz-dep-slot {
    font-size: 0.6rem;
    font-weight: 700;
    color: #555;
    background: #1a1a2e;
    border-radius: 3px;
    padding: 1px 4px;
    flex-shrink: 0;
}
.abswiz-dep-item--checked .abswiz-dep-slot {
    background: rgba(100,200,120,0.15);
    color: #64c878;
}
.abswiz-dep-name {
    font-size: 0.75rem;
    color: #bbb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.abswiz-dep-item--checked .abswiz-dep-name { color: #e6edf3; }

/* Footer */
.abswiz-footer {
    display: flex;
    align-items: center;
    padding: 10px 16px 12px;
    border-top: 1px solid #1e1e2e;
    gap: 8px;
}
.abswiz-btn {
    padding: 5px 14px;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.abswiz-btn--secondary {
    background: rgba(255,255,255,0.05);
    border-color: #333;
    color: #aaa;
}
.abswiz-btn--secondary:hover { background: rgba(255,255,255,0.1); color: #fff; }
.abswiz-btn--primary {
    background: rgba(100,200,120,0.15);
    border-color: #64c878;
    color: #64c878;
}
.abswiz-btn--primary:hover { background: rgba(100,200,120,0.3); color: #fff; }
.abswiz-btn--generate {
    background: #64c878;
    border-color: #64c878;
    color: #0d1a0f;
    font-weight: 700;
}
.abswiz-btn--generate:hover { background: #7edc90; }

/* Error message */
.abswiz-error {
    font-size: 0.73rem;
    color: #e05050;
    background: rgba(224,80,80,0.08);
    border: 1px solid rgba(224,80,80,0.3);
    border-radius: 4px;
    padding: 5px 10px;
}

/* ── Planned (custom) dependencies ─────────────────────────────────────────── */
.abswiz-custom-deps-divider {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #1e1e2e;
}
.abswiz-custom-deps-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #aaa;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.abswiz-custom-deps-sublabel {
    font-size: 0.65rem;
    color: #555;
    font-style: italic;
}
.abswiz-custom-deps-table {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.abswiz-custom-dep-col-hdr {
    display: grid;
    grid-template-columns: 1fr 1fr 24px;
    gap: 4px;
    padding: 0 2px 2px;
    font-size: 0.63rem;
    color: #555;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.abswiz-custom-dep-row {
    display: grid;
    grid-template-columns: 1fr 1fr 24px;
    gap: 4px;
    align-items: center;
}
.abswiz-input--custom-dep-name {
    font-weight: 600;
    color: #b0d8ff;
}
.abswiz-input--custom-dep-note {
    color: #888;
    font-style: italic;
}

.clist-name {
    font-size: 0.7rem;
    color: #c9d1d9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
