/* Menú contextual propio: compacto, legible y coherente con las superficies del estudio. */
.codego-context-menu {
  position: fixed;
  z-index: 2147483000;
  width: min(248px, calc(100vw - 16px));
  margin: 0;
  padding: 5px;
  overflow: hidden;
  border: 1px solid var(--n-300, #cbd5e1);
  border-radius: var(--r-md, 10px);
  background: rgb(255 255 255 / .98);
  box-shadow: 0 16px 42px rgb(16 27 48 / .2), 0 2px 8px rgb(16 27 48 / .1);
  color: var(--n-900, #101b30);
  font-family: var(--font-ui, system-ui, sans-serif);
  backdrop-filter: blur(12px);
  animation: codego-context-in 110ms cubic-bezier(.2, .8, .2, 1);
}
.codego-context-menu[hidden] { display: none; }
.codego-context-heading {
  padding: 6px 9px 5px;
  overflow: hidden;
  color: var(--n-600, #66748c);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .065em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.codego-context-heading.is-danger { color: #b42318; }
.codego-context-action {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--r-sm, 6px);
  background: transparent;
  color: var(--n-850, #17243b);
  font: 600 12px/1.2 var(--font-ui, system-ui, sans-serif);
  text-align: left;
  cursor: pointer;
}
.codego-context-action:hover,
.codego-context-action:focus-visible { outline: 0; background: var(--accent-50, #eef2ff); color: var(--accent-700, #173aa8); }
.codego-context-action.is-danger { color: #b42318; }
.codego-context-action.is-danger:hover,
.codego-context-action.is-danger:focus-visible { background: #fff1ef; color: #8f1d13; }
.codego-context-action:disabled { opacity: .42; cursor: default; }
.codego-context-action .i { width: 16px; height: 16px; }
.codego-context-action > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codego-context-action kbd { color: var(--n-500, #72809a); font: 500 9.5px/1 var(--font-mono, ui-monospace, monospace); }
.codego-context-separator { height: 1px; margin: 4px 6px; background: var(--n-200, #e2e8f0); }
@keyframes codego-context-in { from { opacity: 0; transform: translateY(-3px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) {
  .codego-context-menu { width: min(280px, calc(100vw - 16px)); }
  .codego-context-action { min-height: 40px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .codego-context-menu { animation: none; } }
