#qe-original-macro-source {
  --bg: var(--qe-bg);
  --bg2: var(--qe-card);
  --border: var(--qe-border);
  --text: var(--qe-text);
  --text2: var(--qe-muted);
  --text-3: var(--qe-muted);
  --green: var(--qe-good);
  --red: var(--qe-danger);
  box-sizing: border-box;
  width: calc(100% - 28px);
  margin-left: 14px;
  padding-top: 8px;
}

body.qe-rail-collapsed #qe-original-macro-source { width: calc(100% - 28px); }

/* The retained popover is mounted under body, outside the macro host's tokens. */
.popover-float {
  --bg2: var(--qe-card, #11151b);
  --text: var(--qe-text, #e5e7eb);
  --text-2: var(--qe-muted, #a1a1aa);
  --text-3: var(--qe-muted, #a1a1aa);
  --border: var(--qe-border, #353942);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
.qe-macro-source-date { font-size: 10px; color: var(--qe-muted, #a1a1aa); margin-top: 6px; }
#mv-grid [role="button"]:focus-visible,
#v33-macro-tiles [role="button"]:focus-visible { outline: 2px solid var(--qe-accent, #dfbb64); outline-offset: 2px; }

/* The retained rail state name is the compatibility alias for the
   donor's `rail-collapsed` class. Preserve the donor's Tools-handle gutter. */
body.qe-rail-collapsed #v33-macro-row { padding-left: 108px !important; }

@media (max-width: 920px) {
  #qe-original-macro-source,
  body.qe-rail-collapsed #qe-original-macro-source {
    margin-left: 0;
    width: 100%;
  }
}
