/* ============================================================================
   Rule Engine — Light, premium design system
   Inspired by Vercel/Linear/Stripe: achromatic surfaces, shadow-as-border,
   single accent, refined typography, subtle motion.
   ============================================================================ */

:root {
    --re-bg:            #f8fafc;
    --re-surface:       #ffffff;
    --re-surface-2:     #f1f5f9;
    --re-surface-3:     #e2e8f0;
    --re-ink:           #0f172a;
    --re-ink-2:         #475569;
    --re-ink-3:         #94a3b8;
    --re-border:        rgb(15 23 42 / 0.08);
    --re-border-strong: rgb(15 23 42 / 0.14);
    --re-accent:        #2563eb;
    --re-accent-hover:  #1d4ed8;
    --re-accent-soft:   rgb(37 99 235 / 0.08);
    --re-shadow-b:      inset 0 0 0 1px var(--re-border);
    --re-shadow-focus:  0 0 0 2px #ffffff, 0 0 0 4px var(--re-accent);
    --re-ease:          cubic-bezier(.175, .885, .32, 1.1);
    --re-ease-out:      cubic-bezier(.16, 1, .3, 1);
}

/* ----------------------------------------------------------------------------
   Schema explorer — tree behaviour & chevrons
   ---------------------------------------------------------------------------- */
.db-toggle .db-chevron        { transform: rotate(-90deg); transition: transform .2s var(--re-ease); }
.db-toggle.open .db-chevron   { transform: rotate(0deg); }
.table-toggle .table-chevron  { transition: transform .2s var(--re-ease); }
.table-toggle.open .table-chevron { transform: rotate(90deg); }

.schema-db { transition: box-shadow .2s var(--re-ease); }
.schema-db:hover { box-shadow: 0 0 0 1px var(--re-border-strong), 0 1px 2px rgb(15 23 42 / 0.04); }

.col-pill {
    position: relative;
    transition: background-color .15s var(--re-ease), color .15s var(--re-ease), transform .15s var(--re-ease);
}
.col-pill:hover  { transform: translateX(1px); }
.col-pill:active { transform: translateX(0); }

.col-pill::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 0 0 1px rgb(37 99 235 / 0.25);
    transition: opacity .15s var(--re-ease);
}
.col-pill:focus-visible::after { opacity: 1; }
.col-pill:focus-visible        { outline: none; }

/* Explorer tabs — active vs inactive states managed via JS. */
.explorer-tab.active {
    color: var(--re-ink);
    background: var(--re-surface-2);
}

/* ----------------------------------------------------------------------------
   List cards — Constants & Functions
   ---------------------------------------------------------------------------- */
