#lumicode-tmce-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.72); z-index: 100000;
    backdrop-filter: blur(3px);
}
#lumicode-tmce-dialog {
    display: none; position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: 600px; max-width: calc(100vw - 32px);
    max-height: 92vh;
    flex-direction: column;
    background: #0f1117;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    box-shadow: 0 32px 96px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #e2e8f0; overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Header */
#lc-dlg-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px; height: 54px; flex-shrink: 0;
    background: rgba(0,0,0,0.32);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
#lc-dlg-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 700; color: #e2e8f0;
}
#lc-dlg-icon {
    width: 28px; height: 28px; border-radius: 7px;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #09090f;
}
#lumicode-tmce-close {
    width: 30px; height: 30px; border-radius: 7px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(148,163,184,0.7);
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
#lumicode-tmce-close:hover { background: rgba(255,255,255,0.13); color: #e2e8f0; }

/* Body */
#lc-dlg-body {
    padding: 18px; overflow-y: auto; flex: 1;
    display: flex; flex-direction: column; gap: 14px;
}
.lc-dlg-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lc-dlg-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.lc-dlg-field { display: flex; flex-direction: column; gap: 5px; }

.lc-dlg-field label {
    display: flex; align-items: center; gap: 0;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: rgba(148,163,184,0.55);
}
.lc-dlg-field label .opt {
    font-weight: 400; text-transform: none; letter-spacing: 0;
    color: rgba(148,163,184,0.32); font-size: 10px; margin-left: 5px;
}

/* All text inputs and selects share identical styling */
.lc-dlg-field select,
.lc-dlg-field input[type="text"],
.lc-dlg-field input[type="number"] {
    width: 100%; padding: 9px 12px;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 7px; color: #e2e8f0;
    font-size: 13px; outline: none; box-shadow: none;
    -webkit-appearance: none; appearance: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.lc-dlg-field input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.lc-dlg-field input[type="number"]::-webkit-inner-spin-button,
.lc-dlg-field input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.4;
}
.lc-dlg-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='rgba(148,163,184,0.4)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 30px; cursor: pointer;
}
.lc-dlg-field select option { background: #1a1d2e; color: #e2e8f0; }
.lc-dlg-field select optgroup { background: #1a1d2e; color: rgba(148,163,184,0.5); font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.lc-dlg-field select:focus,
.lc-dlg-field input:focus {
    border-color: rgba(167,139,250,0.55);
    box-shadow: 0 0 0 3px rgba(167,139,250,0.09);
    background: rgba(167,139,250,0.04);
}

/* Detect hint */
#lumicode-detect-hint {
    font-size: 11px; color: rgba(167,139,250,0.75); display: none;
}

/* Code textarea */
#lumicode-tmce-code {
    width: 100%; min-height: 220px; padding: 12px 14px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px; color: #cdd6f4;
    font-family: 'JetBrains Mono','Menlo','Monaco','Consolas',ui-monospace,monospace;
    font-size: 12.5px; line-height: 1.7;
    resize: vertical; outline: none; tab-size: 4;
    white-space: pre; overflow-x: auto; overflow-y: auto;
    word-wrap: normal;
}
#lumicode-tmce-code:focus { border-color: rgba(167,139,250,0.5); }

/* Tooltip on Highlight Lines label */
.lc-dlg-tip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(148,163,184,0.55);
    font-size: 9px; font-weight: 700;
    cursor: help; margin-left: 6px;
    position: relative; flex-shrink: 0;
    text-transform: none; letter-spacing: 0;
}
.lc-dlg-tip:hover .lc-dlg-tip-box,
.lc-dlg-tip:focus .lc-dlg-tip-box { display: block; }
.lc-dlg-tip-box {
    display: none;
    position: absolute;
    left: 50%; bottom: calc(100% + 8px); /* ← ABOVE the icon */
    transform: translateX(-50%);
    background: #1a1d2e;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px; padding: 12px 14px;
    font-size: 12px; line-height: 1.65;
    color: rgba(148,163,184,0.85);
    width: 230px; z-index: 100002;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    text-align: left; pointer-events: none;
    white-space: normal; text-transform: none; letter-spacing: 0; font-weight: 400;
}
.lc-dlg-tip-box code {
    font-family: ui-monospace, monospace; font-size: 11px;
    color: #a78bfa; background: rgba(167,139,250,0.1);
    padding: 1px 5px; border-radius: 3px;
}
.lc-dlg-tip-box strong { color: rgba(226,232,240,0.75); }

