/* ── Look-up source trigger button ─────────────────────── */
.lus-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  flex-shrink: 0;
  padding: 0;
  font-family: inherit;
  line-height: 1;
}
.lus-btn:hover       { background: rgba(0,0,0,0.06); color: var(--text, #0f172a); }
.lus-btn--active     { color: var(--text, #0f172a); background: rgba(0,0,0,0.06); }

[data-theme="dark"] .lus-btn:hover   { background: rgba(255,255,255,0.08); color: #e6edf3; }
[data-theme="dark"] .lus-btn--active { background: rgba(255,255,255,0.08); color: #3fb950; }

[data-theme="aurora"] .lus-btn:hover   { background: rgba(192,132,252,0.12); color: #c084fc; }
[data-theme="aurora"] .lus-btn--active { background: rgba(192,132,252,0.15); color: #c084fc; border-color: rgba(192,132,252,0.3); }

/* ── Popover panel ──────────────────────────────────────── */
.lus-popover {
  position: absolute;
  top: 28px;       /* just below the section label bar     */
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--code-bg, #f8fafc);
  border-top: 1px solid var(--border, #e2e8f0);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  max-height: 260px;
  display: flex;
  flex-direction: column;
}

.lus-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px 5px 10px;
  background: var(--bg, #f3f5f8);
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
}

.lus-lang-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted, #64748b);
  font-family: var(--code-font, "JetBrains Mono", monospace);
}

/* ── Copy button ─────────────────────────────────────────── */
.lus-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  padding: 0;
}
.lus-copy-btn:hover        { background: rgba(0,0,0,0.06); color: var(--text, #0f172a); }
.lus-copy-btn--done        { color: #16a34a; }

/* ── Code block ─────────────────────────────────────────── */
.lus-code {
  margin: 0;
  padding: 10px 12px;
  overflow-y: auto;
  overflow-x: auto;
  font-family: var(--code-font, "JetBrains Mono", "Courier New", monospace);
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre;
  color: var(--text, #102040);
  flex: 1;
  min-height: 0;
}

/* ── Dark overrides ─────────────────────────────────────── */
[data-theme="dark"] .lus-popover        { background: #010409; border-top-color: #30363d; box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
[data-theme="dark"] .lus-popover-header { background: #0d1117; border-bottom-color: #30363d; }
[data-theme="dark"] .lus-lang-label     { color: #3fb950; }
[data-theme="dark"] .lus-copy-btn:hover { background: rgba(255,255,255,0.08); color: #e6edf3; }
[data-theme="dark"] .lus-copy-btn--done { color: #3fb950; }
[data-theme="dark"] .lus-code           { color: #e6edf3; }

/* ── Grey overrides ─────────────────────────────────────── */
[data-theme="grey"] .lus-btn:hover   { background: rgba(255,255,255,0.08); color: #adbac7; }
[data-theme="grey"] .lus-btn--active { background: rgba(255,255,255,0.08); color: #57ab5a; }
[data-theme="grey"] .lus-popover        { background: #1c2128; border-top-color: #444c56; box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
[data-theme="grey"] .lus-popover-header { background: #22272e; border-bottom-color: #444c56; }
[data-theme="grey"] .lus-lang-label     { color: #57ab5a; }
[data-theme="grey"] .lus-copy-btn:hover { background: rgba(255,255,255,0.08); color: #adbac7; }
[data-theme="grey"] .lus-copy-btn--done { color: #57ab5a; }
[data-theme="grey"] .lus-code           { color: #adbac7; }

/* ── Contrast overrides ─────────────────────────────────── */
[data-theme="aurora"] .lus-popover        { background: rgba(7,7,26,0.98); border-top: 1px solid rgba(192,132,252,0.3); box-shadow: 0 8px 32px rgba(192,132,252,0.15); }
[data-theme="aurora"] .lus-popover-header { background: rgba(13,13,46,0.6); border-bottom: 1px solid rgba(192,132,252,0.2); }
[data-theme="aurora"] .lus-lang-label     { color: #7070a0; }
[data-theme="aurora"] .lus-copy-btn:hover { background: rgba(192,132,252,0.12); color: #c084fc; }
[data-theme="aurora"] .lus-copy-btn--done { color: #34d399; }
[data-theme="aurora"] .lus-code           { color: #a5b4fc; }