.list-card {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--re-shadow-b);
    color: var(--re-ink);
    font-size: 12.5px;
    cursor: grab;
    transition: background-color .15s var(--re-ease), transform .15s var(--re-ease), box-shadow .15s var(--re-ease);
}
.list-card:hover {
    background: var(--re-surface-2);
    box-shadow: inset 0 0 0 1px var(--re-border-strong), 0 1px 2px rgb(15 23 42 / 0.04);
    transform: translateY(-0.5px);
}
.list-card:active   { cursor: grabbing; transform: translateY(0); }
.list-card .ico {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--re-surface-2);
    color: var(--re-ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.list-card .ico.amber  { background: #fef3c7; color: #b45309; }
.list-card .ico.emerald{ background: #d1fae5; color: #047857; }
.list-card .ico.sky    { background: #e0f2fe; color: #0369a1; }
.list-card .ico.indigo { background: #e0e7ff; color: #4338ca; }
.list-card .ico.rose   { background: #ffe4e6; color: #be123c; }
.list-card .ico.fuchsia{ background: #fae8ff; color: #a21caf; }
.list-card .ico.violet { background: #ede9fe; color: #6d28d9; }
.list-card .ico.cyan   { background: #cffafe; color: #0e7490; }
.list-card .ico.slate  { background: var(--re-surface-2); color: var(--re-ink-2); }
.list-card .name {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--re-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-card .sub  {
    font-size: 10px;
    color: var(--re-ink-2);
    font-family: 'JetBrains Mono', Consolas, monospace;
    margin-left: 4px;
    flex-shrink: 0;
}
.list-card .actions {
    margin-left: auto;
    display: inline-flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s var(--re-ease);
}
.list-card:hover .actions { opacity: 1; }
.list-card .actions button {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: transparent;
    color: var(--re-ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background-color .12s var(--re-ease), color .12s var(--re-ease);
}
.list-card .actions button:hover {
    background: var(--re-surface-3);
    color: var(--re-ink);
}
.list-card .actions button.del:hover { color: #dc2626; background: #fee2e2; }
.list-card.builtin .actions { display: none; }

/* ----------------------------------------------------------------------------
   Quick-insert chips
   ---------------------------------------------------------------------------- */
.chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: var(--re-shadow-b);
    color: var(--re-ink-2);
    font-size: 11.5px;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-weight: 500;
    transition: background-color .15s var(--re-ease), color .15s var(--re-ease), transform .12s var(--re-ease), box-shadow .15s var(--re-ease);
    cursor: pointer;
}
.chip:hover {
    background: var(--re-accent);
    color: #ffffff;
    box-shadow: 0 1px 2px rgb(37 99 235 / 0.2), inset 0 0 0 1px rgb(37 99 235 / 0.4);
    transform: translateY(-1px);
}
.chip:active { transform: translateY(0); }

/* ----------------------------------------------------------------------------
   CodeMirror — light theme
   ---------------------------------------------------------------------------- */
.CodeMirror {
    height: 100% !important;
    font-family: 'JetBrains Mono', Consolas, monospace !important;
    font-size: 13px !important;
    font-feature-settings: 'liga' 0;
    background: transparent !important;
    color: var(--re-ink) !important;
    padding: 8px 0;
}
.CodeMirror-gutters {
    background: transparent !important;
    border-right: 1px solid var(--re-border) !important;
    width: 36px !important;
}
.CodeMirror-linenumber {
    color: var(--re-ink-3) !important;
    font-size: 11px !important;
    padding: 0 8px 0 0 !important;
}
.CodeMirror-cursor { border-left: 2px solid var(--re-accent) !important; }
.CodeMirror-selected,
.CodeMirror-focused .CodeMirror-selected,
.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection { background: rgb(37 99 235 / 0.14) !important; }
/* DMS rule DSL token colours — see defineDmsRuleMode() in rule-engine.js
   Palette is tuned for the light surface (#ffffff) used by the editor canvas. */
.cm-s-default .cm-comment     { color: #94a3b8 !important; font-style: italic; }
.cm-s-default .cm-keyword     { color: #6d28d9 !important; font-weight: 600; letter-spacing: 0.005em; }
.cm-s-default .cm-atom        { color: #be123c !important; font-weight: 500; }
.cm-s-default .cm-number      { color: #b45309 !important; }
.cm-s-default .cm-string      { color: #047857 !important; }
.cm-s-default .cm-def         { color: var(--re-accent) !important; font-weight: 600; }
.cm-s-default .cm-variable-2  { color: #c2410c !important; font-weight: 500; }
.cm-s-default .cm-variable-3  { color: #0f172a !important; font-weight: 500; }
.cm-s-default .cm-property    { color: #0369a1 !important; }
.cm-s-default .cm-variable    { color: var(--re-ink) !important; }
.cm-s-default .cm-operator    { color: #64748b !important; }
.cm-s-default .cm-bracket     { color: #475569 !important; }
.cm-s-default .cm-punctuation { color: #94a3b8 !important; }
.cm-s-default .CodeMirror-matchingbracket {
    color: var(--re-accent) !important;
    background: rgb(37 99 235 / 0.08);
    border-radius: 2px;
}
.CodeMirror-activeline-background { background: rgb(15 23 42 / 0.025) !important; }
.CodeMirror-focused { outline: none; }

/* Dropzone drag state */
#editor-dropzone.drop-active #drop-overlay {
    display: flex !important;
    animation: dropPulse .8s var(--re-ease) infinite;
}
@keyframes dropPulse {
    0%, 100% { background-color: rgb(219 234 254 / 0.7); }
    50%      { background-color: rgb(219 234 254 / 0.95); }
}
.CodeMirror.CodeMirror-focused ~ #drop-overlay { /* fallback */ }

/* ----------------------------------------------------------------------------
   Output chips — toolbar
   ---------------------------------------------------------------------------- */
.output-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 6px 0 8px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: var(--re-shadow-b);
    color: var(--re-ink);
    font-size: 11.5px;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s var(--re-ease), box-shadow .15s var(--re-ease), transform .12s var(--re-ease);
}
.output-chip:hover {
    background: var(--re-surface);
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.06), inset 0 0 0 1px var(--re-border-strong);
    transform: translateY(-1px);
}
.output-chip.active {
    background: var(--re-accent-soft);
    color: var(--re-accent);
    box-shadow: inset 0 0 0 1px rgb(37 99 235 / 0.3);
}
.output-chip .dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    display: inline-block;
}
.output-chip .type-pill {
    display: inline-flex;
    align-items: center;
    height: 14px;
    padding: 0 5px;
    border-radius: 3px;
    background: var(--re-surface-2);
    color: var(--re-ink-2);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Decision card emphasis colours — matches JS-applied is-pass/is-fail/is-numeric */
#output-card.is-pass {
    background: linear-gradient(180deg, #ecfdf5, #ffffff);
    box-shadow: 0 1px 3px 0 rgb(15 23 42 / 0.04), inset 0 0 0 1px rgb(16 185 129 / 0.25);
}
#output-card.is-pass #output-value { color: #047857; }
#output-card.is-fail {
    background: linear-gradient(180deg, #fef2f2, #ffffff);
    box-shadow: 0 1px 3px 0 rgb(15 23 42 / 0.04), inset 0 0 0 1px rgb(244 63 94 / 0.25);
}
#output-card.is-fail #output-value { color: #be123c; }
#output-card.is-numeric {
    background: linear-gradient(180deg, #eff6ff, #ffffff);
    box-shadow: 0 1px 3px 0 rgb(15 23 42 / 0.04), inset 0 0 0 1px rgb(37 99 235 / 0.25);
}
#output-card.is-numeric #output-value { color: var(--re-accent); }

/* ----------------------------------------------------------------------------
   Input/output variable rows (rendered by JS)
   ---------------------------------------------------------------------------- */
.var-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--re-shadow-b);
    font-size: 11.5px;
    animation: varRowIn .25s var(--re-ease) both;
}
.var-row .name {
    font-family: 'JetBrains Mono', Consolas, monospace;
    color: var(--re-ink-2);
    font-size: 11px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.var-row .val {
    font-family: 'JetBrains Mono', Consolas, monospace;
    color: var(--re-ink);
    font-size: 11.5px;
    margin-left: auto;
    font-weight: 500;
    text-align: right;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.var-row .type {
    display: inline-flex;
    align-items: center;
    height: 15px;
    padding: 0 5px;
    border-radius: 3px;
    background: var(--re-surface-2);
    color: var(--re-ink-2);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-left: auto;
}
.var-row .type + .val { margin-left: 6px; }
.var-row.var-row--constant {
    background: #fffbeb;
    box-shadow: inset 0 0 0 1px rgb(245 158 11 / 0.25);
}
.var-row.var-row--constant .name { color: #b45309; }
.var-row.var-row--function {
    background: #ecfdf5;
    box-shadow: inset 0 0 0 1px rgb(16 185 129 / 0.25);
}
.var-row.var-row--function .name { color: #047857; }
@keyframes varRowIn {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Process timeline — JS adds <li class="timeline-step active|ok|error"> */
#process-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 0 6px;
    border-left: 1px solid var(--re-border);
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#process-steps li.timeline-step {
    position: relative;
    animation: stepIn .3s var(--re-ease) both;
}
#process-steps li.timeline-step::before {
    content: '';
    position: absolute;
    left: -17px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 0 0 1px var(--re-border-strong);
    transition: box-shadow .2s var(--re-ease);
}
#process-steps li.timeline-step.active::before {
    box-shadow: 0 0 0 1px var(--re-accent), inset 0 0 0 2px var(--re-accent);
    animation: pulseDot 1.2s var(--re-ease) infinite;
}
#process-steps li.timeline-step.ok::before    { box-shadow: 0 0 0 1px #10b981, inset 0 0 0 2px #10b981; }
#process-steps li.timeline-step.error::before { box-shadow: 0 0 0 1px #f43f5e, inset 0 0 0 2px #f43f5e; }
#process-steps li.timeline-step .step-title {
    font-size: 12px;
    color: var(--re-ink);
    font-weight: 500;
}
#process-steps li.timeline-step .step-detail {
    font-size: 10.5px;
    color: var(--re-ink-2);
    font-family: 'JetBrains Mono', Consolas, monospace;
    margin-top: 1px;
    word-break: break-word;
}
@keyframes stepIn {
    from { opacity: 0; transform: translateX(4px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 1px var(--re-accent), inset 0 0 0 2px var(--re-accent); }
    50%      { box-shadow: 0 0 0 1px var(--re-accent), inset 0 0 0 2px var(--re-accent), 0 0 0 4px rgb(37 99 235 / 0.18); }
}

/* ----------------------------------------------------------------------------
   Output view toggle
   ---------------------------------------------------------------------------- */
.output-view {
    color: var(--re-ink-2);
    transition: background-color .12s var(--re-ease), color .12s var(--re-ease);
}
.output-view.active {
    background: #ffffff;
    color: var(--re-ink);
    box-shadow: 0 0 0 1px var(--re-border), 0 1px 2px rgb(15 23 42 / 0.04);
}

/* ----------------------------------------------------------------------------
   Stage tabs (segmented control)
   ---------------------------------------------------------------------------- */
.stage-tab.active {
    color: var(--re-ink);
    background: #ffffff;
    box-shadow: 0 0 0 1px var(--re-border), 0 1px 2px rgb(15 23 42 / 0.04);
}

/* ----------------------------------------------------------------------------
   Forms (modals & popover)
   ---------------------------------------------------------------------------- */
.form-label {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--re-ink-2);
    font-weight: 600;
    margin-bottom: 4px;
}
.form-hint {
    font-size: 10.5px;
    color: var(--re-ink-3);
    margin-top: 4px;
}
.form-input {
    width: 100%;
    background: #ffffff;
    box-shadow: var(--re-shadow-b);
    color: var(--re-ink);
    font-size: 13px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    transition: box-shadow .15s var(--re-ease), background-color .15s var(--re-ease);
}
.form-input:hover { background: var(--re-surface-2); }
.form-input:focus {
    outline: none;
    background: #ffffff;
    box-shadow: var(--re-shadow-focus);
}
textarea.form-input {
    height: auto;
    padding: 10px;
    line-height: 1.55;
    resize: vertical;
}

.icon-swatch {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--re-surface-2);
    color: var(--re-ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background-color .15s var(--re-ease), color .15s var(--re-ease), transform .12s var(--re-ease), box-shadow .15s var(--re-ease);
}
.icon-swatch:hover { background: #ffffff; box-shadow: var(--re-shadow-b); transform: translateY(-1px); }
.icon-swatch.active {
    background: var(--re-accent-soft);
    color: var(--re-accent);
    box-shadow: inset 0 0 0 1px rgb(37 99 235 / 0.35);
}

.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--re-surface-2);
    color: var(--re-ink-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: transform .12s var(--re-ease), box-shadow .15s var(--re-ease);
}
.color-swatch.text-amber-300   { color: #f59e0b; }
.color-swatch.text-emerald-300 { color: #10b981; }
.color-swatch.text-sky-300     { color: #0ea5e9; }
.color-swatch.text-indigo-300  { color: #6366f1; }
.color-swatch.text-rose-300    { color: #f43f5e; }
.color-swatch.text-fuchsia-300 { color: #d946ef; }
.color-swatch.text-violet-300  { color: #8b5cf6; }
.color-swatch.text-cyan-300    { color: #06b6d4; }
.color-swatch.text-slate-300   { color: var(--re-ink-3); }
.color-swatch:hover { transform: translateY(-1px); box-shadow: var(--re-shadow-b); }
.color-swatch.active {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--re-accent);
}

/* ----------------------------------------------------------------------------
   Modal entrance / exit — JS toggles `.open` on the modal wrapper element
   ---------------------------------------------------------------------------- */
.modal-backdrop {
    opacity: 0;
    transition: opacity .2s var(--re-ease);
}
.modal-card {
    opacity: 0;
    transform: scale(.96) translateY(8px);
    transition: opacity .22s var(--re-ease), transform .28s var(--re-ease);
}
#examples-modal.open .modal-backdrop,
#constant-modal.open .modal-backdrop,
#function-modal.open .modal-backdrop { opacity: 1; }
#examples-modal.open .modal-card,
#constant-modal.open .modal-card,
#function-modal.open .modal-card {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ----------------------------------------------------------------------------
   Output popover (inline)
   ---------------------------------------------------------------------------- */
#output-popover {
    animation: popIn .18s var(--re-ease) both;
    transform-origin: top left;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(.96) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ----------------------------------------------------------------------------
   Toast notifications — JS adds `.toast.toast-<kind>` then toggles `.show`
   ---------------------------------------------------------------------------- */
.toast {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 16px 36px -10px rgb(15 23 42 / 0.18), 0 0 0 1px var(--re-border);
    color: var(--re-ink);
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(8px) scale(.98);
    transition: opacity .22s var(--re-ease), transform .22s var(--re-ease);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast .ico {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}
.toast.toast-success .ico { background: #d1fae5; color: #059669; }
.toast.toast-error   .ico { background: #fee2e2; color: #dc2626; }
.toast.toast-info    .ico { background: #dbeafe; color: var(--re-accent); }

/* ----------------------------------------------------------------------------
   Run-test pulse on result update
   ---------------------------------------------------------------------------- */
@keyframes resultPulse {
    0%, 100% { box-shadow: 0 1px 3px rgb(15 23 42 / 0.04), inset 0 0 0 1px var(--re-border); }
    50%      { box-shadow: 0 1px 3px rgb(15 23 42 / 0.04), inset 0 0 0 1px rgb(37 99 235 / 0.45); }
}
#output-card.pulse { animation: resultPulse .9s var(--re-ease); }

/* ----------------------------------------------------------------------------
   Scrollbars — refined, light
   ---------------------------------------------------------------------------- */
#schema-tree::-webkit-scrollbar,
#examples-list::-webkit-scrollbar,
#examples-categories::-webkit-scrollbar,
#constants-list::-webkit-scrollbar,
#functions-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
#schema-tree::-webkit-scrollbar-thumb,
#examples-list::-webkit-scrollbar-thumb,
#examples-categories::-webkit-scrollbar-thumb,
#constants-list::-webkit-scrollbar-thumb,
#functions-list::-webkit-scrollbar-thumb {
    background: rgb(15 23 42 / 0.12);
    border-radius: 999px;
}
#schema-tree::-webkit-scrollbar-thumb:hover,
#examples-list::-webkit-scrollbar-thumb:hover,
#examples-categories::-webkit-scrollbar-thumb:hover,
#constants-list::-webkit-scrollbar-thumb:hover,
#functions-list::-webkit-scrollbar-thumb:hover {
    background: rgb(15 23 42 / 0.22);
}

/* ----------------------------------------------------------------------------
   Example list items inside the modal
   ---------------------------------------------------------------------------- */
.example-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--re-shadow-b);
    cursor: pointer;
    transition: background-color .15s var(--re-ease), box-shadow .15s var(--re-ease), transform .12s var(--re-ease);
}
.example-item:hover {
    background: var(--re-surface-2);
    transform: translateX(1px);
}
.example-item.active {
    background: var(--re-accent-soft);
    box-shadow: inset 0 0 0 1px rgb(37 99 235 / 0.35);
}
.example-item .item-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--re-surface-2);
    color: var(--re-ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}
.example-item.active .item-icon { background: #ffffff; color: var(--re-accent); }
.example-item .item-title {
    font-size: 12px;
    color: var(--re-ink);
    font-weight: 500;
    line-height: 1.3;
}
.example-item .item-desc {
    font-size: 10.5px;
    color: var(--re-ink-2);
    line-height: 1.35;
    margin-top: 1px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ----------------------------------------------------------------------------
   Drag / insert micro-feedback
   ---------------------------------------------------------------------------- */
.dragging-source { opacity: 0.5; }
.dragging-pill   { opacity: 0.45; transform: scale(0.96); transition: opacity .15s, transform .15s; }
.just-inserted {
    animation: justInserted .55s var(--re-ease);
}
@keyframes justInserted {
    0%   { box-shadow: 0 0 0 0 rgb(37 99 235 / 0.45); background: rgb(219 234 254 / 0.8); }
    100% { box-shadow: 0 0 0 8px rgb(37 99 235 / 0); background: transparent; }
}

/* Hide schema entries that don't match the search filter */
.schema-hidden { display: none !important; }

/* Focus mode collapses the side panels */
body.focus-mode aside#schema-aside,
body.focus-mode main > div > aside { display: none; }
body.focus-mode #editor-section    { flex: 1; }

/* ----------------------------------------------------------------------------
   Skeleton shimmer for run-test placeholders (when JS sets .skeleton)
   ---------------------------------------------------------------------------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--re-surface-2);
    color: transparent !important;
}
.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.5), transparent);
    animation: shimmer 1.2s infinite var(--re-ease-out);
}
@keyframes shimmer {
    100% { transform: translateX(100%); }
}