/* Checkbox row */
.lc-dlg-check {
    display: flex; align-items: center; gap: 9px; cursor: pointer;
    font-size: 13px; color: rgba(148,163,184,0.65);
    text-transform: none; letter-spacing: 0; font-weight: 400;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 7px;
    margin-top: 2px;
}
.lc-dlg-check:hover {
    background: rgba(255,255,255,0.06);
}
.lc-dlg-check input[type="checkbox"] {
    width: 15px; height: 15px; accent-color: #a78bfa;
    cursor: pointer; flex-shrink: 0;
}

/* Footer */
#lc-dlg-footer {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 10px; padding: 14px 18px; flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.25);
}
#lc-dlg-footer button {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: opacity 0.15s; line-height: 1;
}
#lumicode-tmce-insert {
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    color: #09090f; border: none;
}
#lumicode-tmce-insert:hover { opacity: 0.88; }
#lumicode-tmce-cancel {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(226,232,240,0.65);
}
#lumicode-tmce-cancel:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }

/* ── Light mode support ─────────────────────────────────── */
/*
 * When WP admin has #lc-wrap.lc-theme-light (or localStorage says light),
 * we apply .lc-dlg-light to the dialog + overlay for a consistent look.
 */
#lumicode-tmce-dialog.lc-dlg-light {
    background: #f4f5f9;
    border-color: rgba(0,0,0,0.10);
    color: #1e1e2e;
    box-shadow: 0 32px 96px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.07);
}
#lumicode-tmce-dialog.lc-dlg-light #lc-dlg-header {
    background: #fff;
    border-bottom-color: rgba(0,0,0,0.08);
}
#lumicode-tmce-dialog.lc-dlg-light #lc-dlg-brand { color: #1e1e2e; }
#lumicode-tmce-dialog.lc-dlg-light #lumicode-tmce-close {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.10);
    color: rgba(30,30,46,0.55);
}
#lumicode-tmce-dialog.lc-dlg-light #lumicode-tmce-close:hover {
    background: rgba(0,0,0,0.10);
    color: #1e1e2e;
}
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-field label {
    color: rgba(30,30,46,0.50);
}
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-field select,
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-field input[type="text"],
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-field input[type="number"] {
    background: #ffffff;
    border-color: rgba(0,0,0,0.14);
    color: #1e1e2e;
}
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-field select:focus,
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-field input:focus {
    border-color: rgba(124,58,237,0.45);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.08);
    background: rgba(124,58,237,0.02);
}
#lumicode-tmce-dialog.lc-dlg-light #lumicode-detect-hint { color: rgba(124,58,237,0.75); }
#lumicode-tmce-dialog.lc-dlg-light #lumicode-tmce-code {
    background: #fff;
    border-color: rgba(0,0,0,0.12);
    color: #1e1e2e;
}
#lumicode-tmce-dialog.lc-dlg-light #lumicode-tmce-code:focus {
    border-color: rgba(124,58,237,0.45);
}
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-check {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
    color: rgba(30,30,46,0.6);
}
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-check:hover {
    background: rgba(0,0,0,0.06);
}
#lumicode-tmce-dialog.lc-dlg-light #lc-dlg-footer {
    background: #fff;
    border-top-color: rgba(0,0,0,0.07);
}
#lumicode-tmce-dialog.lc-dlg-light #lumicode-tmce-cancel {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.12);
    color: rgba(30,30,46,0.6);
}
#lumicode-tmce-dialog.lc-dlg-light #lumicode-tmce-cancel:hover {
    background: rgba(0,0,0,0.09);
    color: #1e1e2e;
}
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-tip {
    background: rgba(0,0,0,0.08);
    border-color: rgba(0,0,0,0.14);
    color: rgba(30,30,46,0.5);
}
#lumicode-tmce-dialog.lc-dlg-light .lc-dlg-tip-box {
    background: #fff;
    border-color: rgba(0,0,0,0.10);
    color: rgba(30,30,46,0.75);
}
